RUN-TIME STORAGE ORGANSATON
The runtime 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.
Type of Runtime Environments:-
1.Fully Static Runtime Environment:- Fully static runtime environment may be useful of the language in which pointers od dynamic allocation is not possible in addition to no support for recursive function calls.
i) Every procedure will have only one activation record which is allocated before execution.
ii) Variables are accessed directly via fixed addresses.
iii) Little book keeping overhead; i.e at most return adddress may have to be stored in activation record.
iv) The calling sequence involves calculation of each argument address and storing into its appropriate parameter location and saving the return address and then a jump is made.
2. Stack based Runtime Environment:- In this, activation records are allocate(Push of the activation records) whenever a function call is made.The necessary memory is taken from stack portion of the program.When program execution returns from function the memory used by the activation record is deallocated (pop of the activation record). Tus,stack grows and shrinks with the chain of function calls.
3. Fully Dynamic Runtime Environment:- Functional language such as activation records are De-allocated only when all references to them have disappeared, and this requires that activation records to dynamically frees at arbitrary times during execution.Memory manager (garbage collector) is needed.
ACTIVATION RECORDS:-
- 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 contains temporary data,local data,machine status , optional access link,optional control link,actual parameters and returned value.
i) Program Counter (PC) whose value is the address of the next instruction to be executed.
ii) Stack pointer (SP) whose value is top of the (top of stack,tos).
iii) Frame Pointer (FP) which points to the current activation record.
Type of Runtime Environments:-
1.Fully Static Runtime Environment:- Fully static runtime environment may be useful of the language in which pointers od dynamic allocation is not possible in addition to no support for recursive function calls.
i) Every procedure will have only one activation record which is allocated before execution.
ii) Variables are accessed directly via fixed addresses.
iii) Little book keeping overhead; i.e at most return adddress may have to be stored in activation record.
iv) The calling sequence involves calculation of each argument address and storing into its appropriate parameter location and saving the return address and then a jump is made.
2. Stack based Runtime Environment:- In this, activation records are allocate(Push of the activation records) whenever a function call is made.The necessary memory is taken from stack portion of the program.When program execution returns from function the memory used by the activation record is deallocated (pop of the activation record). Tus,stack grows and shrinks with the chain of function calls.
3. Fully Dynamic Runtime Environment:- Functional language such as activation records are De-allocated only when all references to them have disappeared, and this requires that activation records to dynamically frees at arbitrary times during execution.Memory manager (garbage collector) is needed.
ACTIVATION RECORDS:-
- 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 contains temporary data,local data,machine status , optional access link,optional control link,actual parameters and returned value.
i) Program Counter (PC) whose value is the address of the next instruction to be executed.
ii) Stack pointer (SP) whose value is top of the (top of stack,tos).
iii) Frame Pointer (FP) which points to the current activation record.
No comments