/** * Insert a deopt entry for the graph's start node. */ @Override protected void finishPrepare(FixedWithNextNode startInstr, int bci, FrameStateBuilder state) { super.finishPrepare(startInstr, bci, state); if (getMethod().compilationInfo.isDeoptEntry(bci, false, false)) { DeoptEntryNode deoptEntry = append(new DeoptEntryNode()); deoptEntry.setStateAfter(frameState.create(bci, deoptEntry)); deoptEntries.put(Long.valueOf(bci), deoptEntry); insertProxies(deoptEntry, state); } }
@Override public void generate(NodeLIRBuilderTool gen) { gen.getLIRGeneratorTool().append(new DeoptEntryOp(((NodeLIRBuilder) gen).stateFor(stateAfter()))); }
private DeoptProxyAnchorNode createDeoptEntry(FrameStateBuilder stateBuilder, FrameState stateAfter, boolean anchorOnly) { DeoptProxyAnchorNode deoptEntry = graph.add(anchorOnly ? new DeoptProxyAnchorNode() : new DeoptEntryNode()); deoptEntry.setStateAfter(stateAfter); insertProxies(deoptEntry, stateBuilder); return deoptEntry; } }
public ValueNode createCFunctionCall(ValueNode targetAddress, List<ValueNode> arguments, Signature signature, boolean emitTransition, boolean emitDeoptTarget) { if (emitTransition) { append(new CFunctionPrologueNode()); } InvokeNode invoke = createIndirectCall(targetAddress, arguments, signature, SubstrateCallingConventionType.NativeCall); assert !emitDeoptTarget || !emitTransition : "cannot have transition for deoptimization targets"; if (emitTransition) { append(new CFunctionEpilogueNode()); } else if (emitDeoptTarget) { DeoptEntryNode deoptEntry = append(new DeoptEntryNode()); deoptEntry.setStateAfter(invoke.stateAfter()); } /* * Sign extend or zero the upper bits of a return value smaller than an int to preserve the * invariant that all such values are represented by an int in the VM. We cannot rely on the * native C compiler doing this for us. */ return getLoweringProvider().implicitLoadConvert(getGraph(), asKind(signature.getReturnType(null)), invoke); }
long encodedBci = FrameInfoEncoder.encodeBci(stateAfter.bci, stateAfter.duringCall(), stateAfter.rethrowException()); if (!deoptEntries.containsKey(encodedBci)) { DeoptEntryNode deoptEntry = graph.add(new DeoptEntryNode()); deoptEntry.setStateAfter(stateAfter); insertProxies(deoptEntry, frameState);