State for an invocation
The JVM specifies a new frame for each method invocation. Normal return or an uncaught exception completes it; a called method temporarily becomes current, after which control can return to the caller.
A JVM frame has locals, an operand stack and a reference to its class’s runtime constant pool. These are logical runtime requirements, leaving concrete storage decisions to the implementation.
References: [1]
Native calling conventions
Native calls need not place every argument or temporary on the stack. Microsoft’s default x64 convention passes early arguments in registers while requiring caller-reserved stack space; later arguments use the stack.
Exception unwinding and backtraces depend on recovering saved call state. Platform unwind information supports that task, so a frame cannot be reduced to one universal byte layout.
References: [3]
Language-level frame inspection
Python exposes frame accessors for code, line numbers, locals and an outer frame. Debuggers can inspect execution without relying on the interpreter’s internal structure layout.
Generators and coroutines can own frames too. Their suspended execution still needs saved state, showing why a logical frame’s lifetime is not always identical to an actively running native call.
References: [2]