# HG changeset patch # User Lukas Stadler # Date 1370608024 -7200 # Node ID 671bcaf13017459f8ade48c1ae4ea3b651dd2077 # Parent de3653e687385a1297e2eef4fe19eab9479fd0cd remove FrameState logic from LIRGenerator diff -r de3653e68738 -r 671bcaf13017 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 Fri Jun 07 13:44:00 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Fri Jun 07 14:27:04 2013 +0200 @@ -68,12 +68,6 @@ protected Block currentBlock; private ValueNode currentInstruction; private ValueNode lastInstructionPrinted; // Debugging only - private FrameState lastState; - - /** - * Mapping from blocks to the last encountered frame state at the end of the block. - */ - private final BlockMap blockLastState; /** * Checks whether the supplied constant can be used without loading it into a register for store @@ -100,7 +94,6 @@ this.nodeOperands = graph.createNodeMap(); this.lir = lir; this.debugInfoBuilder = createDebugInfoBuilder(nodeOperands); - this.blockLastState = new BlockMap<>(lir.cfg); } @SuppressWarnings("hiding") @@ -291,41 +284,8 @@ if (block == lir.cfg.getStartBlock()) { assert block.getPredecessorCount() == 0; emitPrologue(); - } else { assert block.getPredecessorCount() > 0; - FrameState fs = null; - - for (Block pred : block.getPredecessors()) { - if (fs == null) { - fs = blockLastState.get(pred); - } else { - if (blockLastState.get(pred) == null) { - // Only a back edge can have a null state for its enclosing block. - assert pred.getEndNode() instanceof LoopEndNode; - - if (block.getBeginNode().stateAfter() == null) { - // We'll assert later that the begin and end of a framestate-less loop - // share the frame state that flowed into the loop - blockLastState.put(pred, fs); - } - } else if (fs != blockLastState.get(pred)) { - fs = null; - break; - } - } - } - if (TraceLIRGeneratorLevel.getValue() >= 2) { - if (fs == null) { - TTY.println("STATE RESET"); - } else { - TTY.println("STATE CHANGE (singlePred)"); - if (TraceLIRGeneratorLevel.getValue() >= 3) { - TTY.println(fs.toString(Node.Verbosity.Debugger)); - } - } - } - lastState = fs; } List nodes = lir.nodesFor(block); @@ -334,10 +294,6 @@ if (TraceLIRGeneratorLevel.getValue() >= 3) { TTY.println("LIRGen for " + instr); } - FrameState stateAfter = null; - if (instr instanceof StateSplit && !(instr instanceof InfopointNode)) { - stateAfter = ((StateSplit) instr).stateAfter(); - } if (instr instanceof ValueNode) { ValueNode valueNode = (ValueNode) instr; if (operand(valueNode) == null) { @@ -355,16 +311,6 @@ // before by other instructions. } } - if (stateAfter != null) { - lastState = stateAfter; - assert checkStateReady(lastState); - if (TraceLIRGeneratorLevel.getValue() >= 2) { - TTY.println("STATE CHANGE"); - if (TraceLIRGeneratorLevel.getValue() >= 3) { - TTY.println(stateAfter.toString(Node.Verbosity.Debugger)); - } - } - } } if (block.getSuccessorCount() >= 1 && !endsWithJump(block)) { NodeClassIterable successors = block.getEndNode().successors(); @@ -377,11 +323,6 @@ TTY.println("END Generating LIR for block B" + block.getId()); } - // Check that the begin and end of a framestate-less loop - // share the frame state that flowed into the loop - assert blockLastState.get(block) == null || blockLastState.get(block) == lastState; - - blockLastState.put(block, lastState); currentBlock = null; if (PrintIRWithLIR.getValue()) { @@ -391,19 +332,6 @@ protected abstract boolean peephole(ValueNode valueNode); - private boolean checkStateReady(FrameState state) { - FrameState fs = state; - while (fs != null) { - for (ValueNode v : fs.values()) { - if (v != null && !(v instanceof VirtualObjectNode)) { - assert operand(v) != null : "Value " + v + " in " + fs + " is not ready!"; - } - } - fs = fs.outerFrameState(); - } - return true; - } - private boolean endsWithJump(Block block) { List instructions = lir.lir(block); if (instructions.size() == 0) {