The run-time environment is the structure of the target computers registers and memory that serves to manage memory and maintain information needed to guide a programs execution process.
Types of Runtime Environments –
- Fully Static :
Fully static runtime environment may be useful for the languages in which pointers or dynamic allocation is not possible in addition to no support for recursive function calls.
- Every procedure will have only one activation record which is allocated before execution.
- Variables are accessed directly via fixed address.
- Little bookkeeping overhead; i.e., at most return address may have to be stored in activation record.
- The calling sequence involves the calculation of each argument address and storing into its appropriate parameter location and saving the return address and then a jump is made.
- Stack Based :
In this, activation records are allocated (push of the activation record) whenever a function call is made. The necessary memory is taken from the stack portion of the program. When program execution return from the function the memory used by the activation record is deallocated (pop of the activation record). Thus, the stack grows and shrinks with the chain of function calls.
- Fully Dynamic :
Functional language such as Lisp, ML, etc. use this style of call stack management. Silently, here activation record is deallocated only when all references to them have disappeared, and this requires the activation records to dynamically freed at arbitrary times during execution. Memory manager (garbage collector) is needed.
The data structure that handles such management is heap an this is also called as Heap Management.
Activation Record –
Information needed by a single execution of a procedure is managed using a contiguous block of storage called “activation record”.
An activation record is allocated when a procedure is entered and it is deallocated when that procedure is exited. It contain temporary data, local data, machine status, optional access link, optional control link, actual parameters and returned values.
- Program Counter (PC) – whose value is the address of the next instruction to be executed.
- Stack Pointer (SP) – whose value is the top of the (top of the stack, ToS).
- Frame pointer (FP) – which points to the current activation.
Activation records are allocated from one of static area (like Fortran 77), stack area (like C or Pascal) and heap area (like lisp).
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Runtime Environments in Compiler Design
- Difference between Memory and Storage
- Storage Structure in Operating Systems
- File Organization in DBMS | Set 1
- File Organization in DBMS | Set 3
- File Organization in DBMS | Set 2
- Purpose of an Interrupt in Computer Organization
- Computer Organization | Von Neumann architecture
- Last Minute Notes Computer Organization
- Cache Memory in Computer Organization
- Computer Organization | Micro-Operation
- Computer Organization | Amdahl's law and its proof
- Computer Organization | Different Instruction Cycles
- Computer Organization | RISC and CISC
- Computer Organization | Booth's Algorithm
- Computer Organization | Problem Solving on Instruction Format
- Computer Organization | Locality and Cache friendly code
- Computer Organization | Hardwired v/s Micro-programmed Control Unit
- Computer Organization | Instruction Formats (Zero, One, Two and Three Address Instruction)
- Differences between Computer Architecture and Computer Organization
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.