generateReificationPreamble

fun generateReificationPreamble(method: MethodVisitor, onReification: L2PcOperand)

We're at a point where reification has been requested. A StackReifier has already been stashed in the Interpreter, and already-popped calls may have already queued actions in the reifier, to be executed in reverse order.

First, we stash the live registers in a bogus continuation that will resume at the specified target (onReification's target), which must be an L2_ENTER_L2_CHUNK. Then we create an action to invoke that continuation, and push that action onto the current StackReifier's action stack. Finally, we exit with the current reifier. When the L2_ENTER_L2_CHUNK is reached later, it will restore the registers and continue constructing the real continuation, with the knowledge that the Interpreter.getReifiedContinuation represents the caller.

Parameters

method

The JVM method being written.

onReification

Where to jump to after everything below this frame has been fully reified.