SlideShare une entreprise Scribd logo
1  sur  10
COMPILER DESIGN
RUN-TIME
ENVIRONMENTS
Shashwat Shriparv
dwivedishashwat@gmail.com
InfinitySoft
Run-time mainly deals with the actions that
must occur to implement the program
• The allocation and deallocation of
data objects is managed by the
run-time support package
• The representation of data
objects at run-time is determined
by its type
Source Language Issues
Procedures
A procedure definition is a declaration
that, in its simplest form, associates
an identifier with a statement.
identifier is the procedure name &
statement is the procedure body
A Pascal pgm for reading & sorting integers
program sort(input,output);
var a : array [0…10] of integer;
procedure readarray;
var i: integer;
begin
for i := 1 to 9 do read (a[i])
end;
function partition (y, z: integer) : integer;
var i,j,x,v : integer;
begin…
end;
procedure quicksort (m,n : integer);
var i : integer;
begin
if( n > m) then begin
i := partition(m,n);
quicksort(m,i-1);
quicksort(i+1,n);
end
end;
begin
a[0] := -9999; a[10] := 9999;
readarray;
quicksort(1,9)
end
Activation Trees
Assumptions about the flow of control
among procedures during the execution of
a program:
Control flows sequentially
Each execution of a procedure starts at
the beginning of the procedure body and
eventually returns control to the point
immediately following the place where the
procedure was called
Execution of a procedure body is referred
to as an activation of the procedure
The “lifetime” of an activation of a
procedure is the sequence of steps b/w
the first and last steps in the execution of
the procedure body including the time
spent for execution
Lifetimes are either non-overlapping or
nested
A procedure is recursive if a new
activation can begin before an earlier
activation of the same procedure has
ended
An “activation tree” is used to depict the
way control enters and leaves activations
In an activation tree:
Each node represents an activation of a
procedure
The root represents the activation of the
main program
The node for a is the parent of the node
for b iff control flows from activation a to b
The node for a is to the left of the node for
b iff the lifetime of a occurs before the
lifetime of b
Output suggesting the activations of procedures
enter readarray
leave readarray
enter quicksort(1,9)
enter partition(1,9)
leave partition(1,9)
enter quicksort(1,3)
leave quicksort(1,3)
enter quicksort(5,9)
leave quicksort(5,9)
leave quicksort(1,9)
execution terminated
Shashwat Shriparv
dwivedishashwat@gmail.com
InfinitySoft

Contenu connexe

Tendances

09 implementing+subprograms
09 implementing+subprograms09 implementing+subprograms
09 implementing+subprogramsbaran19901990
 
Unit 3-pipelining & vector processing
Unit 3-pipelining & vector processingUnit 3-pipelining & vector processing
Unit 3-pipelining & vector processingvishal choudhary
 
Chap6 procedures & macros
Chap6 procedures & macrosChap6 procedures & macros
Chap6 procedures & macrosHarshitParkar6677
 
Sreerag parallel programming
Sreerag   parallel programmingSreerag   parallel programming
Sreerag parallel programmingSreerag Gopinath
 
Inside LoLA - Experiences from building a state space tool for place transiti...
Inside LoLA - Experiences from building a state space tool for place transiti...Inside LoLA - Experiences from building a state space tool for place transiti...
Inside LoLA - Experiences from building a state space tool for place transiti...Universität Rostock
 
Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...telestax
 
Cloud schedulers and Scheduling in Hadoop
Cloud schedulers and Scheduling in HadoopCloud schedulers and Scheduling in Hadoop
Cloud schedulers and Scheduling in HadoopPallav Jha
 
Integrated Register Allocation introduction
Integrated Register Allocation introductionIntegrated Register Allocation introduction
Integrated Register Allocation introductionShiva Chen
 
Computer Organozation
Computer OrganozationComputer Organozation
Computer OrganozationAabha Tiwari
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPIyaman dua
 
FARIS: Fast and Memory-efficient URL Filter by Domain Specific Machine
FARIS: Fast and Memory-efficient URL Filter by Domain Specific MachineFARIS: Fast and Memory-efficient URL Filter by Domain Specific Machine
FARIS: Fast and Memory-efficient URL Filter by Domain Specific MachineYuuki Takano
 

Tendances (18)

09 implementing+subprograms
09 implementing+subprograms09 implementing+subprograms
09 implementing+subprograms
 
Run time
Run timeRun time
Run time
 
Unit 3-pipelining & vector processing
Unit 3-pipelining & vector processingUnit 3-pipelining & vector processing
Unit 3-pipelining & vector processing
 
SDD Predefined Functions
SDD Predefined FunctionsSDD Predefined Functions
SDD Predefined Functions
 
Chap6 procedures & macros
Chap6 procedures & macrosChap6 procedures & macros
Chap6 procedures & macros
 
