public class VerifyCFunctionReferenceMapsLIRPhase
extends org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase
CFunctionSnippets
for
details on the thread state transitions.
In the machine code, there are three instructions that have a reference map: the address loaded
as the "last Java instruction pointer", the C function call, and the slow-path call to block at a
safepoint. The first two are the same LIR instruction, therefore, in this phase we only see two
LIR instructions: the C function call and the slow-path call. This phase verifies that these two
calls have the same reference map. As long as the thread is in
Native
state, the safepoint manager can transition it into
the Safepoint
state at any time and the safepoint code
can start walking the stack, using the JavaFrameAnchor
. This means that the GC can scan
the stack for roots any time while we are in the C function, while we are in the slow-path call,
or while transitioning between those two calls. Having different reference maps would lead to
wrong roots and therefore a crash of the GC.Constructor and Description |
---|
VerifyCFunctionReferenceMapsLIRPhase() |
Modifier and Type | Method and Description |
---|---|
protected CharSequence |
createName() |
protected void |
run(jdk.vm.ci.code.TargetDescription target,
org.graalvm.compiler.lir.gen.LIRGenerationResult lirGenRes,
org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext context) |
public VerifyCFunctionReferenceMapsLIRPhase()
protected CharSequence createName()
createName
in class org.graalvm.compiler.lir.phases.LIRPhase<org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext>
protected void run(jdk.vm.ci.code.TargetDescription target, org.graalvm.compiler.lir.gen.LIRGenerationResult lirGenRes, org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext context)
run
in class org.graalvm.compiler.lir.phases.LIRPhase<org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext>