ThreadReference (Java SE 11 & JDK 11 ) (original) (raw)
Pop stack frames.
All frames up to and including the frame
are popped off the stack. The frame previous to the parameter frame
will become the current frame.
After this operation, this thread will be suspended at the invoke instruction of the target method that created frame
. The frame
's method can be reentered with a step into the instruction.
The operand stack is restored, however, any changes to the arguments that occurred in the called method, remain. For example, if the method foo
:
void foo(int x) {
System.out.println("Foo: " + x);
x = 4;
System.out.println("pop here");
}
was called with foo(7)
and foo
is popped at the second println
and resumed, it will print: Foo: 4
.
Locks acquired by a popped frame are released when it is popped. This applies to synchronized methods that are popped, and to any synchronized blocks within them.
Finally blocks are not executed.
No aspect of state, other than this thread's execution point and locks, is affected by this call. Specifically, the values of fields are unchanged, as are external resources such as I/O streams. Additionally, the target program might be placed in a state that is impossible with normal program flow; for example, order of lock acquisition might be perturbed. Thus the target program may proceed differently than the user would expect.
The specified thread must be suspended.
All StackFrame
objects for this thread are invalidated.
No events are generated by this method.
None of the frames through and including the frame for the caller of frame may be native.
Not all target virtual machines support this operation. Use VirtualMachine.canPopFrames() to determine if the operation is supported.