Heap Management
Heap ManagementHeap Management
Heap Management
 
Sreerag parallel programming
Sreerag   parallel programmingSreerag   parallel programming
Sreerag parallel programming
 
Inside LoLA - Experiences from building a state space tool for place transiti...
Inside LoLA - Experiences from building a state space tool for place transiti...Inside LoLA - Experiences from building a state space tool for place transiti...
Inside LoLA - Experiences from building a state space tool for place transiti...
 
Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...Mobicents Media Server theory, practice, cloud considerations, design discuss...
Mobicents Media Server theory, practice, cloud considerations, design discuss...
 
Pipeline
PipelinePipeline
Pipeline
 
Cloud schedulers and Scheduling in Hadoop
Cloud schedulers and Scheduling in HadoopCloud schedulers and Scheduling in Hadoop
Cloud schedulers and Scheduling in Hadoop
 
Integrated Register Allocation introduction
Integrated Register Allocation introductionIntegrated Register Allocation introduction
Integrated Register Allocation introduction
 
Computer Organozation
Computer OrganozationComputer Organozation
Computer Organozation
 
Compiler 2011-8-re1
Compiler 2011-8-re1Compiler 2011-8-re1
Compiler 2011-8-re1
 
Introduction to MPI
Introduction to MPIIntroduction to MPI
Introduction to MPI
 
FARIS: Fast and Memory-efficient URL Filter by Domain Specific Machine
FARIS: Fast and Memory-efficient URL Filter by Domain Specific MachineFARIS: Fast and Memory-efficient URL Filter by Domain Specific Machine
FARIS: Fast and Memory-efficient URL Filter by Domain Specific Machine
 
Code optimization
Code optimizationCode optimization
Code optimization
 
Chapter 5 notes new
Chapter 5 notes newChapter 5 notes new
Chapter 5 notes new
 

En vedette

Wind energy tech 2015
Wind energy tech  2015Wind energy tech  2015
Wind energy tech 2015Lonnie Gamble
 
Geothermal energy projects in Hungary and Tuscany
Geothermal energy projects in Hungary and TuscanyGeothermal energy projects in Hungary and Tuscany
Geothermal energy projects in Hungary and TuscanyLuca Madiai
 
Chemical energy
Chemical energyChemical energy
Chemical energyclee12
 
Microbial fuel cell – for conversion of chemical energy to electrical energy
Microbial fuel cell – for conversion of chemical energy to electrical energyMicrobial fuel cell – for conversion of chemical energy to electrical energy
Microbial fuel cell – for conversion of chemical energy to electrical energyrita martin
 
Biomass Energy Technologies-Prof. K.R.Shrestha
Biomass Energy Technologies-Prof. K.R.ShresthaBiomass Energy Technologies-Prof. K.R.Shrestha
Biomass Energy Technologies-Prof. K.R.ShresthaDr.Krishna Shrestha
 
Ocean thermal energy conversion
Ocean thermal energy conversionOcean thermal energy conversion
Ocean thermal energy conversionPankaj Kumar
 
Offshore wind energy in India Overview
Offshore wind energy in India OverviewOffshore wind energy in India Overview
Offshore wind energy in India OverviewShantanuBHG
 
Energy Sources and Transfer of Energy
Energy Sources and Transfer of EnergyEnergy Sources and Transfer of Energy
Energy Sources and Transfer of EnergyShafie Sofian
 
Hydrogen And Fuel Cell Technology For A Sustainable Future
Hydrogen And Fuel Cell Technology For A Sustainable FutureHydrogen And Fuel Cell Technology For A Sustainable Future
Hydrogen And Fuel Cell Technology For A Sustainable FutureGavin Harper
 
Code Optimization
Code OptimizationCode Optimization
Code Optimizationguest9f8315
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recoveryTech_MX
 
Biomass Power Point
Biomass Power PointBiomass Power Point
Biomass Power Pointguestcc80f8
 
Overview of Wind Energy
Overview of Wind EnergyOverview of Wind Energy
Overview of Wind EnergyJerilene
 
Renewable Energy - Intro ppt
Renewable Energy - Intro pptRenewable Energy - Intro ppt
Renewable Energy - Intro pptSaurabh Mehta
 
Solar energy ppt
Solar energy pptSolar energy ppt
Solar energy pptshubhajit_b
 
Biomass energy ppt
Biomass energy pptBiomass energy ppt
Biomass energy pptSann Jana
 

En vedette (20)

Energies
EnergiesEnergies
Energies
 
Wind energy tech 2015
Wind energy tech  2015Wind energy tech  2015
Wind energy tech 2015
 
Geothermal energy projects in Hungary and Tuscany
Geothermal energy projects in Hungary and TuscanyGeothermal energy projects in Hungary and Tuscany
Geothermal energy projects in Hungary and Tuscany
 
