< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java

Print this page

        

*** 116,136 **** * * @param method the method whose frame is simulated * @param graph the target graph of Graal nodes created by the builder */ public FrameStateBuilder(GraphBuilderTool tool, ResolvedJavaMethod method, StructuredGraph graph) { ! this(tool, new ResolvedJavaMethodBytecode(method), graph); } /** * Creates a new frame state builder for the given code attribute, method and the given target ! * graph. * * @param code the bytecode in which the frame exists * @param graph the target graph of Graal nodes created by the builder */ ! public FrameStateBuilder(GraphBuilderTool tool, Bytecode code, StructuredGraph graph) { this.tool = tool; if (tool instanceof BytecodeParser) { this.parser = (BytecodeParser) tool; } else { this.parser = null; --- 116,137 ---- * * @param method the method whose frame is simulated * @param graph the target graph of Graal nodes created by the builder */ public FrameStateBuilder(GraphBuilderTool tool, ResolvedJavaMethod method, StructuredGraph graph) { ! this(tool, new ResolvedJavaMethodBytecode(method), graph, false); } /** * Creates a new frame state builder for the given code attribute, method and the given target ! * graph. Additionally specifies if nonLiveLocals should be retained. * * @param code the bytecode in which the frame exists * @param graph the target graph of Graal nodes created by the builder + * @param shouldRetainLocalVariables specifies if nonLiveLocals should be retained in state. */ ! public FrameStateBuilder(GraphBuilderTool tool, Bytecode code, StructuredGraph graph, boolean shouldRetainLocalVariables) { this.tool = tool; if (tool instanceof BytecodeParser) { this.parser = (BytecodeParser) tool; } else { this.parser = null;
*** 142,152 **** assert graph != null; this.monitorIds = EMPTY_MONITOR_ARRAY; this.graph = graph; ! this.clearNonLiveLocals = GraalOptions.OptClearNonLiveLocals.getValue(graph.getOptions()); this.canVerifyKind = true; } public void disableKindVerification() { canVerifyKind = false; --- 143,153 ---- assert graph != null; this.monitorIds = EMPTY_MONITOR_ARRAY; this.graph = graph; ! this.clearNonLiveLocals = GraalOptions.OptClearNonLiveLocals.getValue(graph.getOptions()) && !shouldRetainLocalVariables; this.canVerifyKind = true; } public void disableKindVerification() { canVerifyKind = false;
*** 628,643 **** return false; } public void clearNonLiveLocals(BciBlock block, LocalLiveness liveness, boolean liveIn) { /* ! * (lstadler) if somebody is tempted to remove/disable this clearing code: it's possible to ! * remove it for normal compilations, but not for OSR compilations - otherwise dead object ! * slots at the OSR entry aren't cleared. it is also not enough to rely on PiNodes with ! * Kind.Illegal, because the conflicting branch might not have been parsed. */ ! if (!clearNonLiveLocals) { return; } if (liveIn) { for (int i = 0; i < locals.length; i++) { if (!liveness.localIsLiveIn(block, i)) { --- 629,644 ---- return false; } public void clearNonLiveLocals(BciBlock block, LocalLiveness liveness, boolean liveIn) { /* ! * Non-live local clearing is mandatory for the entry block of an OSR compilation so that ! * dead object slots at the OSR entry are cleared. It's not sufficient to rely on PiNodes ! * with Kind.Illegal, because the conflicting branch might not have been parsed. */ ! boolean isOSREntryBlock = graph.isOSR() && getMethod().equals(graph.method()) && graph.getEntryBCI() == block.startBci; ! if (!clearNonLiveLocals && !isOSREntryBlock) { return; } if (liveIn) { for (int i = 0; i < locals.length; i++) { if (!liveness.localIsLiveIn(block, i)) {
< prev index next >