activationrecord

activationrecord - 1 VERSION October 19, 2010 This can be...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
VERSION October 19, 2010 CS-441 Fall 2009 JWJ CS UK —This material is only for use in CS441-Fall 2009 in the Department of Computer Science at the University of Kentucky.— —Please, do not distribute.— 0.1 Run-time memory organization You remember the Fibonacci sequence and the corresponding code. Picture below shows the call tree for n=5. In this call tree one path is highlighted; this path corresponds to the active, incompleted calls. What is needed to successfully return from a call? We need to return the value (for functions), to restore the environment of the caller and to set the instruction pointer to the next instruction. The following figure shows this information. Field ”Addr” identifies the caller. Return addresses show the place in the code where the computation resumes after returning from call.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 VERSION October 19, 2010 This can be formalized. The information required to make successful calls and returns can be stored in a record, called an activation record (AR) or a frame. A typical format of an activation record is where AR are placed in the stack of activation records. The heap part is for dynamically allocated objects. Now, you can think that there is a piece of information associated with each active instance of the procedure (function) that allows us to restore the environment of the caller thus safely continue the computation upon returning. The stack of activation records for bonacci corresponding to the path in the gure above is: 2 VERSION October 19, 2010 3...
View Full Document

This document was uploaded on 12/14/2010.

Page1 / 3

activationrecord - 1 VERSION October 19, 2010 This can be...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online