{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lecture15RuntimeStack

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

Info icon This 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.
Image of page 1

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

View Full Document Right Arrow Icon
Purpose Keep track of return address that the method returns control to when it finishes executing
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.
Image of page 3

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

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

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

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

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern