0% found this document useful (0 votes)
44 views18 pages

ATCD Unit 4

Uploaded by

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

ATCD Unit 4

Uploaded by

ismartgamers6
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Atoxage Stoeae orgauizahen, btosape alleater

luntine
Aakuope aceM ton a a l name, aamdky
bngage tacalhg o dyamic Jtoape allocata
lade ophini gation
oghoni zod, en d baie dok, pephole optimizatn,
data
A

in t

location.
ts
The manapmet oud
Ahard bekseen
adden pate machine
and taugt
Compilea, ap oddes
The
addn, che
memag
Runtime menny

take Code ditumtnedl at compie tine


Statc Dab locatnu statc dto an abo be

8tack Dat oËeto alocatd t euntine


Cactaton eacd da)
fAee

alatd Jta
Heap otber dyamialy
objet a lutne

Runtme Storae Conen anto Hocks, whee a by


iuu uyed to Auos tu Amallyt unt h dwatd
a maene w

oejet db mutiple byte


and g tse fiut byte addeu.
bdivicled to bdl
Reuutme Aoape Cau be
be
tu diteet onçonent
Geneatd eseatalle Cda.

(2) Static dat obje ts


dat chiect
objed - heaf
(3) Dynam'e
(t) Automatie data objet - stack.

Static Wes Dyrane Atoee Alloaian:


State Drue
un-hme

Compile tinme allotation allocatn.

- The decinn ia
ma Cam be dead ny
s
bayed n the Contents shen

Jount dod punning


Code and statie Eq Btack and heap art
non- loa ad long -fim
- teap
vaxiabey meny
ae caeatd and dealloatd w
objeets
le nullfied.

Achvation Recods:
ContrlAtact a autime Stack ctich isu yed

live prldue achuakort,


to Keup rack tu
tind ct ta procduy
iey H ts ued to
hoe exeeuken have nst been Complutd
when tr actvahen beg tben ttbe prduu
to tte Bat ad tes
rane

eudh) Teu t oill be poppe


gatn (act atn
tue
Acbuaton elod iu uyed to menpe
Rntormahon nade a ingle
Procedu
An ach vaen uloyd u pubed nto te Stadk
ohen a poodns
re. Conol aetnt to tte allen tnchon.
The
Contenta & Achvahion

aataun a alue to Caing prcedue.


Achual (erameay Rotun hlue
Achual faamelas
poiamelas to alld proaduy Contro nt

Conbol lint - pote to ackiahn Accen nk


Calle. Saed
Macine Aau
Local da

ocal daa held tn TemporanA


to non
Clbe ahvaton ecovd A qeneal achation
RaCotd.
ots t hold toe
aled Maclne
the macline befie
intormatin abt Atatuy
tu alled.
prucadune
Local data i &t hodi tbe data
tbe execution dh the prduae.
Tempray': &+ thoves be Value tbat aie i
t5e ealuahion h an
an erpietien.

Stvaçe allbcaton
The ditet wayt fo allacati menay aui
) Stahe Stoape locaty
2)
Stack Ahoope alloato
Boae allaahon.
Stat'e Storoqe alloahioni
2n shatc alocaton, ramy are boud to
Atoxae locatios.
Compile te tien

Once.
Stae alloGahm bupots dmamie Jat
Suctuu bat meams, mamdy is ceaats t

Conptla tne and deadlaatd efta prpan Conplin


The dasbaek wt Bhate tovape alltabn it
toat be
le bnaun at Compe tne
- AnotbeL diaback a Aestichn dh tte

eleion proadu.

Stack stoage alloahon :


as a tack achva
Storage enol

Actaton Nelord ae pukad ad oppel


Contain te lolak do (bat
Achuatin rolord
eael
ale bound to fed Axae
achatn raCed.
ocay a delitd henTee achety
h
The value dh
Qudi alloak.
the an o LIfo Qud
and tha
at codt n
pporti tu Aoluin þroau.
teap sape allocation
- it ie te mot fleile alocaion Ahene.
Alloatn at dealleatien dy mundy Cau be
done t aud at any pae dopady
hequiemsd
Heap allocatien uUyd to allacati memdyto
and ten tue
the iauialy dpam'al
no nNe uyd ten claim bat.
allecahon bpponta the reauis
Heap Atoa
proceu.
Example
tact (Rnt ) n3

nof(n-)n6
eu huun20 avat
seln (n fact (n));
tot(6).
Code ophimizahon.

Macine derederd qphiiahen


adhine iadepeudat opimigaton
Mle tndepedut opimigatrs
tanormatims, toat Tmproye laiget Codi, wsitat
into Condeat
Macince .
Macuine depudut cpimi aton:.
Thie ophmizatoy katd
alloaon ard ctizahion b speciad macaine
iatuchon
Code cphi miahlon
Sechniçuyy db
me eNaulaha

Vauabe
Code elimise
y Dead-

ad
anduchion Naualle elinit
y
y stengts educhon.
Compile tne evauaton -

z - sx (u5-o|s-o)x )
evaluatd t

Gouple
(2) NaisHe hopapahion:.
Befoe optimizaben

( Dead- Code eiminaton:


uted
The Code that being
elimintJ
Behore eliminaion: Ata elimitien
C:
C= ayb
b deadt.
d= aybt4
dz a b+4
we hae eliminatd
(De
Ahta elininah'on
deadat

() Code moton:
be evaluation oyt
lonings loop nvaat statimet
eupcetien aud
out dh to oop.
az 20D)

ctaile (aro)

pitt(".d"a)
3

be
lwle (ao)

panty('da);

6) luduchon vawae. elimiaband Shergts veduc


The Atrengt reduchon à caed to rupke

qpeuata.
Tk oduchon Naiale u ed io he

tha -follaing
- Behore educhn: A{tu veducton

tu;

t tt4;
Untt-4
Paut

Lop obhmizahon:
machine -indepedad
+ & most valuabe
tnner Lop aky
epimigabn, beaye prfan
tme dh a rugtammel,
bulk te dh enuchos
be nunbe
Le decYeare
in an lnne
tben tbe
Auning
be improued even ih we incveae
Pogaa may atide that
that oop
h Code
tbe amaut
,
ophinizadn, ollainy treeteckne
for agp

Code mohio
Vayiabe ebminatto
) Code moion:
ed to decAate. be aumout
A iss
Code iu doop. Thie tranutormah'on taky a
luch an be moved othde t..
ß eypeten
wtout abhetsy
loop body
dilellu= Anit ) I| Ant doer ndt chanela
ttie Code mohn
attu

ite (i<=a) HAbot doe not Chanpe


le Bhmt, the linit -2
un tM
aa Lap tvauant epuehio
) ndchon atale elininaon

Saduce ttie numbeu h addiio in Lop


&t an
kae and Runtne
Aubine peufoiants
&t improvea bots code

tm-l

alt]
ty 4
aftl

tç alt
ts ast

Bx
(3) Reduchn in

Shength veduchen uted to replae tbe

expentive tse cheapee


tarset manchine
Additog à Conttaut u cheapey than a

totb adti h in tbe

Multplan u cheapa tban esponent so, ue


an audale exponet cth muspliatun wthn
the loop:
eponet
sefore Shengts Yeduchon!
Eat
Lolile (i< lo)

ali]ali]-2j
Ahtu Ahergts reduchon tbe Code sU be

u tuu above cade, & s cheapo o Conput

You might also like