src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java

Print this page

        

*** 24,35 **** import java.util.ArrayDeque; import java.util.Arrays; import java.util.Queue; ! import org.graalvm.compiler.debug.Debug; ! import org.graalvm.compiler.debug.DebugCounter; import org.graalvm.compiler.debug.GraalError; import org.graalvm.compiler.lir.ConstantValue; import org.graalvm.compiler.lir.LIRFrameState; import org.graalvm.compiler.lir.LabelRef; import org.graalvm.compiler.lir.Variable; --- 24,35 ---- import java.util.ArrayDeque; import java.util.Arrays; import java.util.Queue; ! import org.graalvm.compiler.debug.CounterKey; ! import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.debug.GraalError; import org.graalvm.compiler.lir.ConstantValue; import org.graalvm.compiler.lir.LIRFrameState; import org.graalvm.compiler.lir.LabelRef; import org.graalvm.compiler.lir.Variable;
*** 40,51 **** import org.graalvm.compiler.nodes.util.GraphUtil; import org.graalvm.compiler.nodes.virtual.EscapeObjectState; import org.graalvm.compiler.nodes.virtual.VirtualObjectNode; import org.graalvm.compiler.virtual.nodes.MaterializedObjectState; import org.graalvm.compiler.virtual.nodes.VirtualObjectState; - import org.graalvm.util.Equivalence; import org.graalvm.util.EconomicMap; import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.VirtualObject; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; --- 40,51 ---- import org.graalvm.compiler.nodes.util.GraphUtil; import org.graalvm.compiler.nodes.virtual.EscapeObjectState; import org.graalvm.compiler.nodes.virtual.VirtualObjectNode; import org.graalvm.compiler.virtual.nodes.MaterializedObjectState; import org.graalvm.compiler.virtual.nodes.VirtualObjectState; import org.graalvm.util.EconomicMap; + import org.graalvm.util.Equivalence; import jdk.vm.ci.code.BytecodeFrame; import jdk.vm.ci.code.VirtualObject; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind;
*** 59,71 **** * Builds {@link LIRFrameState}s from {@link FrameState}s. */ public class DebugInfoBuilder { protected final NodeValueMap nodeValueMap; ! public DebugInfoBuilder(NodeValueMap nodeValueMap) { this.nodeValueMap = nodeValueMap; } private static final JavaValue[] NO_JAVA_VALUES = {}; private static final JavaKind[] NO_JAVA_KINDS = {}; --- 59,73 ---- * Builds {@link LIRFrameState}s from {@link FrameState}s. */ public class DebugInfoBuilder { protected final NodeValueMap nodeValueMap; + protected final DebugContext debug; ! public DebugInfoBuilder(NodeValueMap nodeValueMap, DebugContext debug) { this.nodeValueMap = nodeValueMap; + this.debug = debug; } private static final JavaValue[] NO_JAVA_VALUES = {}; private static final JavaKind[] NO_JAVA_KINDS = {};
*** 274,287 **** protected JavaValue computeLockValue(FrameState state, int i) { return toJavaValue(state.lockAt(i)); } ! private static final DebugCounter STATE_VIRTUAL_OBJECTS = Debug.counter("StateVirtualObjects"); ! private static final DebugCounter STATE_ILLEGALS = Debug.counter("StateIllegals"); ! private static final DebugCounter STATE_VARIABLES = Debug.counter("StateVariables"); ! private static final DebugCounter STATE_CONSTANTS = Debug.counter("StateConstants"); private static JavaKind toSlotKind(ValueNode value) { if (value == null) { return JavaKind.Illegal; } else { --- 276,289 ---- protected JavaValue computeLockValue(FrameState state, int i) { return toJavaValue(state.lockAt(i)); } ! private static final CounterKey STATE_VIRTUAL_OBJECTS = DebugContext.counter("StateVirtualObjects"); ! private static final CounterKey STATE_ILLEGALS = DebugContext.counter("StateIllegals"); ! private static final CounterKey STATE_VARIABLES = DebugContext.counter("StateVariables"); ! private static final CounterKey STATE_CONSTANTS = DebugContext.counter("StateConstants"); private static JavaKind toSlotKind(ValueNode value) { if (value == null) { return JavaKind.Illegal; } else {
*** 306,338 **** if (vobject == null) { vobject = VirtualObject.get(obj.type(), virtualObjects.size()); virtualObjects.put(obj, vobject); pendingVirtualObjects.add(obj); } ! STATE_VIRTUAL_OBJECTS.increment(); return vobject; } } else { // Remove proxies from constants so the constant can be directly embedded. ValueNode unproxied = GraphUtil.unproxify(value); if (unproxied instanceof ConstantNode) { ! STATE_CONSTANTS.increment(); return unproxied.asJavaConstant(); } else if (value != null) { ! STATE_VARIABLES.increment(); Value operand = nodeValueMap.operand(value); if (operand instanceof ConstantValue && ((ConstantValue) operand).isJavaConstant()) { return ((ConstantValue) operand).getJavaConstant(); } else { assert operand instanceof Variable : operand + " for " + value; return (JavaValue) operand; } } else { // return a dummy value because real value not needed ! STATE_ILLEGALS.increment(); return Value.ILLEGAL; } } } catch (GraalError e) { throw e.addContext("toValue: ", value); --- 308,340 ---- if (vobject == null) { vobject = VirtualObject.get(obj.type(), virtualObjects.size()); virtualObjects.put(obj, vobject); pendingVirtualObjects.add(obj); } ! STATE_VIRTUAL_OBJECTS.increment(debug); return vobject; } } else { // Remove proxies from constants so the constant can be directly embedded. ValueNode unproxied = GraphUtil.unproxify(value); if (unproxied instanceof ConstantNode) { ! STATE_CONSTANTS.increment(debug); return unproxied.asJavaConstant(); } else if (value != null) { ! STATE_VARIABLES.increment(debug); Value operand = nodeValueMap.operand(value); if (operand instanceof ConstantValue && ((ConstantValue) operand).isJavaConstant()) { return ((ConstantValue) operand).getJavaConstant(); } else { assert operand instanceof Variable : operand + " for " + value; return (JavaValue) operand; } } else { // return a dummy value because real value not needed ! STATE_ILLEGALS.increment(debug); return Value.ILLEGAL; } } } catch (GraalError e) { throw e.addContext("toValue: ", value);
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File