为了防止你继续yy+说一些并不存在的"术语",也为了防止你说我是yy的,所以我帮你在语言标准里摘了一大段废话
Java Virtual Machine Stacks
Each Java Virtual Machine thread has a private Java Virtual Machine stack, created
at the same time as the thread. A Java Virtual Machine stack stores frames (§2.6).
A Java Virtual Machine stack is analogous to the stack of a conventional language
such as C: it holds local variables and partial results, and plays a part in method
invocation and return. Because the Java Virtual Machine stack is never manipulated
directly except to push and pop frames, frames may be heap allocated. The memory
for a Java Virtual Machine stack does not need to be contiguous.
Fram
A frame is used to store data and partial results, as well as to perform dynamic
linking, return values for methods, and dispatch exceptions.
A new frame is created each time a method is invoked. A frame is destroyed when
its method invocation completes, whether that completion is normal or abrupt (it
throws an uncaught exception). Frames are allocated from the Java Virtual Machine
stack (§2.5.2) of the thread creating the frame. Each frame has its own array of
local variables (§2.6.1), its own operand stack (§2.6.2), and a reference to the run-
time constant pool (§2.5.5) of the class of the current method.
Heap
The Java Virtual Machine has a heap that is shared among all Java Virtual Machine
threads. The heap is the run-time data area from which memory for all class
instances and arrays is allocated.
Method Area
The Java Virtual Machine has a method area that is shared among all Java Virtual
Machine threads. The method area is analogous to the storage area for compiled
code of a conventional language or analogous to the "text" segment in an operating
system process. It stores per-class structures such as the run-time constant pool,
field and method data, and the code for methods and constructors, including
the special methods (§2.9) used in class and instance initialization and interface
initialization.
Run-Time Constant Pool
A run-time constant pool is a per-class or per-interface run-time representation
of the constant_pool table in a class file (§4.4). It contains several kinds of
constants, ranging from numeric literals known at compile-time to method and field
references that must be resolved at run-time. The run-time constant pool serves a
function similar to that of a symbol table for a conventional programming language,
although it contains a wider range of data than a typical symbol table. |