# HG changeset patch # User Thomas Wuerthinger # Date 1305803377 -7200 # Node ID a0dd2b907806c18b46cf87ca07b545159654dd2e # Parent 4272b7af2d176c04ce796b33238d98696a92053d Removed implicit safepoints. diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Thu May 19 13:09:37 2011 +0200 @@ -580,10 +580,6 @@ CiValue tag = load(x.value()); setNoResult(x); - if (x.isSafepoint()) { - emitXir(xir.genSafepoint(site(x)), x, stateFor(x), null, false); - } - // move values into phi locations moveToPhi(x.stateAfter()); @@ -839,10 +835,6 @@ CiValue tag = value.result(); setNoResult(x); - if (x.isSafepoint()) { - emitXir(xir.genSafepoint(site(x)), x, stateFor(x), null, false); - } - // move values into phi locations moveToPhi(x.stateAfter()); diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/GraphBuilder.java Thu May 19 13:09:37 2011 +0200 @@ -246,7 +246,7 @@ private void finishStartBlock(BlockBegin startBlock, BlockBegin stdEntry) { assert curBlock == startBlock; FrameState stateAfter = frameState.create(bci()); - Goto base = new Goto(stdEntry, stateAfter, false, graph); + Goto base = new Goto(stdEntry, stateAfter, graph); appendWithoutOptimization(base, 0); startBlock.setEnd(base); assert stdEntry.stateBefore() == null; @@ -314,7 +314,7 @@ } else { if (unwindBlock == null) { unwindBlock = new BlockBegin(bci, ir.nextBlockNumber(), graph); - Unwind unwind = new Unwind(null, false, graph); + Unwind unwind = new Unwind(null, graph); unwindBlock.appendNext(unwind, bci); unwindBlock.setEnd(unwind); } @@ -339,14 +339,14 @@ } else { BlockBegin dispatchEntry = new BlockBegin(handler.handlerBCI(), ir.nextBlockNumber(), graph); if (handler.handler.catchType().isResolved()) { - ExceptionDispatch end = new ExceptionDispatch(null, handler.entryBlock(), null, handler, null, false, graph); + ExceptionDispatch end = new ExceptionDispatch(null, handler.entryBlock(), null, handler, null, graph); end.setBlockSuccessor(0, successor); dispatchEntry.appendNext(end, handler.handlerBCI()); dispatchEntry.setEnd(end); } else { Deoptimize deopt = new Deoptimize(graph, null); dispatchEntry.appendNext(deopt, bci); - Goto end = new Goto(successor, null, false, graph); + Goto end = new Goto(successor, null, graph); deopt.appendNext(end, bci); dispatchEntry.setEnd(end); } @@ -362,7 +362,7 @@ ExceptionObject exception = new ExceptionObject(graph); entry.appendNext(exception, bci); FrameState stateWithException = entryState.duplicateModified(bci, CiKind.Void, exception); - BlockEnd end = new Goto(successor, stateWithException, false, graph); + BlockEnd end = new Goto(successor, stateWithException, graph); exception.appendNext(end, bci); entry.setEnd(end); @@ -605,8 +605,7 @@ } private void genGoto(int fromBCI, int toBCI) { - boolean isSafepoint = !noSafepoints() && toBCI <= fromBCI; - append(new Goto(blockAt(toBCI), null, isSafepoint, graph)); + append(new Goto(blockAt(toBCI), null, graph)); } private void ifNode(Value x, Condition cond, Value y, FrameState stateBefore) { @@ -615,9 +614,9 @@ int bci = stream().currentBCI(); boolean isSafepoint = !noSafepoints() && (tsucc.bci() <= bci || fsucc.bci() <= bci); if (isSafepoint) { - append(new If(x, cond, y, tsucc, fsucc, stateBefore, isSafepoint, graph)); + append(new If(x, cond, y, tsucc, fsucc, stateBefore, graph)); } else { - append(new If(x, cond, y, tsucc, fsucc, null, isSafepoint, graph)); + append(new If(x, cond, y, tsucc, fsucc, null, graph)); stateBefore.delete(); } } @@ -645,7 +644,7 @@ private void genThrow(int bci) { FrameState stateBefore = frameState.create(bci); - Throw t = new Throw(frameState.apop(), !noSafepoints(), graph); + Throw t = new Throw(frameState.apop(), graph); t.setStateBefore(stateBefore); appendWithoutOptimization(t, bci); } @@ -954,7 +953,7 @@ append(new MonitorExit(rootMethodSynchronizedObject, lockAddress, lockNumber, graph)); frameState.unlock(); } - append(new Return(x, !noSafepoints(), graph)); + append(new Return(x, graph)); } private void genMonitorEnter(Value x, int bci) { @@ -1011,7 +1010,7 @@ list.add(blockAt(bci + offset)); boolean isSafepoint = isBackwards && !noSafepoints(); FrameState stateBefore = isSafepoint ? frameState.create(bci()) : null; - append(new TableSwitch(frameState.ipop(), list, ts.lowKey(), stateBefore, isSafepoint, graph)); + append(new TableSwitch(frameState.ipop(), list, ts.lowKey(), stateBefore, graph)); } private void genLookupswitch() { @@ -1033,7 +1032,7 @@ list.add(blockAt(bci + offset)); boolean isSafepoint = isBackwards && !noSafepoints(); FrameState stateBefore = isSafepoint ? frameState.create(bci()) : null; - append(new LookupSwitch(frameState.ipop(), list, keys, stateBefore, isSafepoint, graph)); + append(new LookupSwitch(frameState.ipop(), list, keys, stateBefore, graph)); } private Value appendConstant(CiConstant type) { @@ -1163,7 +1162,7 @@ BlockBegin nextBlock = blockAtOrNull(bci); if (nextBlock != null && nextBlock != block) { // we fell through to the next block, add a goto and break - end = new Goto(nextBlock, null, false, graph); + end = new Goto(nextBlock, null, graph); lastInstr = lastInstr.appendNext(end, prevBCI); break; } diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/graph/IR.java --- a/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/graph/IR.java Thu May 19 13:09:37 2011 +0200 @@ -168,7 +168,7 @@ BlockBegin newSucc = new BlockBegin(bci, nextBlockNumber(), compilation.graph); // This goto is not a safepoint. - Goto e = new Goto(target, null, false, compilation.graph); + Goto e = new Goto(target, null, compilation.graph); newSucc.appendNext(e, bci); newSucc.setEnd(e); e.reorderSuccessor(0, backEdgeIndex); diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/BlockEnd.java Thu May 19 13:09:37 2011 +0200 @@ -79,8 +79,6 @@ return blockSuccessorCount; } - private boolean isSafepoint; - /** * Constructs a new block end with the specified value type. * @param kind the type of the value produced by this instruction @@ -88,30 +86,21 @@ * @param isSafepoint {@code true} if this instruction is a safepoint instruction * @param successors the list of successor blocks. If {@code null}, a new one will be created. */ - public BlockEnd(CiKind kind, FrameState stateAfter, boolean isSafepoint, List blockSuccessors, int inputCount, int successorCount, Graph graph) { - this(kind, stateAfter, isSafepoint, blockSuccessors.size(), inputCount, successorCount, graph); + public BlockEnd(CiKind kind, FrameState stateAfter, List blockSuccessors, int inputCount, int successorCount, Graph graph) { + this(kind, stateAfter, blockSuccessors.size(), inputCount, successorCount, graph); for (int i = 0; i < blockSuccessors.size(); i++) { setBlockSuccessor(i, blockSuccessors.get(i)); } } - public BlockEnd(CiKind kind, FrameState stateAfter, boolean isSafepoint, int blockSuccessorCount, int inputCount, int successorCount, Graph graph) { + public BlockEnd(CiKind kind, FrameState stateAfter, int blockSuccessorCount, int inputCount, int successorCount, Graph graph) { super(kind, inputCount + INPUT_COUNT, successorCount + blockSuccessorCount + SUCCESSOR_COUNT, graph); this.blockSuccessorCount = blockSuccessorCount; setStateAfter(stateAfter); - this.isSafepoint = isSafepoint; - } - - public BlockEnd(CiKind kind, FrameState stateAfter, boolean isSafepoint, Graph graph) { - this(kind, stateAfter, isSafepoint, 2, 0, 0, graph); } - /** - * Checks whether this instruction is a safepoint. - * @return {@code true} if this instruction is a safepoint - */ - public boolean isSafepoint() { - return isSafepoint; + public BlockEnd(CiKind kind, FrameState stateAfter, Graph graph) { + this(kind, stateAfter, 2, 0, 0, graph); } /** diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/ExceptionDispatch.java Thu May 19 13:09:37 2011 +0200 @@ -64,8 +64,8 @@ /** * Constructs a new ExceptionDispatch instruction. */ - public ExceptionDispatch(Value exception, BlockBegin catchSuccessor, BlockBegin otherSuccessor, ExceptionHandler handler, FrameState stateAfter, boolean isSafepoint, Graph graph) { - super(CiKind.Int, stateAfter, isSafepoint, 2, INPUT_COUNT, SUCCESSOR_COUNT, graph); + public ExceptionDispatch(Value exception, BlockBegin catchSuccessor, BlockBegin otherSuccessor, ExceptionHandler handler, FrameState stateAfter, Graph graph) { + super(CiKind.Int, stateAfter, 2, INPUT_COUNT, SUCCESSOR_COUNT, graph); setException(exception); setBlockSuccessor(0, otherSuccessor); setBlockSuccessor(1, catchSuccessor); @@ -129,9 +129,6 @@ print(blockSuccessors().get(1).blockID). print(" else B"). print(blockSuccessors().get(0).blockID); - if (isSafepoint()) { - out.print(" (safepoint)"); - } } @Override diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/Goto.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Goto.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Goto.java Thu May 19 13:09:37 2011 +0200 @@ -42,8 +42,8 @@ * @param isSafepoint {@code true} if the goto should be considered a safepoint (e.g. backward branch) * @param graph */ - public Goto(BlockBegin succ, FrameState stateAfter, boolean isSafepoint, Graph graph) { - super(CiKind.Illegal, stateAfter, isSafepoint, 1, INPUT_COUNT, SUCCESSOR_COUNT, graph); + public Goto(BlockBegin succ, FrameState stateAfter, Graph graph) { + super(CiKind.Illegal, stateAfter, 1, INPUT_COUNT, SUCCESSOR_COUNT, graph); setBlockSuccessor(0, succ); } @@ -55,8 +55,5 @@ @Override public void print(LogStream out) { out.print("goto B").print(defaultSuccessor().blockID); - if (isSafepoint()) { - out.print(" (safepoint)"); - } } } diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/If.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/If.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/If.java Thu May 19 13:09:37 2011 +0200 @@ -87,8 +87,8 @@ * @param graph */ public If(Value x, Condition cond, Value y, - BlockBegin trueSucc, BlockBegin falseSucc, FrameState stateAfter, boolean isSafepoint, Graph graph) { - super(CiKind.Illegal, stateAfter, isSafepoint, 2, INPUT_COUNT, SUCCESSOR_COUNT, graph); + BlockBegin trueSucc, BlockBegin falseSucc, FrameState stateAfter, Graph graph) { + super(CiKind.Illegal, stateAfter, 2, INPUT_COUNT, SUCCESSOR_COUNT, graph); assert Util.archKindsEqual(x, y); condition = cond; setX(x); @@ -187,9 +187,6 @@ print(blockSuccessors().get(0).blockID). print(" else B"). print(blockSuccessors().get(1).blockID); - if (isSafepoint()) { - out.print(" (safepoint)"); - } } @Override diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java Thu May 19 13:09:37 2011 +0200 @@ -22,8 +22,6 @@ */ package com.sun.c1x.ir; -import java.util.*; - import com.oracle.graal.graph.*; import com.sun.c1x.*; import com.sun.c1x.value.*; diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/LookupSwitch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/LookupSwitch.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/LookupSwitch.java Thu May 19 13:09:37 2011 +0200 @@ -50,8 +50,8 @@ * @param isSafepoint {@code true} if this instruction is a safepoint * @param graph */ - public LookupSwitch(Value value, List successors, int[] keys, FrameState stateBefore, boolean isSafepoint, Graph graph) { - super(value, successors, stateBefore, isSafepoint, INPUT_COUNT, SUCCESSOR_COUNT, graph); + public LookupSwitch(Value value, List successors, int[] keys, FrameState stateBefore, Graph graph) { + super(value, successors, stateBefore, INPUT_COUNT, SUCCESSOR_COUNT, graph); this.keys = keys; } @@ -76,9 +76,6 @@ @Override public void print(LogStream out) { out.print("lookupswitch "); - if (isSafepoint()) { - out.print("(safepoint) "); - } out.println(value()); int l = numberOfCases(); for (int i = 0; i < l; i++) { diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/Return.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Return.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Return.java Thu May 19 13:09:37 2011 +0200 @@ -64,8 +64,8 @@ * @param isSafepoint {@code true} if this instruction is a safepoint instruction * @param graph */ - public Return(Value result, boolean isSafepoint, Graph graph) { - super(result == null ? CiKind.Void : result.kind, null, isSafepoint, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph); + public Return(Value result, Graph graph) { + super(result == null ? CiKind.Void : result.kind, null, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph); setResult(result); } diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/Switch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Switch.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Switch.java Thu May 19 13:09:37 2011 +0200 @@ -67,8 +67,8 @@ * @param isSafepoint {@code true} if this switch is a safepoint * @param graph */ - public Switch(Value value, List successors, FrameState stateBefore, boolean isSafepoint, int inputCount, int successorCount, Graph graph) { - super(CiKind.Illegal, stateBefore, isSafepoint, successors, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph); + public Switch(Value value, List successors, FrameState stateBefore, int inputCount, int successorCount, Graph graph) { + super(CiKind.Illegal, stateBefore, successors, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph); setValue(value); } diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/TableSwitch.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/TableSwitch.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/TableSwitch.java Thu May 19 13:09:37 2011 +0200 @@ -49,8 +49,8 @@ * @param isSafepoint {@code true} if this instruction is a safepoint * @param graph */ - public TableSwitch(Value value, List successors, int lowKey, FrameState stateBefore, boolean isSafepoint, Graph graph) { - super(value, successors, stateBefore, isSafepoint, INPUT_COUNT, SUCCESSOR_COUNT, graph); + public TableSwitch(Value value, List successors, int lowKey, FrameState stateBefore, Graph graph) { + super(value, successors, stateBefore, INPUT_COUNT, SUCCESSOR_COUNT, graph); this.lowKey = lowKey; } @@ -78,9 +78,6 @@ @Override public void print(LogStream out) { out.print("tableswitch "); - if (isSafepoint()) { - out.print("(safepoint) "); - } out.println(value()); int l = numberOfCases(); for (int i = 0; i < l; i++) { diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Throw.java Thu May 19 13:09:37 2011 +0200 @@ -91,8 +91,8 @@ * @param isSafepoint {@code true} if this instruction is a safepoint instruction * @param graph */ - public Throw(Value exception, boolean isSafepoint, Graph graph) { - super(CiKind.Illegal, null, isSafepoint, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph); + public Throw(Value exception, Graph graph) { + super(CiKind.Illegal, null, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph); setException(exception); } diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/ir/Unwind.java --- a/graal/GraalCompiler/src/com/sun/c1x/ir/Unwind.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Unwind.java Thu May 19 13:09:37 2011 +0200 @@ -58,8 +58,8 @@ return (Value) inputs().set(super.inputCount() + INPUT_EXCEPTION, n); } - public Unwind(Value exception, boolean isSafepoint, Graph graph) { - super(CiKind.Object, null, isSafepoint, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph); + public Unwind(Value exception, Graph graph) { + super(CiKind.Object, null, 0, INPUT_COUNT, SUCCESSOR_COUNT, graph); setException(exception); } diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/lir/LIRDebugInfo.java --- a/graal/GraalCompiler/src/com/sun/c1x/lir/LIRDebugInfo.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/lir/LIRDebugInfo.java Thu May 19 13:09:37 2011 +0200 @@ -22,8 +22,6 @@ */ package com.sun.c1x.lir; -import java.util.*; - import com.sun.c1x.*; import com.sun.c1x.ir.*; import com.sun.c1x.value.*; diff -r 4272b7af2d17 -r a0dd2b907806 graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java Wed May 18 18:40:58 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/target/amd64/AMD64LIRGenerator.java Thu May 19 13:09:37 2011 +0200 @@ -503,10 +503,6 @@ yin.loadItem(); } - // add safepoint before generating condition code so it can be recomputed - if (x.isSafepoint()) { - emitXir(xir.genSafepoint(site(x)), x, stateFor(x, x.stateAfter()), null, false); - } setNoResult(x); CiValue left = xin.result();