Run-time Internals: The Stack

The stack is a run-time data structure that provides the storage space needed for method calls and returns. All modern block-structured languages use stacks, and many processors have some hardware support for them. Unfortunately in recent years, the terminology has got a little looser; marketing people started using stack to mean any layered system service, such as the TCP/IP library, or an application server and container. In this chapter, stack means the LIFO (Last In First Out) data structure that provides space for local variables, and implements the method-calling conventions.

When you call a method, some housekeeping data, known as an activation record or stack frame, is pushed onto the stack. The activation ...

Get Just Java™ 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.