Chemical energy
Chemical energyChemical energy
Chemical energy
 
Microbial fuel cell – for conversion of chemical energy to electrical energy
Microbial fuel cell – for conversion of chemical energy to electrical energyMicrobial fuel cell – for conversion of chemical energy to electrical energy
Microbial fuel cell – for conversion of chemical energy to electrical energy
 
Biomass Energy Technologies-Prof. K.R.Shrestha
Biomass Energy Technologies-Prof. K.R.ShresthaBiomass Energy Technologies-Prof. K.R.Shrestha
Biomass Energy Technologies-Prof. K.R.Shrestha
 
Ocean thermal energy conversion
Ocean thermal energy conversionOcean thermal energy conversion
Ocean thermal energy conversion
 
Offshore wind energy in India Overview
Offshore wind energy in India OverviewOffshore wind energy in India Overview
Offshore wind energy in India Overview
 
ppt of biomass energy
ppt of biomass energyppt of biomass energy
ppt of biomass energy
 
Energy Sources and Transfer of Energy
Energy Sources and Transfer of EnergyEnergy Sources and Transfer of Energy
Energy Sources and Transfer of Energy
 
Hydrogen And Fuel Cell Technology For A Sustainable Future
Hydrogen And Fuel Cell Technology For A Sustainable FutureHydrogen And Fuel Cell Technology For A Sustainable Future
Hydrogen And Fuel Cell Technology For A Sustainable Future
 
Code Optimization
Code OptimizationCode Optimization
Code Optimization
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recovery
 
Biomass Power Point
Biomass Power PointBiomass Power Point
Biomass Power Point
 
Overview of Wind Energy
Overview of Wind EnergyOverview of Wind Energy
Overview of Wind Energy
 
Renewable Energy - Intro ppt
Renewable Energy - Intro pptRenewable Energy - Intro ppt
Renewable Energy - Intro ppt
 
Wind Energy
Wind EnergyWind Energy
Wind Energy
 
Run time storage
Run time storageRun time storage
Run time storage
 
Solar energy ppt
Solar energy pptSolar energy ppt
Solar energy ppt
 
Biomass energy ppt
Biomass energy pptBiomass energy ppt
Biomass energy ppt
 

Similaire à Compiler design

maXbox Starter 36 Software Testing
maXbox Starter 36 Software TestingmaXbox Starter 36 Software Testing
maXbox Starter 36 Software TestingMax Kleiner
 
Operating System Lab Manual
Operating System Lab ManualOperating System Lab Manual
Operating System Lab ManualBilal Mirza
 
Ch7 OS
Ch7 OSCh7 OS
Ch7 OSC.U
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01Wingston
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxstilliegeorgiana
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxdenneymargareta
 
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfWrite a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfsravi07
 
Lab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docx
Lab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docxLab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docx
Lab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docxfestockton
 
ECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/SnaptutorialECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/Snaptutorialpinck2380
 
ECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/SnaptutorialECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/Snaptutorialpinck200
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialTo Sum It Up
 
Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationWayne Jones Jnr
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsashukiller7
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariTHE NORTHCAP UNIVERSITY
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)Make Mannan
 
memory_allocation_use1.ppt
memory_allocation_use1.pptmemory_allocation_use1.ppt
memory_allocation_use1.pptKanchanTiwari45
 
Reverse Engineering automation
Reverse Engineering automationReverse Engineering automation
Reverse Engineering automationPositive Hack Days
 

Similaire à Compiler design (20)

maXbox Starter 36 Software Testing
maXbox Starter 36 Software TestingmaXbox Starter 36 Software Testing
maXbox Starter 36 Software Testing
 
Operating System Lab Manual
Operating System Lab ManualOperating System Lab Manual
Operating System Lab Manual
 
Ch7 OS
Ch7 OSCh7 OS
Ch7 OS
 
Introduction to Basic C programming 01
Introduction to Basic C programming 01Introduction to Basic C programming 01
Introduction to Basic C programming 01
 
Processes
ProcessesProcesses
Processes
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdfWrite a program in C or C++ which simulates CPU scheduling in an opera.pdf
Write a program in C or C++ which simulates CPU scheduling in an opera.pdf
 
Lab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docx
Lab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docxLab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docx
Lab 3 of 7 Process Management Simulation L A B  O V E R V I E W.docx
 
Os lab final
Os lab finalOs lab final
Os lab final
 
ECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/SnaptutorialECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/Snaptutorial
 
ECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/SnaptutorialECET 360 help A Guide to career/Snaptutorial
ECET 360 help A Guide to career/Snaptutorial
 
