Lecture15RuntimeStack

Lecture15RuntimeStack - Runtime Stack A runtime stack (also...

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

View Full Document Right Arrow Icon
Runtime Stack A runtime stack (also called a Call Stack) is a special stack that stores information about the active methods of a computer program.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Purpose Keep track of return address that the method returns control to when it finishes executing
Background image of page 2
Runtime Stack Each time a method is called, the caller pushes the return address onto the stack and the method, when it finishes, pops the return address off the stack and transfers control to that address. If the pushing consumes all of the space allocated for the stack, an error called a stack overflow occurs.
Background image of page 3

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

View Full DocumentRight Arrow Icon
Adding a method entry to the stack is sometimes called winding ; conversely, removing entries is unwinding .
Background image of page 4
There is exactly one stack associated with a running program (or more accurately, with each task of a process).
Background image of page 5

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

View Full DocumentRight Arrow Icon
Stack contents Return address Local data storage Parameters Evaluation stack Pointer to current instance (i.e. this )
Background image of page 6
Structure The runtime stack is composed of stack frames (sometimes called
Background image of page 7

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

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/13/2008 for the course CSC 216 taught by Professor Miller during the Spring '08 term at N.C. State.

Page1 / 14

Lecture15RuntimeStack - Runtime Stack A runtime stack (also...

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

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