Runtime Flashcards
activation record
data structure used to hold information relevant to one method call
static allocation
no heap or stack, all allocation records are in same static data area, one per method
advantages of static allocation
fast access to names (no need to compute address of variable at runtime)
no overhead of stack/heap manipulation
no overhead of stack/heap manipulation
disadvantages of static allocation
no recursion
no dynamic allocation
Calling method for static allocation
copies each arg into the corresponding space in the called method’s AR
jump/link - jump to the first instruction of called method, put return address in return addr register
Called method for static allocation
save regiters, initialize local data, copy return addr into return addr field
stack allocation
each time a method called, new AR pushed onto stack, popped when method returns