# HG changeset patch # User Thomas Wuerthinger # Date 1359648256 -3600 # Node ID 1ceb9aeb5ea4448901742aa34beb2acb7ccd13a6 # Parent 017f9c2bcb6b47cafb77616959235dd23a4f92be Dead source code elimination. diff -r 017f9c2bcb6b -r 1ceb9aeb5ea4 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Thu Jan 31 16:28:55 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Thu Jan 31 17:04:16 2013 +0100 @@ -1743,7 +1743,7 @@ } }); - info.finish(registerRefMap, frameRefMap, frameMap); + info.finish(registerRefMap, frameRefMap); } private void assignLocations(List instructions, final IntervalWalker iw) { diff -r 017f9c2bcb6b -r 1ceb9aeb5ea4 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Thu Jan 31 16:28:55 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Thu Jan 31 17:04:16 2013 +0100 @@ -45,7 +45,7 @@ private HashMap virtualObjects = new HashMap<>(); private IdentityHashMap objectStates = new IdentityHashMap<>(); - public LIRFrameState build(FrameState topState, List lockData, List pointerSlots, LabelRef exceptionEdge, long leafGraphId) { + public LIRFrameState build(FrameState topState, List lockData, LabelRef exceptionEdge, long leafGraphId) { assert virtualObjects.size() == 0; assert objectStates.size() == 0; @@ -103,7 +103,7 @@ } objectStates.clear(); - return new LIRFrameState(frame, virtualObjectsArray, pointerSlots, exceptionEdge); + return new LIRFrameState(frame, virtualObjectsArray, exceptionEdge); } private BytecodeFrame computeFrameForState(FrameState state, List lockDataSlots, long leafGraphId) { diff -r 017f9c2bcb6b -r 1ceb9aeb5ea4 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu Jan 31 16:28:55 2013 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Thu Jan 31 17:04:16 2013 +0100 @@ -237,14 +237,14 @@ } public LIRFrameState stateFor(FrameState state, long leafGraphId) { - return stateFor(state, null, null, leafGraphId); + return stateFor(state, null, leafGraphId); } - public LIRFrameState stateFor(FrameState state, List pointerSlots, LabelRef exceptionEdge, long leafGraphId) { + public LIRFrameState stateFor(FrameState state, LabelRef exceptionEdge, long leafGraphId) { if (needOnlyOopMaps()) { - return new LIRFrameState(null, null, null, null); + return new LIRFrameState(null, null, null); } - return debugInfoBuilder.build(state, lockDataSlots.subList(0, currentLockCount), pointerSlots, exceptionEdge, leafGraphId); + return debugInfoBuilder.build(state, lockDataSlots.subList(0, currentLockCount), exceptionEdge, leafGraphId); } /** @@ -468,7 +468,6 @@ } private boolean canBeNullCheck(LocationNode location) { - // TODO: Make this part of TargetDescription return !(location instanceof IndexedLocationNode) && location.displacement() < this.target().implicitNullCheckLimit; } @@ -690,38 +689,6 @@ public abstract Variable emitCMove(Value leftVal, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue); - protected FrameState stateBeforeCallWithArguments(FrameState stateAfter, MethodCallTargetNode call, int bci) { - return stateAfter.duplicateModified(bci, stateAfter.rethrowException(), call.returnStamp().kind(), toJVMArgumentStack(call.targetMethod().getSignature(), call.isStatic(), call.arguments())); - } - - private static ValueNode[] toJVMArgumentStack(Signature signature, boolean isStatic, NodeInputList arguments) { - int slotCount = signature.getParameterSlots(!isStatic); - ValueNode[] stack = new ValueNode[slotCount]; - int stackIndex = 0; - int argumentIndex = 0; - for (ValueNode arg : arguments) { - stack[stackIndex] = arg; - - if (stackIndex == 0 && !isStatic) { - // Current argument is receiver. - stackIndex += stackSlots(Kind.Object); - } else { - stackIndex += stackSlots(signature.getParameterKind(argumentIndex)); - argumentIndex++; - } - } - return stack; - } - - public static int stackSlots(Kind kind) { - return isTwoSlot(kind) ? 2 : 1; - } - - public static boolean isTwoSlot(Kind kind) { - assert kind != Kind.Void && kind != Kind.Illegal; - return kind == Kind.Long || kind == Kind.Double; - } - @Override public void emitInvoke(Invoke x) { AbstractCallTargetNode callTarget = (AbstractCallTargetNode) x.callTarget(); @@ -732,7 +699,7 @@ LIRFrameState callState = null; if (x.stateAfter() != null) { - callState = stateFor(x.stateDuring(), null, x instanceof InvokeWithExceptionNode ? getLIRBlock(((InvokeWithExceptionNode) x).exceptionEdge()) : null, x.leafGraphId()); + callState = stateFor(x.stateDuring(), x instanceof InvokeWithExceptionNode ? getLIRBlock(((InvokeWithExceptionNode) x).exceptionEdge()) : null, x.leafGraphId()); } Value result = cc.getReturn(); @@ -832,18 +799,10 @@ // cannot pop it here. FrameState stateBeforeReturn = stateAfter; if ((stateAfter.stackSize() > 0 && stateAfter.stackAt(stateAfter.stackSize() - 1) == x) || (stateAfter.stackSize() > 1 && stateAfter.stackAt(stateAfter.stackSize() - 2) == x)) { - stateBeforeReturn = stateAfter.duplicateModified(stateAfter.bci, stateAfter.rethrowException(), x.kind()); } - - // TODO is it correct here that the pointerSlots are not passed to the oop map - // generation? info = stateFor(stateBeforeReturn, -1); } else { - // Every runtime call needs an info - // TODO This is conservative. It's not needed for calls that are implemented purely in a - // stub - // that does not trash any registers and does not call into the runtime. info = state(); } diff -r 017f9c2bcb6b -r 1ceb9aeb5ea4 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java Thu Jan 31 16:28:55 2013 +0100 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRFrameState.java Thu Jan 31 17:04:16 2013 +0100 @@ -40,14 +40,12 @@ public final BytecodeFrame topFrame; private final VirtualObject[] virtualObjects; - private final List pointerSlots; public final LabelRef exceptionEdge; private DebugInfo debugInfo; - public LIRFrameState(BytecodeFrame topFrame, VirtualObject[] virtualObjects, List pointerSlots, LabelRef exceptionEdge) { + public LIRFrameState(BytecodeFrame topFrame, VirtualObject[] virtualObjects, LabelRef exceptionEdge) { this.topFrame = topFrame; this.virtualObjects = virtualObjects; - this.pointerSlots = pointerSlots; this.exceptionEdge = exceptionEdge; } @@ -112,15 +110,8 @@ } } - public void finish(BitSet registerRefMap, BitSet frameRefMap, FrameMap frameMap) { + public void finish(BitSet registerRefMap, BitSet frameRefMap) { debugInfo = new DebugInfo(topFrame, registerRefMap, frameRefMap); - - // Add additional stack slots for outgoing method parameters. - if (pointerSlots != null) { - for (StackSlot v : pointerSlots) { - frameMap.setReference(v, registerRefMap, frameRefMap); - } - } } @Override