Problem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study materialProblem solving using computers - Unit 1 - Study material
Problem solving using computers - Unit 1 - Study material
 
Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process Synchronization
 
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbsSystem Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
System Calls.pptxnsjsnssbhsbbebdbdbshshsbshsbbs
 
Fundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan KumariFundamentals of computer programming by Dr. A. Charan Kumari
Fundamentals of computer programming by Dr. A. Charan Kumari
 
Functions
FunctionsFunctions
Functions
 
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)Lab manual operating system [cs 502 rgpv] (usefulsearch.org)  (useful search)
Lab manual operating system [cs 502 rgpv] (usefulsearch.org) (useful search)
 
memory_allocation_use1.ppt
memory_allocation_use1.pptmemory_allocation_use1.ppt
memory_allocation_use1.ppt
 
Reverse Engineering automation
Reverse Engineering automationReverse Engineering automation
Reverse Engineering automation
 

Plus de Shashwat Shriparv (20)

Learning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptxLearning Linux Series Administrator Commands.pptx
Learning Linux Series Administrator Commands.pptx
 
LibreOffice 7.3.pptx
LibreOffice 7.3.pptxLibreOffice 7.3.pptx
LibreOffice 7.3.pptx
 
Kerberos Architecture.pptx
Kerberos Architecture.pptxKerberos Architecture.pptx
Kerberos Architecture.pptx
 
Suspending a Process in Linux.pptx
Suspending a Process in Linux.pptxSuspending a Process in Linux.pptx
Suspending a Process in Linux.pptx
 
Kerberos Architecture.pptx
Kerberos Architecture.pptxKerberos Architecture.pptx
Kerberos Architecture.pptx
 
Command Seperators.pptx
Command Seperators.pptxCommand Seperators.pptx
Command Seperators.pptx
 
Upgrading hadoop
Upgrading hadoopUpgrading hadoop
Upgrading hadoop
 
Hadoop migration and upgradation
Hadoop migration and upgradationHadoop migration and upgradation
Hadoop migration and upgradation
 
R language introduction
R language introductionR language introduction
R language introduction
 
Hive query optimization infinity
Hive query optimization infinityHive query optimization infinity
Hive query optimization infinity
 
H base introduction & development
H base introduction & developmentH base introduction & development
H base introduction & development
 
Hbase interact with shell
Hbase interact with shellHbase interact with shell
Hbase interact with shell
 
H base development
H base developmentH base development
H base development
 
Hbase
HbaseHbase
Hbase
 
H base
H baseH base
H base
 
My sql
My sqlMy sql
My sql
 
Apache tomcat
Apache tomcatApache tomcat
Apache tomcat
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
 
Introduction to apache hadoop
Introduction to apache hadoopIntroduction to apache hadoop
Introduction to apache hadoop
 
Next generation technology
Next generation technologyNext generation technology
Next generation technology
 

Compiler design

  • 2. Run-time mainly deals with the actions that must occur to implement the program • The allocation and deallocation of data objects is managed by the run-time support package • The representation of data objects at run-time is determined by its type
  • 3. Source Language Issues Procedures A procedure definition is a declaration that, in its simplest form, associates an identifier with a statement. identifier is the procedure name & statement is the procedure body
  • 4. A Pascal pgm for reading & sorting integers program sort(input,output); var a : array [0…10] of integer; procedure readarray; var i: integer; begin for i := 1 to 9 do read (a[i]) end; function partition (y, z: integer) : integer; var i,j,x,v : integer; begin… end; procedure quicksort (m,n : integer); var i : integer; begin if( n > m) then begin i := partition(m,n); quicksort(m,i-1); quicksort(i+1,n); end end; begin a[0] := -9999; a[10] := 9999; readarray; quicksort(1,9) end
  • 5. Activation Trees Assumptions about the flow of control among procedures during the execution of a program: Control flows sequentially Each execution of a procedure starts at the beginning of the procedure body and eventually returns control to the point immediately following the place where the procedure was called
  • 6. Execution of a procedure body is referred to as an activation of the procedure The “lifetime” of an activation of a procedure is the sequence of steps b/w the first and last steps in the execution of the procedure body including the time spent for execution Lifetimes are either non-overlapping or nested
  • 7. A procedure is recursive if a new activation can begin before an earlier activation of the same procedure has ended An “activation tree” is used to depict the way control enters and leaves activations
  • 8. In an activation tree: Each node represents an activation of a procedure The root represents the activation of the main program The node for a is the parent of the node for b iff control flows from activation a to b The node for a is to the left of the node for b iff the lifetime of a occurs before the lifetime of b
  • 9. Output suggesting the activations of procedures enter readarray leave readarray enter quicksort(1,9) enter partition(1,9) leave partition(1,9) enter quicksort(1,3) leave quicksort(1,3) enter quicksort(5,9) leave quicksort(5,9) leave quicksort(1,9) execution terminated