0% found this document useful (0 votes)
30 views20 pages

Compiler Design - UNIT-4

Based on Anna University affiliated syllabus

Uploaded by

Manimekalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
30 views20 pages

Compiler Design - UNIT-4

Based on Anna University affiliated syllabus

Uploaded by

Manimekalai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 20
\ Ont Ran time Environment and Cede Grenavolion Art Sternge Organization. brads Stack Allotahion Lpate he. Acceu 12 Nen-locol Daln on the Stack Aste Heap Manogemant An G- Lasues Pr Cool g.anayotren | Lob. Deaign oF Simple Cocke! Gesmbr. Lbs Stroge Dygeniestn: | AThe “cept preg in vihich J being exerted hag Ais own be callers Spain evel hoy a Localion fo seach py Value. © { The Comptler, 08 cud dong mathing mranogas and negaroas bo Aagul dll vers gpa Mapping f Lyre adden foto physrea/ addres i bona by es. %, Object Pregrenin = Data + Begron oeyen Memory allocahbn con be Contiyuon ound /nen- Conteynew € Conbiyaors alloca hin vefes fy Storey of byres Mn onseentive lyras and nen—tentiguent vefercs te The stormye of opp to avelehe free ag + The Qmow- t Mt : jvng@ Neeclaed fey con Obyee a food from tis clade ‘ope: & 4 i oie Tht -2 byres Float 1 byres Chasocter= | byte se hrrag cond Shrachore> Sloe to hold all of ts | Component. { Lethe adorns rp tonstratats of fomget machin la crucial voletn the Sterage Jeet fow | | 2eesel: when memory ava dtobiliry & move: | x mochine drchfrechores, nocd He Obyects do he propocly aia nod for pepe woxetubien, For 1 ehyects A bya bytes are allocaked where hw yr nk Lefe wtaa) » A Reader & ths spree Deft une du 6 a iad Comsdavedion « Cases: hon meme avnillillry 4 preminss «Date packer withonr poodle . & On ecerkion oddlerenal Tretrnchen: one we) to plate packeel dada for pepe align aSich-clivision £t Rurctine Meme. | 7 pled: DCoc Ga Siokictically clutormined even. | > Contd the executable fergot Cole “Whose sree & fixed at Compile fim. J-pSiabe: 5 gph alin bbl alats: objects whore stze Gh be known! ab Compile Him» > Te erably to Compr ths arslelrens of objets Pte tage Coole . Shek and heaps 4 The sire of Stack arel heap Vonres 08 tam Lkeutes. This aren & utilired at mntin. Stack > Tr Svea activation svecorels which ave generated Luoiy procaslure Calls. Heapo Te Shves achrvedion Long Livia! Lake which cre uncler the Contre! of apron of. hl Stake date || Shack | a Fires Space. | t ea | 9 eset Inga and lleatin ef cabs to mamy Ancahion fe vunhirus oan feel te be | aclolvenad. hoa. Stack — Allocatinn Spowe: af the allocahn spae of memery. clone clan’ fompile Hive Oud re U called static allocation: ax Th the Seppe About the soreye dos objects & krown only whale The program & W called Egnranic allocation’ - ). Sfack allocation a: Heap aia — x Qratk allocation: Bi Supports pootedoral calls (call }: pelts) Nema Lowel te the preudure ave al ota Spate. on Meck + » Voiel maint) my ae £ exert ink ty a elg add 0; 7 Cae por Protaras Vord adleley int %b/C) Yehuny Caarh ; priate (Sxel 0) L4* BS be am exec tion Proudlere call i can) DAR called proms, athich Comprise way Live achvahon on Contre] | Steth + Dt Coils of Collection of; folds: SP 2 ploucl on the top o& Sink fe ba Showed hy collery cork Callao! frenetens Biatk & arunkine stock for manayiry calls and veberns: b Nekvalton Reerd > Contre! | proteckure | A General [ Rebwred Value | Acteeal Rerumetors Bowed Nathine Stactus [esa toc cota “Tem porary 128 x Tem porary values gonented from walushon of | eacpesgrors which, CanneF ho Stored fn wopiters ave Sod | take feeb of empororrtes: Loud date hells Aaa Bat oh Local te an exeachion th a preedure x Lived mathira Slabs holds Patowmahon 6 th, state of the machine. - eThe ophoral aceers Lek F rserl nate | non-docal dat held otfey achvahin recone bout Ln Aces bike vowed for hon local mecovals Which, ave racdad | held rm ach'valion | Called preteddasre Le prnal Caneel lik point 0 The eohnkn ah of te Galler. IX Actual Poramebiv a waseol by callers prog to spp peovmediers do tha ‘called prtdure | ee fercvrrelors are Stored) om bres *The vebwned Value peels 3 wwead by Glled | predure te relam .avaloe He cl yl | } | [the staes ap ech of Huse feeble canbe | Ailivmind at Tha Hire ‘llr toe prota | tall OCCLUKS - ~ Acitahin retord u ¢ | CVA TIO) ord Ww yeokze) yr ee at hey, | all and pleted On Toc b q fe "| > fer even rebum achvabon yecord ty vemevel, > Galleng havens allocate wehVation Veco On bree cud Aotig | | meh'on Cnty fly bah pte mp > tat Rerun eo Vekhve Sede of maths | gee fee ee Continue afer call. a. Hfataerples Marr tle, vente) (Btcplef dusty, Gly fern | Ranmelonst relandl ei aoa Callers reser C -pogerwie Sbalder| ¢ fy 4p | Ranmctig LveR TA -vegpersibiliny Control Unk Callers Linke, & Swed stahys ‘Aciivalien i | Gallente Veto Fopensibibiy ae | vallass Commantadticl bpw Galler curl Galler ave plead ak the hegant ot Calleete acHvation yecord end Clee as posible re “tte Callets attevakion ewe. > Fike Leng Theme, re placed Ph the idl averd frequent lleterren ord deallecarion of ~ Pramony >i Jerms ize UG nob Known corely axe plestesp at the er of the athvation veel Tempore slut apsp— | ~> ToS pointes Sb reatesl by potahig fe the end et faced engi peels fa Qthvahon veterd - | > Reg ister tepsp pointers end PE nach enn Ohaus, fold fy the Curren | PP athvahen Yetord « | ealler cele topip bere He contrel | prsed to the taller. > Colla ey Gllay evlloGe fe. ccncl [rw ir 2 Golley Yores vehun address anf old voles top-sp tho Glloyrs athvation — rederol» | 3 (alloy frererun’ hp~sp Je Calle Sees vepd bo volves end other | Sinhes mapenat: So blle Pattialiow Pt aol cbete oral bagi etecahion | | | Ie Calhee peloces vetun valine Reh | poxomitors a Giles yesheves tp-sp cro other rey | vst wothire Saha field ard branches fo vehun aodres th Sahu tield . | | 3. Caller dotvements top-$P 1+ top ache) dos Which pornts. te the nex b ackvelton vewrel, poe point. Qe fepsp > Due + fad Local, iad —Aarat fields tt top aukvedk en pomially altel owes desir seed nv P Veter . A Peveosys %& P Aaivestion thee ae foros {4 ob. > Prudure phaucg Letalervaye » a Activahon record fe p Conboy oly. poorte 7 beptaning CE each array. wheal t exeeechny, Hage poindeve ave at known offsets prom hp Of Sik pointer fo t Cab con aAey aorta abements Toros there petebae 2 when preteclane J vetiuw, tp-SP G restored feeb tand ik an +L top = tep-$P — Darah (MCA +RVEP) in - ae whe / A scetnebon veterd ; M—> Madune . Sieh CA) Contra! ond Actors Link, RV 2 Retern Vol p 2 Revamaley frold ste Lerarh. Con be Knowh ad Compcle Fw fo GIy. Ae3- Heo t sy tleap holds’ date dunt Lifetime of prvgprem wm) qlebel vertables, Yathe. vowPoules . —> Varfabla Ybak ave decal: te the funeron Ove achive only whan He |tanenen aN frvekecl ewak is Life time _. of Pavel | eunekion: i | % mill be veqnes eel a | | The grate th hoop | “9 ’ dot met pang wpe Yogic Coll ay les sienege | Heap alle cob ° de-allo care, rere ns hd hy Pfs eX ‘ | | loo. LB tae ay, Ver mane) rt cub: pra Ord xd", kx, ay) poatf (8rd xd’ wa) %h) ; c of b] Sick | y Heap x Miele reine % aly cog tun, a and b fe he to be globe Neurtably whe & Jeud bh He pegron Ly caownge dow based an albelosatrane | of Veuable Conavned - | 5 Caledbel vonnably will be Shred fn hemp while the Letel voniobls weil be Sheol th Srack . > Heap provile mere Srecbl. Shrvege of bot fer tte io The Puen clloctal Pp the hop Dove Veale rncbuunped abel Pregroum makeg Wor G ip >No gprboye will be tn hoop > Heap peu mvs the Arellecorteol sce which cuertall. when activahon wererd ers . Hany raves Oo be em heels 1 Creating 4 Donked. Diep ir fro lec ; a dlokedl Lise when 2. benny ey Ew 3 Allocating mete \eutinble block of en Lisp. rarne trom Me keel ie | | on Code generator dakes an Mntermedie d | i ype ee ie bere os tip | awd | He © e}P predecar Ar epuavalene fort Prego a 3 Lode Generator proerves tho Semone mean a and gradi fr the Aang paer : a Tenet pre Wwe Te avetable cresounes effectively. Tesks Of bok. poremtor Lo Lratruth'en celechsy Jeahon and resign rE Regs toy O 3+ Instruchon oveloviry > Code Ophinizer dries de tran Pes He Pnremmediake — Coole ly the form wbvediare bse be Jenoelre move offical Lock » | | ST us | | V+ Dapue bm He Code ia a Tonga Pooevam 3+ Trarmeton Selectian by Repbter allocation G- Evollisutton Order. Deoput to Hea getede. generetor’ Tegel pre" g gtrontied heoesl on the typab-op. Code aero olerg with the Symbel table. > fete heal be property Sanred , posted uel Hever Loctiiol fa te frou end: lode. enter db tet tod othe she intermediate representation Bs free from Syalalic and gomortic Lreerg + poTheree adders tacbe. 2. Vietwl prothine epee 3. Lina vepreser Son 2 fink pity ingles reerch, prragrewn u Auperdle bn a The for ne coc Feckive | the feorger moh Les a DSem ef the beget matline @rchifachs, (i) Rie sduced Trsprachin Sub by (ii) Cle Conplex Tratrnchon fer = Cormprbiv : > Steck. sed , | (1) Vie posh aud Pp gperertton. (i) Jae iw he Machin C0) bua, (Cw) & net wid ryed becouse Of bre mar} wap Ta rel Moves - TS wotle +h Coole geneyabon eeenor y PL prodlices a” oorbombly Sorgrog e Progrem 8 ofp. | | Rise Clee 2 Fe Drstrraction “tee ile Fev -adlrey Acllnersirg nd] imple | Comply rneden | Re tively sine Veviolde bey 2 -Trarmcton Selection: Whe Complex tf aoe Prher meclnte, representation flo 0 Code Segnane exe cots} hy he tergeb machine 3 Letormined ley freter Such ow “ “a Nateve Of Vaginachdn 6d vebcire chy A-Level of IR 3 degre —qualiig of gente ppNatere Bujmahdn Sebr x 7h du frgpeachion Seb é uniform at | clune oloes neh Suppor frtemplite the Ferg mer exch dak pe In ce Wp manner. * Each execephion alae gpecal hadlirs % Some Of the Finpertank fentoves fa The Pramruction Seletton Ave? (i) Trarmation Speed Gi) Maddie febioms Gt) Type of tec WY) Redundant doad and Sove - Wid aaliy if ode [epreanion | The Gpalty Gf bade 5 dctermtnel by Fi | Heed, Size, time and (esr (ip: Register Allocation : Regishars ae he featest Compulilions! Unit on the targek machine iy cothe fee ty the Cok Generahion 5 Selecting what vals to hold in which ng, > The wegietev trsege Can be ase fed ay + Regiiter alletaheon > Prous of sm ee hoa * Regi ter Rusipmmunk-> 5 feng and The ophimel esta man | Of mito if | are chellryy (oak ere, | with gi shen qahing. | (WY Ewlaation Ovdere: = Tao The genunked teaget- Code howl be execube) fr the fagel mothine. Tha Sequmente of Creer ben ploy a vitel col tn The perform Of the tronet Coole | a The oveler ta whieh the Camputablng | Owe * performed con affech the oa the forge Coole Ab. Destin of. Strap Code Generation: > Code Qenevedlor G used fo generate Coll foe staple baste lek. >The basic block: G a Cellechen of Corsrqrsentechive threw oddros — akaterronts, Ei kespe toack of vepiter allocation ie > Regiitey sllecation a) Reg iter allocation uf the Poors oF decioleas owvhat Volws yep por heat > Requiber aesignmant: 9 Reyitey 469 The. proters of picky mp 0 veaster e teve a Nols. of Vowabl - afnutpal ses, veouper! > Regdters ove wed to Vel tornporertes qeneresbed whik Asxrg or expronion o butag The ed to held global = on ale be vs to he a2 | ey | > They help tn ranbine Storage I | | | | | remank ae ed ons rrathtne ardirechore Con (nv2ol > Code gonerabvon rss uss: 1s Cole selection | ye " Regas Fer allocation 3: ie Ordatag ~whe doreenting ta teryer coll, Py bode for raat Keep tenth of the ashy oud “Aecabion ot Vols Thae two desonpbors ; 1s Regi ber Olaenippor - a Adres Ane pry . oy | Regatey descriptor: 5 Restor duer'plor nactntrins tol, Shove) gn vegisrert > Tp rf the awnia bill rg og resi bo to the Coole queens > The Me. of apace ackoled ber generabirg Code ts dletoms ned by comsnlretng tts clewriplor + [Poesia ~> Rddees Auuriphe maintain ramon location which ove used tn the pry. > The values of there fiers aire Stover as tha veduus of roumes Ineghe be Stored ab vorens Aocorio’ dantag en erichdy, Code Gtenevohion A Laowitfm rt elect veyiter fer cath, TS wel be ore en ices Wh thee eee Skateruak o- Foun of spat lenge: De gf o noebed vowoble. Yu ahenby Stored Ta avepiber, PH vata Thab vepdter R heldeng Y- atl the sere ll Gb nok MH Yeaputes > then Pe Onottable Wid tex ue weal by he frase ath beth (aya @) ave nob happens Hoan iy picks up a regubher wshach tats Penden number of tad and stove operadiore r Por thes acleleoes jrpruchin 0p The form Kay ope) they, the following eachory ane. ev formed dep Lhea Lotah'’n 2 She He ofp Of given thakmuchion. ve Tha decotion. L whee, the slp ger cove iS detained by Me fanebion tall 5 gotRet)- athe aatolres clescriptor of ore of He oporanals 4 te Gultal ford oont the pretnt- Sacation of yo the Tnsledetin is Mov gl bis byeal 4o lepy Ha vol of 4 fe Lt tky 6 vet caer in Le | 3 4" efor po the bepiadl vous fy. ArtPa beation Of anstbar operand e B own ley the Sone preuy og that Of i by Me rapncction OF zjL- Henw z! wefrece to tHe Coped vile The wal hy Pe swhich & ‘loreal th hos be aun tot, Henw update Hh desenpbrs, op anh & fo tndteare that Ph Contours i vole oft Ard te value of se Gin L Kepectivaly , 6. Ones a ee ferthow Wwe “+ 7 md] a fod thay tn be tered mg Bee | boat | ar | vet a= | ol = vr Ak | phd rb td ove oe Vounirh less oud ty | ave Femporori Mocal te thos} beh. Ne Ro ke Re a bead Luv LDR, | ] [eae alt aR {bl eld {Ry Sub Ra, Ri Re Uaa-c LDeg meal] le TT i | Vetrw ADD R3Ra,Rp + “wT BREE avy » oof || IP L ff | XK

You might also like