# HG changeset patch # User Thomas Wuerthinger # Date 1308920367 -7200 # Node ID f35a9ae24f11f60e5d63f515d304b2b2067e60b3 # Parent e237c1980f4b5dbd93de7935ad0ae90425b30f65 More clean up in the IR. diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalMetrics.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalMetrics.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/GraalMetrics.java Fri Jun 24 14:59:27 2011 +0200 @@ -49,7 +49,6 @@ public static int DataPatches; public static int DirectCallSitesEmitted; public static int IndirectCallSitesEmitted; - public static int HIRInstructions; public static int LiveHIRInstructions; public static int LIRInstructions; public static int LIRVariables; diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/BlockPrinter.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/BlockPrinter.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/BlockPrinter.java Fri Jun 24 14:59:27 2011 +0200 @@ -45,7 +45,7 @@ public void apply(Block block) { if (cfgOnly) { if (block.getInstructions().size() > 0) { - ip.printInstruction((Instruction) block.getInstructions().get(0)); + ip.printInstruction((FixedNodeWithNext) block.getInstructions().get(0)); } else { ip.out().println("Empty block"); } @@ -62,8 +62,8 @@ ip.printInstructionListingHeader(); for (Node i : block.getInstructions()) { - if (i instanceof Instruction) { - ip.printInstructionListing((Instruction) i); + if (i instanceof FixedNodeWithNext) { + ip.printInstructionListing((FixedNodeWithNext) i); } } out.println(); diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/CFGPrinter.java Fri Jun 24 14:59:27 2011 +0200 @@ -409,8 +409,8 @@ out.println("HIR"); out.disableIndentation(); for (Node i : block.getInstructions()) { - if (i instanceof Instruction) { - printInstructionHIR((Instruction) i); + if (i instanceof FixedNodeWithNext) { + printInstructionHIR((FixedNodeWithNext) i); } } out.enableIndentation(); @@ -515,16 +515,19 @@ * * @param i the instruction for which HIR will be printed */ - private void printInstructionHIR(Instruction i) { + private void printInstructionHIR(FixedNodeWithNext i) { out.print("bci ").print(-1).println(COLUMN_END); if (i.operand().isLegal()) { out.print("result ").print(new CFGOperandFormatter(false).format(i.operand())).println(COLUMN_END); } out.print("tid ").print(i).println(COLUMN_END); - String state = stateToString(i.stateAfter(), null); - if (state != null) { - out.print("st ").print(HOVER_START).print("st").print(HOVER_SEP).print(state).print(HOVER_END).println(COLUMN_END); + if (i instanceof StateSplit) { + StateSplit stateSplit = (StateSplit) i; + String state = stateToString(stateSplit.stateAfter(), null); + if (state != null) { + out.print("st ").print(HOVER_START).print("st").print(HOVER_SEP).print(state).print(HOVER_END).println(COLUMN_END); + } } out.print("instruction "); diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/IdealGraphPrinter.java Fri Jun 24 14:59:27 2011 +0200 @@ -269,8 +269,8 @@ // add all framestates and phis to their blocks for (Node node : block.getInstructions()) { - if (node instanceof Instruction && ((Instruction) node).stateAfter() != null) { - nodes.add(((Instruction) node).stateAfter()); + if (node instanceof StateSplit && ((StateSplit) node).stateAfter() != null) { + nodes.add(((StateSplit) node).stateAfter()); } if (node instanceof Merge) { for (Node usage : node.usages()) { diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/InstructionPrinter.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/InstructionPrinter.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/debug/InstructionPrinter.java Fri Jun 24 14:59:27 2011 +0200 @@ -28,7 +28,7 @@ /** * A {@link ValueVisitor} for {@linkplain #printInstruction(Value) printing} - * an {@link Instruction} as an expression or statement. + * an {@link FixedNodeWithNext} as an expression or statement. * * @author Doug Simon */ diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/gen/LIRGenerator.java Fri Jun 24 14:59:27 2011 +0200 @@ -247,8 +247,8 @@ TTY.println("LIRGen for " + instr); } FrameState stateAfter = null; - if (instr instanceof Instruction) { - stateAfter = ((Instruction) instr).stateAfter(); + if (instr instanceof StateSplit) { + stateAfter = ((StateSplit) instr).stateAfter(); } if (instr != instr.graph().start()) { walkState(instr, stateAfter); @@ -302,7 +302,7 @@ CiCallingConvention args = compilation.frameMap().incomingArguments(); int bci = 0; if (Modifier.isSynchronized(compilation.method.accessFlags())) { - bci = Instruction.SYNCHRONIZATION_ENTRY_BCI; + bci = FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI; } boolean withReceiver = !Modifier.isStatic(compilation.method.accessFlags()); @@ -1012,7 +1012,7 @@ @Override public void visitDeoptimize(Deoptimize deoptimize) { assert lastState != null : "deoptimize always needs a state"; - assert lastState.bci != Instruction.SYNCHRONIZATION_ENTRY_BCI : "bci must not be -1 for deopt framestate"; + assert lastState.bci != FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI : "bci must not be -1 for deopt framestate"; DeoptimizationStub stub = new DeoptimizationStub(deoptimize.action(), lastState); addDeoptimizationStub(stub); lir.branch(Condition.TRUE, stub.label, stub.info); diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/BlockMap.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/BlockMap.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/BlockMap.java Fri Jun 24 14:59:27 2011 +0200 @@ -121,7 +121,7 @@ public boolean isLoopHeader; public int blockID; - public Instruction firstInstruction; + public FixedNodeWithNext firstInstruction; final HashSet successors = new LinkedHashSet(); private boolean visited; diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/graph/IR.java Fri Jun 24 14:59:27 2011 +0200 @@ -211,7 +211,7 @@ return maxLocks; } - public Instruction getHIRStartBlock() { - return (Instruction) compilation.graph.start().successors().get(0); + public FixedNodeWithNext getHIRStartBlock() { + return (FixedNodeWithNext) compilation.graph.start().successors().get(0); } } diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Anchor.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Anchor.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Anchor.java Fri Jun 24 14:59:27 2011 +0200 @@ -31,7 +31,7 @@ /** * The {@code Anchor} instruction represents the end of a block with an unconditional jump to another block. */ -public final class Anchor extends Instruction { +public final class Anchor extends FixedNodeWithNext { private static final int INPUT_COUNT = 0; private static final int SUCCESSOR_COUNT = 0; diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ExceptionObject.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ExceptionObject.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ExceptionObject.java Fri Jun 24 14:59:27 2011 +0200 @@ -29,7 +29,7 @@ /** * The {@code ExceptionObject} instruction represents the incoming exception object to an exception handler. */ -public final class ExceptionObject extends Instruction { +public final class ExceptionObject extends FixedNodeWithNext { private static final int INPUT_COUNT = 0; private static final int SUCCESSOR_COUNT = 0; diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FixedGuard.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FixedGuard.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FixedGuard.java Fri Jun 24 14:59:27 2011 +0200 @@ -27,7 +27,7 @@ import com.sun.cri.ci.*; -public final class FixedGuard extends Instruction { +public final class FixedGuard extends FixedNodeWithNext { private static final int INPUT_COUNT = 1; private static final int INPUT_NODE = 0; diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FixedNodeWithNext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/FixedNodeWithNext.java Fri Jun 24 14:59:27 2011 +0200 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.max.graal.compiler.ir; + +import com.oracle.max.graal.graph.*; +import com.sun.cri.ci.*; + +public abstract class FixedNodeWithNext extends FixedNode { + + private static final int INPUT_COUNT = 0; + + private static final int SUCCESSOR_COUNT = 1; + public static final int SUCCESSOR_NEXT = 0; + + @Override + protected int inputCount() { + return super.inputCount() + INPUT_COUNT; + } + + @Override + protected int successorCount() { + return super.successorCount() + SUCCESSOR_COUNT; + } + + /** + * Links to next instruction in a basic block, to {@code null} if this instruction is the end of a basic block or to + * itself if not in a block. + */ + public FixedNode next() { + return (FixedNode) successors().get(super.successorCount() + SUCCESSOR_NEXT); + } + + public Node setNext(FixedNode next) { + return successors().set(super.successorCount() + SUCCESSOR_NEXT, next); + } + + public static final int SYNCHRONIZATION_ENTRY_BCI = -1; + + /** + * Constructs a new instruction with the specified value type. + * @param kind the value type for this instruction + * @param inputCount + * @param successorCount + */ + public FixedNodeWithNext(CiKind kind, int inputCount, int successorCount, Graph graph) { + super(kind, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph); + } +} diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Instruction.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/Instruction.java Fri Jun 24 14:46:26 2011 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package com.oracle.max.graal.compiler.ir; - -import com.oracle.max.graal.compiler.*; -import com.oracle.max.graal.compiler.value.*; -import com.oracle.max.graal.graph.*; -import com.sun.cri.ci.*; - -/** - * Denotes an instruction node in the IR, which is a {@link Value} that - * can be added to a basic block (whereas other {@link Value} nodes such as {@link Phi} and - * {@link Local} cannot be added to basic blocks). - * - * Subclasses of instruction represent arithmetic and object operations, - * control flow operators, phi statements, method calls, the start of basic blocks, and - * the end of basic blocks. - * - * Instruction nodes are chained together in a basic block through the embedded - * {@link Instruction#next} field. An Instruction may also have a list of {@link ExceptionHandler}s. - */ -public abstract class Instruction extends FixedNode { - - private static final int INPUT_COUNT = 0; - - private static final int SUCCESSOR_COUNT = 1; - public static final int SUCCESSOR_NEXT = 0; - - @Override - protected int inputCount() { - return super.inputCount() + INPUT_COUNT; - } - - @Override - protected int successorCount() { - return super.successorCount() + SUCCESSOR_COUNT; - } - - /** - * Links to next instruction in a basic block, to {@code null} if this instruction is the end of a basic block or to - * itself if not in a block. - */ - public FixedNode next() { - return (FixedNode) successors().get(super.successorCount() + SUCCESSOR_NEXT); - } - - public Node setNext(FixedNode next) { - return successors().set(super.successorCount() + SUCCESSOR_NEXT, next); - } - - public int nextIndex() { - return super.successorCount() + SUCCESSOR_NEXT; - } - - - public static final int SYNCHRONIZATION_ENTRY_BCI = -1; - - /** - * Constructs a new instruction with the specified value type. - * @param kind the value type for this instruction - * @param inputCount - * @param successorCount - */ - public Instruction(CiKind kind, int inputCount, int successorCount, Graph graph) { - super(kind, inputCount + INPUT_COUNT, successorCount + SUCCESSOR_COUNT, graph); - GraalMetrics.HIRInstructions++; - } - - /** - * Gets the state after the instruction, if it is recorded. - * @return the state after the instruction - */ - public FrameState stateAfter() { - return null; - } -} diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/LookupSwitch.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/LookupSwitch.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/LookupSwitch.java Fri Jun 24 14:59:27 2011 +0200 @@ -86,7 +86,7 @@ @Override public Node copy(Graph into) { - LookupSwitch x = new LookupSwitch(null, Arrays.asList(new Instruction[numberOfCases() + 1]), keys.clone(), into); + LookupSwitch x = new LookupSwitch(null, Arrays.asList(new FixedNodeWithNext[numberOfCases() + 1]), keys.clone(), into); return x; } } diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/NewArray.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/NewArray.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/NewArray.java Fri Jun 24 14:59:27 2011 +0200 @@ -28,7 +28,7 @@ /** * The {@code NewArray} class is the base of all instructions that allocate arrays. */ -public abstract class NewArray extends Instruction { +public abstract class NewArray extends FixedNodeWithNext { private static final int INPUT_COUNT = 1; private static final int INPUT_LENGTH = 0; diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/StateSplit.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/StateSplit.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/StateSplit.java Fri Jun 24 14:59:27 2011 +0200 @@ -32,7 +32,7 @@ * The {@code StateSplit} class is the abstract base class of all instructions * that store an immutable copy of the frame state. */ -public abstract class StateSplit extends Instruction { +public abstract class StateSplit extends FixedNodeWithNext { private static final int INPUT_COUNT = 1; private static final int INPUT_STATE_AFTER = 0; @@ -52,7 +52,6 @@ /** * The state for this instruction. */ - @Override public FrameState stateAfter() { return (FrameState) inputs().get(super.inputCount() + INPUT_STATE_AFTER); } diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/TableSwitch.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/TableSwitch.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/TableSwitch.java Fri Jun 24 14:59:27 2011 +0200 @@ -88,7 +88,7 @@ @Override public Node copy(Graph into) { - TableSwitch x = new TableSwitch(null, Arrays.asList(new Instruction[numberOfCases() + 1]), lowKey, into); + TableSwitch x = new TableSwitch(null, Arrays.asList(new FixedNodeWithNext[numberOfCases() + 1]), lowKey, into); return x; } } diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ValueAnchor.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ValueAnchor.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/ValueAnchor.java Fri Jun 24 14:59:27 2011 +0200 @@ -29,7 +29,7 @@ /** * The ValueAnchor instruction keeps non-CFG nodes above a certain point in the graph. */ -public final class ValueAnchor extends Instruction { +public final class ValueAnchor extends FixedNodeWithNext { private static final int INPUT_COUNT = 1; private static final int INPUT_OBJECT = 0; diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/package-info.java Fri Jun 24 14:59:27 2011 +0200 @@ -75,7 +75,7 @@ * *
  • * Add a field to optionally store an {@link com.oracle.max.graal.compiler.ir.Info} object for each HIR node, and remove the - * {@link com.oracle.max.graal.compiler.ir.Instruction#exceptionHandlers} field, the {@link com.oracle.max.graal.compiler.ir.Instruction#bci} field, and any fields to store the Java + * {@link com.oracle.max.graal.compiler.ir.FixedNodeWithNext#exceptionHandlers} field, the {@link com.oracle.max.graal.compiler.ir.FixedNodeWithNext#bci} field, and any fields to store the Java * frame state in subclasses. Benefit: saves space if most HIR nodes do not have exception handlers, a bci or Java frame * state. Removes virtual dispatch on accessing debug information for nodes. Allows any node, regardless of its type, to * have info attached.
  • diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/DeadCodeEliminationPhase.java Fri Jun 24 14:59:27 2011 +0200 @@ -85,10 +85,6 @@ } } - private static boolean isCFG(Node n) { - return n != null && ((n instanceof Instruction) || (n instanceof ControlSplit) || n == n.graph().start()); - } - private void iterateSuccessors() { for (Node current : flood) { if (current instanceof EndNode) { diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/GraphBuilderPhase.java Fri Jun 24 14:59:27 2011 +0200 @@ -101,7 +101,7 @@ } }); - private Instruction lastInstr; // the last instruction added + private FixedNodeWithNext lastInstr; // the last instruction added private final Set blocksOnWorklist = new HashSet(); private final Set blocksVisited = new HashSet(); @@ -169,26 +169,26 @@ } // 1. create the start block - Block startBlock = nextBlock(Instruction.SYNCHRONIZATION_ENTRY_BCI); + Block startBlock = nextBlock(FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI); markOnWorkList(startBlock); - lastInstr = (Instruction) createTarget(startBlock, frameState); + lastInstr = (FixedNodeWithNext) createTarget(startBlock, frameState); graph.start().setStart(lastInstr); if (isSynchronized(method.accessFlags())) { // 4A.1 add a monitor enter to the start block methodSynchronizedObject = synchronizedObject(frameState, method); - genMonitorEnter(methodSynchronizedObject, Instruction.SYNCHRONIZATION_ENTRY_BCI); + genMonitorEnter(methodSynchronizedObject, FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI); // 4A.2 finish the start block finishStartBlock(startBlock); // 4A.3 setup an exception handler to unlock the root method synchronized object - unwindHandler = new CiExceptionHandler(0, method.code().length, Instruction.SYNCHRONIZATION_ENTRY_BCI, 0, null); + unwindHandler = new CiExceptionHandler(0, method.code().length, FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI, 0, null); } else { // 4B.1 simply finish the start block finishStartBlock(startBlock); if (createUnwind) { - unwindHandler = new CiExceptionHandler(0, method.code().length, Instruction.SYNCHRONIZATION_ENTRY_BCI, 0, null); + unwindHandler = new CiExceptionHandler(0, method.code().length, FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI, 0, null); } } @@ -385,7 +385,7 @@ } private FixedNode handleException(Value exceptionObject, int bci) { - assert bci == Instruction.SYNCHRONIZATION_ENTRY_BCI || bci == bci() : "invalid bci"; + assert bci == FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI || bci == bci() : "invalid bci"; if (GraalOptions.UseExceptionProbability && method.invocationCount() > GraalOptions.MatureInvocationCount) { if (exceptionObject == null && method.exceptionProbability(bci) == 0) { @@ -426,7 +426,7 @@ if (dispatchBlock == null) { assert isCatchAll(firstHandler); int handlerBCI = firstHandler.handlerBCI(); - if (handlerBCI == Instruction.SYNCHRONIZATION_ENTRY_BCI) { + if (handlerBCI == FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI) { dispatchBlock = unwindBlock(bci); } else { dispatchBlock = blockFromBci[handlerBCI]; @@ -1044,7 +1044,7 @@ MonitorEnter monitorEnter = new MonitorEnter(x, lockAddress, lockNumber, graph); appendWithBCI(monitorEnter); frameState.lock(x); - if (bci == Instruction.SYNCHRONIZATION_ENTRY_BCI) { + if (bci == FixedNodeWithNext.SYNCHRONIZATION_ENTRY_BCI) { monitorEnter.setStateAfter(frameState.create(0)); } } @@ -1076,7 +1076,7 @@ Value value = frameState.ipop(); BytecodeTableSwitch ts = new BytecodeTableSwitch(stream(), bci); int max = ts.numberOfCases(); - List list = new ArrayList(max + 1); + List list = new ArrayList(max + 1); List offsetList = new ArrayList(max + 1); for (int i = 0; i < max; i++) { // add all successors to the successor list @@ -1099,7 +1099,7 @@ Value value = frameState.ipop(); BytecodeLookupSwitch ls = new BytecodeLookupSwitch(stream(), bci); int max = ls.numberOfCases(); - List list = new ArrayList(max + 1); + List list = new ArrayList(max + 1); List offsetList = new ArrayList(max + 1); int[] keys = new int[max]; for (int i = 0; i < max; i++) { @@ -1129,7 +1129,7 @@ return fixed; } - private Value append(Instruction x) { + private Value append(FixedNodeWithNext x) { return appendWithBCI(x); } @@ -1137,7 +1137,7 @@ return v; } - private Value appendWithBCI(Instruction x) { + private Value appendWithBCI(FixedNodeWithNext x) { assert x.predecessors().size() == 0 : "instruction should not have been appended yet"; assert lastInstr.next() == null : "cannot append instruction to instruction which isn't end (" + lastInstr + "->" + lastInstr.next() + ")"; lastInstr.setNext(x); @@ -1228,7 +1228,7 @@ // now parse the block if (block.isLoopHeader) { LoopBegin begin = loopBegin(block); - FrameState preLoopState = block.firstInstruction.stateAfter(); + FrameState preLoopState = ((StateSplit) block.firstInstruction).stateAfter(); assert preLoopState != null; FrameState duplicate = preLoopState.duplicate(preLoopState.bci); begin.setStateAfter(duplicate); diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/phases/InliningPhase.java Fri Jun 24 14:59:27 2011 +0200 @@ -344,7 +344,7 @@ assert invoke.successors().get(0) != null : invoke; assert invoke.predecessors().size() == 1 : "size: " + invoke.predecessors().size(); - Instruction pred; + FixedNodeWithNext pred; if (withReceiver) { FixedGuard clipNode = new FixedGuard(compilation.graph); clipNode.setNode(new IsNonNull(parameters[0], compilation.graph)); diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java --- a/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/util/Util.java Fri Jun 24 14:59:27 2011 +0200 @@ -402,7 +402,7 @@ * @param compareConstants {@code true} if equivalent constants should be considered equivalent * @return {@code true} if the instructions are equivalent; {@code false} otherwise */ - public static boolean equivalent(Instruction x, Instruction y, boolean compareConstants) { + public static boolean equivalent(FixedNodeWithNext x, FixedNodeWithNext y, boolean compareConstants) { if (x == y) { return true; } diff -r e237c1980f4b -r f35a9ae24f11 graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/nodes/FieldWriteBarrier.java --- a/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/nodes/FieldWriteBarrier.java Fri Jun 24 14:46:26 2011 +0200 +++ b/graal/com.oracle.max.graal.runtime/src/com/oracle/max/graal/runtime/nodes/FieldWriteBarrier.java Fri Jun 24 14:59:27 2011 +0200 @@ -31,7 +31,7 @@ import com.sun.cri.ci.*; -public final class FieldWriteBarrier extends Instruction { +public final class FieldWriteBarrier extends FixedNodeWithNext { private static final int INPUT_COUNT = 1; private static final int INPUT_OBJECT = 0;