# HG changeset patch # User Niclas Adlertz # Date 1395136580 0 # Node ID 80147dac0d6e4df55011d06274449269f5c97d45 # Parent c4219e527b834fb58e7dd0fe800b1a151af1e4c8 LIRFrameStateBuilder added diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/LIRFrameStateBuilder.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/LIRFrameStateBuilder.java Tue Mar 18 09:56:20 2014 +0000 @@ -0,0 +1,230 @@ +package com.oracle.graal.baseline; + +import static com.oracle.graal.nodes.ValueNodeUtil.*; + +import com.oracle.graal.api.meta.*; +import com.oracle.graal.java.*; +import com.oracle.graal.lir.*; +import com.oracle.graal.nodes.*; + +public class LIRFrameStateBuilder extends AbstractFrameStateBuilder { + + private final Variable[] locals; + private final Variable[] stack; + private Variable[] lockedObjects; + + public LIRFrameStateBuilder(ResolvedJavaMethod method, boolean eagerResolve) { + super(method); + + this.locals = new Variable[method.getMaxLocals()]; + // we always need at least one stack slot (for exceptions) + this.stack = new Variable[Math.max(1, method.getMaxStackSize())]; + } + + protected LIRFrameStateBuilder(LIRFrameStateBuilder other) { + super(other); + // TODO Auto-generated constructor stub + locals = other.locals; + stack = other.stack; + lockedObjects = other.lockedObjects; + } + + @Override + public int localsSize() { + return locals.length; + } + + @Override + public Variable localAt(int i) { + return locals[i]; + } + + @Override + public Variable stackAt(int i) { + return stack[i]; + } + + @Override + public Variable loadLocal(int i) { + Variable x = locals[i]; + assert !isTwoSlot(x.getKind()) || locals[i + 1] == null; + assert i == 0 || locals[i - 1] == null || !isTwoSlot(locals[i - 1].getKind()); + return x; + } + + @Override + public void storeLocal(int i, Variable x) { + assert x == null || x.getKind() != Kind.Void && x.getKind() != Kind.Illegal : "unexpected value: " + x; + locals[i] = x; + if (x != null && isTwoSlot(x.getKind())) { + // if this is a double word, then kill i+1 + locals[i + 1] = null; + } + if (x != null && i > 0) { + Variable p = locals[i - 1]; + if (p != null && isTwoSlot(p.getKind())) { + // if there was a double word at i - 1, then kill it + locals[i - 1] = null; + } + } + } + + @Override + public void storeStack(int i, Variable x) { + assert x == null || (stack[i] == null || x.getKind() == stack[i].getKind()) : "Method does not handle changes from one-slot to two-slot values or non-alive values"; + stack[i] = x; + } + + @Override + public void push(Kind kind, Variable x) { + assert x.getKind() != Kind.Void && x.getKind() != Kind.Illegal; + xpush(assertKind(kind, x)); + if (isTwoSlot(kind)) { + xpush(null); + } + } + + @Override + public void xpush(Variable x) { + assert x == null || (x.getKind() != Kind.Void && x.getKind() != Kind.Illegal); + stack[stackSize++] = x; + } + + @Override + public void ipush(Variable x) { + xpush(assertInt(x)); + } + + @Override + public void fpush(Variable x) { + xpush(assertFloat(x)); + } + + @Override + public void apush(Variable x) { + xpush(assertObject(x)); + } + + @Override + public void lpush(Variable x) { + xpush(assertLong(x)); + } + + @Override + public void dpush(Variable x) { + xpush(assertDouble(x)); + + } + + @Override + public void pushReturn(Kind kind, Variable x) { + if (kind != Kind.Void) { + push(kind.getStackKind(), x); + } + } + + @Override + public Variable pop(Kind kind) { + assert kind != Kind.Void; + if (isTwoSlot(kind)) { + xpop(); + } + return assertKind(kind, xpop()); + } + + @Override + public Variable xpop() { + Variable result = stack[--stackSize]; + return result; + } + + @Override + public Variable ipop() { + return assertInt(xpop()); + } + + @Override + public Variable fpop() { + return assertFloat(xpop()); + } + + @Override + public Variable apop() { + return assertObject(xpop()); + } + + @Override + public Variable lpop() { + assertHigh(xpop()); + return assertLong(xpop()); + } + + @Override + public Variable dpop() { + assertHigh(xpop()); + return assertDouble(xpop()); + } + + @Override + public Variable[] popArguments(int slotSize, int argSize) { + int base = stackSize - slotSize; + Variable[] r = new Variable[argSize]; + int argIndex = 0; + int stackindex = 0; + while (stackindex < slotSize) { + Variable element = stack[base + stackindex]; + assert element != null; + r[argIndex++] = element; + stackindex += stackSlots(element.getKind()); + } + stackSize = base; + return r; + } + + @Override + public Variable peek(int argumentNumber) { + int idx = stackSize() - 1; + for (int i = 0; i < argumentNumber; i++) { + if (stackAt(idx) == null) { + idx--; + assert isTwoSlot(stackAt(idx).getKind()); + } + idx--; + } + return stackAt(idx); + } + + private static Variable assertKind(Kind kind, Variable x) { + assert x != null && x.getKind() == kind : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.getKind()); + return x; + } + + private static Variable assertLong(Variable x) { + assert x != null && (x.getKind() == Kind.Long); + return x; + } + + private static Variable assertInt(Variable x) { + assert x != null && (x.getKind() == Kind.Int); + return x; + } + + private static Variable assertFloat(Variable x) { + assert x != null && (x.getKind() == Kind.Float); + return x; + } + + private static Variable assertObject(Variable x) { + assert x != null && (x.getKind() == Kind.Object); + return x; + } + + private static Variable assertDouble(Variable x) { + assert x != null && (x.getKind() == Kind.Double); + return x; + } + + private static void assertHigh(Variable x) { + assert x == null; + } +} diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java --- a/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.compiler.ptx/src/com/oracle/graal/compiler/ptx/PTXLIRGenerator.java Tue Mar 18 09:56:20 2014 +0000 @@ -926,7 +926,7 @@ @Override public void emitNullCheck(ValueNode v, DeoptimizingNode deopting) { - assert v.kind() == Kind.Object; + assert v.getKind() == Kind.Object; append(new PTXMove.NullCheckOp(load(operand(v)), state(deopting))); } @@ -983,7 +983,7 @@ public void visitReturn(ReturnNode x) { AllocatableValue operand = Value.ILLEGAL; if (x.result() != null) { - operand = resultOperandFor(x.result().kind()); + operand = resultOperandFor(x.result().getKind()); // Load the global memory address from return parameter Variable loadVar = emitLoadReturnAddress(operand.getKind(), operand, null); // Store result in global memory whose location is loadVar diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java --- a/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.compiler.sparc/src/com/oracle/graal/compiler/sparc/SPARCLIRGenerator.java Tue Mar 18 09:56:20 2014 +0000 @@ -941,7 +941,7 @@ @Override public void emitNullCheck(ValueNode v, DeoptimizingNode deopting) { - assert v.kind() == Kind.Object; + assert v.getKind() == Kind.Object; append(new NullCheckOp(load(operand(v)), state(deopting))); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/CompiledMethodTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/CompiledMethodTest.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/deopt/CompiledMethodTest.java Tue Mar 18 09:56:20 2014 +0000 @@ -59,7 +59,7 @@ new DeadCodeEliminationPhase().apply(graph); for (ConstantNode node : ConstantNode.getConstantNodes(graph)) { - if (node.kind() == Kind.Object && " ".equals(node.getValue().asObject())) { + if (node.getKind() == Kind.Object && " ".equals(node.getValue().asObject())) { node.replace(graph, ConstantNode.forObject("-", getMetaAccess(), graph)); } } diff -r c4219e527b83 -r 80147dac0d6e 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 Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java Tue Mar 18 09:56:20 2014 +0000 @@ -89,7 +89,7 @@ if (!currentField.fieldValues().get(i).isConstant() || currentField.fieldValues().get(i).asConstant().getKind() != Kind.Illegal) { values[pos++] = toValue(currentField.fieldValues().get(i)); } else { - assert currentField.fieldValues().get(i - 1).kind() == Kind.Double || currentField.fieldValues().get(i - 1).kind() == Kind.Long : vobj + " " + i + " " + + assert currentField.fieldValues().get(i - 1).getKind() == Kind.Double || currentField.fieldValues().get(i - 1).getKind() == Kind.Long : vobj + " " + i + " " + currentField.fieldValues().get(i - 1); } } diff -r c4219e527b83 -r 80147dac0d6e 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 Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Tue Mar 18 09:56:20 2014 +0000 @@ -309,7 +309,7 @@ assert (!isRegister(operand) || !attributes(asRegister(operand)).isAllocatable()); assert nodeOperands == null || nodeOperands.get(x) == null : "operand cannot be set twice"; assert operand != null && isLegal(operand) : "operand must be legal"; - assert operand.getKind().getStackKind() == x.kind() || x.kind() == Kind.Illegal : operand.getKind().getStackKind() + " must match " + x.kind(); + assert operand.getKind().getStackKind() == x.getKind() || x.getKind() == Kind.Illegal : operand.getKind().getStackKind() + " must match " + x.getKind(); assert !(x instanceof VirtualObjectNode); nodeOperands.set(x, operand); return operand; @@ -541,7 +541,7 @@ for (ParameterNode param : graph.getNodes(ParameterNode.class)) { Value paramValue = params[param.index()]; - assert paramValue.getKind() == param.kind().getStackKind(); + assert paramValue.getKind() == param.getKind().getStackKind(); setResult(param, emitMove(paramValue)); } } @@ -554,7 +554,7 @@ public void visitReturn(ReturnNode x) { AllocatableValue operand = ILLEGAL; if (x.result() != null) { - operand = resultOperandFor(x.result().kind()); + operand = resultOperandFor(x.result().getKind()); emitMove(operand, operand(x.result())); } emitReturn(operand); @@ -595,7 +595,7 @@ } protected PlatformKind getPhiKind(PhiNode phi) { - return phi.kind(); + return phi.getKind(); } private Value operandForPhi(PhiNode phi) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64HotSpotLIRGenerator.java Tue Mar 18 09:56:20 2014 +0000 @@ -179,7 +179,7 @@ for (ParameterNode param : graph.getNodes(ParameterNode.class)) { Value paramValue = params[param.index()]; - assert paramValue.getKind() == param.kind().getStackKind(); + assert paramValue.getKind() == param.getKind().getStackKind(); setResult(param, emitMove(paramValue)); } } @@ -315,8 +315,8 @@ @SuppressWarnings("hiding") @Override public void visitDirectCompareAndSwap(DirectCompareAndSwapNode x) { - Kind kind = x.newValue().kind(); - assert kind == x.expectedValue().kind(); + Kind kind = x.newValue().getKind(); + assert kind == x.expectedValue().getKind(); Value expected = loadNonConst(operand(x.expectedValue())); Variable newVal = load(operand(x.newValue())); @@ -336,7 +336,7 @@ emitMove(rax, expected); append(new CompareAndSwapOp(rax, address, rax, newVal)); - Variable result = newVariable(x.kind()); + Variable result = newVariable(x.getKind()); emitMove(result, rax); setResult(x, result); } @@ -564,8 +564,8 @@ @Override public void visitCompareAndSwap(LoweredCompareAndSwapNode node, Value address) { - Kind kind = node.getNewValue().kind(); - assert kind == node.getExpectedValue().kind(); + Kind kind = node.getNewValue().getKind(); + assert kind == node.getExpectedValue().getKind(); Value expected = loadNonConst(operand(node.getExpectedValue())); Variable newValue = load(operand(node.getNewValue())); AMD64AddressValue addressValue = asAddressValue(address); @@ -578,7 +578,7 @@ } else { append(new CompareAndSwapOp(raxRes, addressValue, raxRes, newValue)); } - Variable result = newVariable(node.kind()); + Variable result = newVariable(node.getKind()); append(new CondMoveOp(result, Condition.EQ, load(Constant.TRUE), Constant.FALSE)); setResult(node, result); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java --- a/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.amd64/src/com/oracle/graal/hotspot/amd64/AMD64RawNativeCallNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -55,7 +55,7 @@ ResolvedJavaType returnType = stamp().javaType(gen.getMetaAccess()); CallingConvention cc = generator.getCodeCache().getRegisterConfig().getCallingConvention(Type.NativeCall, returnType, parameterTypes, generator.target(), false); gen.emitCCall(functionPointer.asLong(), cc, parameter, countFloatingTypeArguments(args)); - if (this.kind() != Kind.Void) { + if (this.getKind() != Kind.Void) { generator.setResult(this, gen.emitMove(cc.getReturn())); } } @@ -63,7 +63,7 @@ private static int countFloatingTypeArguments(NodeInputList args) { int count = 0; for (ValueNode n : args) { - if (n.kind() == Kind.Double || n.kind() == Kind.Float) { + if (n.getKind() == Kind.Double || n.getKind() == Kind.Float) { count++; } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.hsail/src/com/oracle/graal/hotspot/hsail/HSAILHotSpotLIRGenerator.java Tue Mar 18 09:56:20 2014 +0000 @@ -98,8 +98,8 @@ */ @Override public void visitCompareAndSwap(LoweredCompareAndSwapNode node, Value address) { - Kind kind = node.getNewValue().kind(); - assert kind == node.getExpectedValue().kind(); + Kind kind = node.getNewValue().getKind(); + assert kind == node.getExpectedValue().getKind(); Variable expected = load(operand(node.getExpectedValue())); Variable newValue = load(operand(node.getNewValue())); HSAILAddressValue addressValue = asAddressValue(address); @@ -117,7 +117,7 @@ } else { append(new CompareAndSwapOp(casResult, addressValue, expected, newValue)); } - Variable nodeResult = newVariable(node.kind()); + Variable nodeResult = newVariable(node.getKind()); append(new CondMoveOp(mapKindToCompareOp(kind), casResult, expected, nodeResult, Condition.EQ, Constant.INT_1, Constant.INT_0)); setResult(node, nodeResult); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java --- a/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXWrapperBuilder.java Tue Mar 18 09:56:20 2014 +0000 @@ -235,7 +235,7 @@ for (javaParametersIndex = 0; javaParametersIndex < javaParameters.length; javaParametersIndex++) { ParameterNode javaParameter = javaParameters[javaParametersIndex]; int javaParameterOffset = javaParameterOffsetsInKernelParametersBuffer[javaParametersIndex]; - LocationNode location = ConstantLocationNode.create(FINAL_LOCATION, javaParameter.kind(), javaParameterOffset, getGraph()); + LocationNode location = ConstantLocationNode.create(FINAL_LOCATION, javaParameter.getKind(), javaParameterOffset, getGraph()); append(new WriteNode(buf, javaParameter, location, BarrierType.NONE, false, false)); updateDimArg(method, sig, sigIndex++, args, javaParameter); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- a/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.sparc/src/com/oracle/graal/hotspot/sparc/SPARCHotSpotLIRGenerator.java Tue Mar 18 09:56:20 2014 +0000 @@ -124,8 +124,8 @@ @Override public void visitDirectCompareAndSwap(DirectCompareAndSwapNode x) { - Kind kind = x.newValue().kind(); - assert kind == x.expectedValue().kind(); + Kind kind = x.newValue().getKind(); + assert kind == x.expectedValue().getKind(); Variable address = load(operand(x.object())); Value offset = operand(x.offset()); @@ -145,7 +145,7 @@ append(new CompareAndSwapOp(address, cmpValue, newValue)); - Variable result = newVariable(x.kind()); + Variable result = newVariable(x.getKind()); emitMove(result, newValue); setResult(x, result); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/AheadOfTimeCompilationTest.java Tue Mar 18 09:56:20 2014 +0000 @@ -67,7 +67,7 @@ public void testStaticFinalObjectAOT() { StructuredGraph result = compile("getStaticFinalObject", true); assertEquals(1, getConstantNodes(result).count()); - assertEquals(getCodeCache().getTarget().wordKind, getConstantNodes(result).first().kind()); + assertEquals(getCodeCache().getTarget().wordKind, getConstantNodes(result).first().getKind()); assertEquals(2, result.getNodes(FloatingReadNode.class).count()); assertEquals(0, result.getNodes().filter(ReadNode.class).count()); } @@ -76,7 +76,7 @@ public void testStaticFinalObject() { StructuredGraph result = compile("getStaticFinalObject", false); assertEquals(1, getConstantNodes(result).count()); - assertEquals(Kind.Object, getConstantNodes(result).first().kind()); + assertEquals(Kind.Object, getConstantNodes(result).first().getKind()); assertEquals(0, result.getNodes(FloatingReadNode.class).count()); assertEquals(0, result.getNodes().filter(ReadNode.class).count()); } @@ -121,7 +121,7 @@ StructuredGraph result = compile("getPrimitiveClassObject", true); NodeIterable filter = getConstantNodes(result); assertEquals(1, filter.count()); - assertEquals(getCodeCache().getTarget().wordKind, filter.first().kind()); + assertEquals(getCodeCache().getTarget().wordKind, filter.first().getKind()); assertEquals(2, result.getNodes(FloatingReadNode.class).count()); assertEquals(0, result.getNodes().filter(ReadNode.class).count()); @@ -181,7 +181,7 @@ assertEquals(1, result.getNodes(PiNode.class).count()); assertEquals(1, getConstantNodes(result).count()); ConstantNode constant = getConstantNodes(result).first(); - assertEquals(Kind.Long, constant.kind()); + assertEquals(Kind.Long, constant.getKind()); assertEquals(((HotSpotResolvedObjectType) getMetaAccess().lookupJavaType(Boolean.class)).klass(), constant.asConstant()); } @@ -192,7 +192,7 @@ assertEquals(0, result.getNodes(PiNode.class).count()); assertEquals(1, getConstantNodes(result).count()); ConstantNode constant = getConstantNodes(result).first(); - assertEquals(Kind.Object, constant.kind()); + assertEquals(Kind.Object, constant.getKind()); assertEquals(Boolean.TRUE, constant.asConstant().asObject()); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotLoweringProvider.java Tue Mar 18 09:56:20 2014 +0000 @@ -259,9 +259,9 @@ StructuredGraph graph = loadField.graph(); HotSpotResolvedJavaField field = (HotSpotResolvedJavaField) loadField.field(); ValueNode object = loadField.isStatic() ? ConstantNode.forObject(field.getDeclaringClass().mirror(), metaAccess, graph) : loadField.object(); - assert loadField.kind() != Kind.Illegal; + assert loadField.getKind() != Kind.Illegal; BarrierType barrierType = getFieldLoadBarrierType(field); - ReadNode memoryRead = graph.add(new ReadNode(object, createFieldLocation(graph, field, false), loadField.stamp(), barrierType, (loadField.kind() == Kind.Object))); + ReadNode memoryRead = graph.add(new ReadNode(object, createFieldLocation(graph, field, false), loadField.stamp(), barrierType, (loadField.getKind() == Kind.Object))); graph.replaceFixedWithFixed(loadField, memoryRead); memoryRead.setGuard(createNullCheck(object, memoryRead, tool)); @@ -296,9 +296,9 @@ private static void lowerCompareAndSwapNode(CompareAndSwapNode cas) { // Separate out GC barrier semantics StructuredGraph graph = cas.graph(); - LocationNode location = IndexedLocationNode.create(cas.getLocationIdentity(), cas.expected().kind(), cas.displacement(), cas.offset(), graph, 1); + LocationNode location = IndexedLocationNode.create(cas.getLocationIdentity(), cas.expected().getKind(), cas.displacement(), cas.offset(), graph, 1); LoweredCompareAndSwapNode atomicNode = graph.add(new LoweredCompareAndSwapNode(cas.object(), location, cas.expected(), cas.newValue(), getCompareAndSwapBarrier(cas), - cas.expected().kind() == Kind.Object)); + cas.expected().getKind() == Kind.Object)); atomicNode.setStateAfter(cas.stateAfter()); graph.replaceFixedWithFixed(cas, atomicNode); } @@ -372,7 +372,7 @@ graph.replaceFixedWithFixed(load, valueAnchorNode); graph.addAfterFixed(valueAnchorNode, memoryRead); } else if (graph.getGuardsStage().ordinal() > StructuredGraph.GuardsStage.FLOATING_GUARDS.ordinal()) { - assert load.kind() != Kind.Illegal; + assert load.getKind() != Kind.Illegal; boolean compressible = (!load.object().isNullConstant() && load.accessKind() == Kind.Object); if (addReadBarrier(load)) { unsafeLoadSnippets.lower(load, tool); @@ -392,7 +392,7 @@ LocationNode location = createLocation(store); ValueNode object = store.object(); BarrierType barrierType = getUnsafeStoreBarrierType(store); - WriteNode write = graph.add(new WriteNode(object, store.value(), location, barrierType, store.value().kind() == Kind.Object)); + WriteNode write = graph.add(new WriteNode(object, store.value(), location, barrierType, store.value().getKind() == Kind.Object)); write.setStateAfter(store.stateAfter()); graph.replaceFixedWithFixed(store, write); } @@ -401,7 +401,7 @@ StructuredGraph graph = loadHub.graph(); if (graph.getGuardsStage().ordinal() >= StructuredGraph.GuardsStage.FIXED_DEOPTS.ordinal()) { Kind wordKind = runtime.getTarget().wordKind; - assert loadHub.kind() == wordKind; + assert loadHub.getKind() == wordKind; ValueNode object = loadHub.object(); GuardingNode guard = loadHub.getGuard(); FloatingReadNode hub = createReadHub(graph, wordKind, object, guard); @@ -447,7 +447,7 @@ omittedValues.set(valuePos); } else if (!(value.isConstant() && value.asConstant().isDefaultForKind())) { // Constant.illegal is always the defaultForKind, so it is skipped - Kind valueKind = value.kind(); + Kind valueKind = value.getKind(); Kind entryKind = virtual.entryKind(i); // Truffle requires some leniency in terms of what can be put where: @@ -483,7 +483,7 @@ assert value instanceof VirtualObjectNode; ValueNode allocValue = allocations[commit.getVirtualObjects().indexOf(value)]; if (!(allocValue.isConstant() && allocValue.asConstant().isDefaultForKind())) { - assert virtual.entryKind(i) == Kind.Object && allocValue.kind() == Kind.Object; + assert virtual.entryKind(i) == Kind.Object && allocValue.getKind() == Kind.Object; WriteNode write; if (virtual instanceof VirtualInstanceNode) { VirtualInstanceNode virtualInstance = (VirtualInstanceNode) virtual; @@ -520,9 +520,9 @@ // mirroring the calculations in c1_GraphBuilder.cpp (setup_osr_entry_block) int localsOffset = (graph.method().getMaxLocals() - 1) * 8; for (OSRLocalNode osrLocal : graph.getNodes(OSRLocalNode.class)) { - int size = HIRFrameStateBuilder.stackSlots(osrLocal.kind()); + int size = HIRFrameStateBuilder.stackSlots(osrLocal.getKind()); int offset = localsOffset - (osrLocal.index() + size - 1) * 8; - IndexedLocationNode location = IndexedLocationNode.create(ANY_LOCATION, osrLocal.kind(), offset, ConstantNode.forLong(0, graph), graph, 1); + IndexedLocationNode location = IndexedLocationNode.create(ANY_LOCATION, osrLocal.getKind(), offset, ConstantNode.forLong(0, graph), graph, 1); ReadNode load = graph.add(new ReadNode(buffer, location, osrLocal.stamp(), BarrierType.NONE, false)); osrLocal.replaceAndDelete(load); graph.addBeforeFixed(migrationEnd, load); @@ -606,7 +606,7 @@ } private static boolean addReadBarrier(UnsafeLoadNode load) { - if (useG1GC() && load.graph().getGuardsStage() == StructuredGraph.GuardsStage.FIXED_DEOPTS && load.object().kind() == Kind.Object && load.accessKind() == Kind.Object && + if (useG1GC() && load.graph().getGuardsStage() == StructuredGraph.GuardsStage.FIXED_DEOPTS && load.object().getKind() == Kind.Object && load.accessKind() == Kind.Object && !ObjectStamp.isObjectAlwaysNull(load.object())) { ResolvedJavaType type = ObjectStamp.typeOrNull(load.object()); if (type != null && !type.isArray()) { @@ -669,7 +669,7 @@ private static BarrierType getUnsafeStoreBarrierType(UnsafeStoreNode store) { BarrierType barrierType = BarrierType.NONE; - if (store.value().kind() == Kind.Object) { + if (store.value().getKind() == Kind.Object) { ResolvedJavaType type = ObjectStamp.typeOrNull(store.object()); if (type != null && !type.isArray()) { barrierType = BarrierType.IMPRECISE; @@ -682,7 +682,7 @@ private static BarrierType getCompareAndSwapBarrier(CompareAndSwapNode cas) { BarrierType barrierType = BarrierType.NONE; - if (cas.expected().kind() == Kind.Object) { + if (cas.expected().getKind() == Kind.Object) { ResolvedJavaType type = ObjectStamp.typeOrNull(cas.object()); if (type != null && !type.isArray()) { barrierType = BarrierType.IMPRECISE; diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nfi/NativeCallStubGraphBuilder.java Tue Mar 18 09:56:20 2014 +0000 @@ -79,12 +79,12 @@ // box result BoxNode boxedResult; - if (callNode.kind() != Kind.Void) { - if (callNode.kind() == Kind.Object) { + if (callNode.getKind() != Kind.Void) { + if (callNode.getKind() == Kind.Object) { throw new IllegalArgumentException("Return type not supported: " + returnType.getName()); } - ResolvedJavaType type = providers.getMetaAccess().lookupJavaType(callNode.kind().toBoxedJavaClass()); - boxedResult = g.unique(new BoxNode(callNode, type, callNode.kind())); + ResolvedJavaType type = providers.getMetaAccess().lookupJavaType(callNode.getKind().toBoxedJavaClass()); + boxedResult = g.unique(new BoxNode(callNode, type, callNode.getKind())); } else { boxedResult = g.unique(new BoxNode(ConstantNode.forLong(0, g), providers.getMetaAccess().lookupJavaType(Long.class), Kind.Long)); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentJavaThreadNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -43,7 +43,7 @@ @Override public void generate(LIRGeneratorTool gen) { Register rawThread = ((HotSpotLIRGenerator) gen).getProviders().getRegisters().getThreadRegister(); - gen.setResult(this, rawThread.asValue(this.kind())); + gen.setResult(this, rawThread.asValue(this.getKind())); } private static int eetopOffset() { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -67,7 +67,7 @@ JavaType[] signature = MetaUtil.signatureToTypes(method.getSignature(), isStatic ? null : method.getDeclaringClass()); CallingConvention cc = gen.getFrameMap().registerConfig.getCallingConvention(CallingConvention.Type.JavaCall, null, signature, gen.target(), false); List parameters = new ArrayList<>(); - for (int i = 0, slot = 0; i < cc.getArgumentCount(); i++, slot += HIRFrameStateBuilder.stackSlots(frameState.localAt(slot).kind())) { + for (int i = 0, slot = 0; i < cc.getArgumentCount(); i++, slot += HIRFrameStateBuilder.stackSlots(frameState.localAt(slot).getKind())) { parameters.add(frameState.localAt(slot)); } Value[] args = gen.visitInvokeArguments(cc, parameters); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/AheadOfTimeVerificationPhase.java Tue Mar 18 09:56:20 2014 +0000 @@ -51,7 +51,7 @@ } private static boolean isObject(ConstantNode node) { - return node.kind() == Kind.Object; + return node.getKind() == Kind.Object; } private static boolean isNullReference(ConstantNode node) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractFrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractFrameStateBuilder.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/AbstractFrameStateBuilder.java Tue Mar 18 09:56:20 2014 +0000 @@ -6,19 +6,14 @@ public abstract class AbstractFrameStateBuilder { protected final ResolvedJavaMethod method; - protected final StructuredGraph graph; protected int stackSize; - public AbstractFrameStateBuilder(ResolvedJavaMethod method, StructuredGraph graph) { - assert graph != null; + public AbstractFrameStateBuilder(ResolvedJavaMethod method) { this.method = method; - this.graph = graph; } protected AbstractFrameStateBuilder(AbstractFrameStateBuilder other) { - assert other.graph != null; this.method = other.method; - this.graph = other.graph; } /** @@ -61,9 +56,8 @@ public abstract T loadLocal(int i); /** - * Stores a given local variable at the specified index. If the value occupies - * {@linkplain HIRFrameStateBuilder#isTwoSlot(Kind) two slots}, then the next local variable index - * is also overwritten. + * Stores a given local variable at the specified index. If the value occupies two slots, then + * the next local variable index is also overwritten. * * @param i the index at which to store * @param x the instruction which produces the value for the local @@ -192,6 +186,10 @@ */ public abstract T peek(int argumentNumber); + public static int stackSlots(Kind kind) { + return isTwoSlot(kind) ? 2 : 1; + } + /** * Clears all values on this stack. */ @@ -199,4 +197,9 @@ stackSize = 0; } + protected static boolean isTwoSlot(Kind kind) { + assert kind != Kind.Void && kind != Kind.Illegal; + return kind == Kind.Long || kind == Kind.Double; + } + } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java Fri Mar 14 17:19:52 2014 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,698 +0,0 @@ -/* - * Copyright (c) 2012, 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.graal.java; - -import static com.oracle.graal.graph.iterators.NodePredicates.*; -import static com.oracle.graal.nodes.ValueNodeUtil.*; -import static java.lang.reflect.Modifier.*; - -import java.util.*; - -import com.oracle.graal.api.code.*; -import com.oracle.graal.api.meta.*; -import com.oracle.graal.debug.*; -import com.oracle.graal.graph.Node.Verbosity; -import com.oracle.graal.java.BciBlockMapping.Block; -import com.oracle.graal.java.BciBlockMapping.LocalLiveness; -import com.oracle.graal.nodes.*; -import com.oracle.graal.nodes.calc.*; -import com.oracle.graal.nodes.java.*; -import com.oracle.graal.nodes.type.*; -import com.oracle.graal.nodes.util.*; - -public class FrameStateBuilder { - - private static final ValueNode[] EMPTY_ARRAY = new ValueNode[0]; - private static final MonitorIdNode[] EMPTY_MONITOR_ARRAY = new MonitorIdNode[0]; - - private final ResolvedJavaMethod method; - private final StructuredGraph graph; - - private final ValueNode[] locals; - private final ValueNode[] stack; - private ValueNode[] lockedObjects; - private MonitorIdNode[] monitorIds; - - private int stackSize; - - /** - * @see BytecodeFrame#rethrowException - */ - private boolean rethrowException; - - public FrameStateBuilder(ResolvedJavaMethod method, StructuredGraph graph, boolean eagerResolve) { - assert graph != null; - this.method = method; - this.graph = graph; - this.locals = new ValueNode[method.getMaxLocals()]; - // we always need at least one stack slot (for exceptions) - this.stack = new ValueNode[Math.max(1, method.getMaxStackSize())]; - this.lockedObjects = EMPTY_ARRAY; - this.monitorIds = EMPTY_MONITOR_ARRAY; - - int javaIndex = 0; - int index = 0; - if (!isStatic(method.getModifiers())) { - // add the receiver - ParameterNode receiver = graph.unique(new ParameterNode(javaIndex, StampFactory.declaredNonNull(method.getDeclaringClass()))); - storeLocal(javaIndex, receiver); - javaIndex = 1; - index = 1; - } - Signature sig = method.getSignature(); - int max = sig.getParameterCount(false); - ResolvedJavaType accessingClass = method.getDeclaringClass(); - for (int i = 0; i < max; i++) { - JavaType type = sig.getParameterType(i, accessingClass); - if (eagerResolve) { - type = type.resolve(accessingClass); - } - Kind kind = type.getKind().getStackKind(); - Stamp stamp; - if (kind == Kind.Object && type instanceof ResolvedJavaType) { - stamp = StampFactory.declared((ResolvedJavaType) type); - } else { - stamp = StampFactory.forKind(kind); - } - ParameterNode param = graph.unique(new ParameterNode(index, stamp)); - storeLocal(javaIndex, param); - javaIndex += stackSlots(kind); - index++; - } - } - - private FrameStateBuilder(FrameStateBuilder other) { - method = other.method; - graph = other.graph; - locals = other.locals.clone(); - stack = other.stack.clone(); - lockedObjects = other.lockedObjects == EMPTY_ARRAY ? EMPTY_ARRAY : other.lockedObjects.clone(); - monitorIds = other.monitorIds == EMPTY_MONITOR_ARRAY ? EMPTY_MONITOR_ARRAY : other.monitorIds.clone(); - stackSize = other.stackSize; - rethrowException = other.rethrowException; - - assert locals.length == method.getMaxLocals(); - assert stack.length == Math.max(1, method.getMaxStackSize()); - assert lockedObjects.length == monitorIds.length; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("[locals: ["); - for (int i = 0; i < locals.length; i++) { - sb.append(i == 0 ? "" : ",").append(locals[i] == null ? "_" : locals[i].toString(Verbosity.Id)); - } - sb.append("] stack: ["); - for (int i = 0; i < stackSize; i++) { - sb.append(i == 0 ? "" : ",").append(stack[i] == null ? "_" : stack[i].toString(Verbosity.Id)); - } - sb.append("] locks: ["); - for (int i = 0; i < lockedObjects.length; i++) { - sb.append(i == 0 ? "" : ",").append(lockedObjects[i].toString(Verbosity.Id)).append(" / ").append(monitorIds[i].toString(Verbosity.Id)); - } - sb.append("]"); - if (rethrowException) { - sb.append(" rethrowException"); - } - sb.append("]"); - return sb.toString(); - } - - public FrameState create(int bci) { - return graph.add(new FrameState(method, bci, locals, Arrays.asList(stack).subList(0, stackSize), lockedObjects, monitorIds, rethrowException, false)); - } - - public FrameStateBuilder copy() { - return new FrameStateBuilder(this); - } - - public boolean isCompatibleWith(FrameStateBuilder other) { - assert method.equals(other.method) && graph == other.graph && localsSize() == other.localsSize() : "Can only compare frame states of the same method"; - assert lockedObjects.length == monitorIds.length && other.lockedObjects.length == other.monitorIds.length : "mismatch between lockedObjects and monitorIds"; - - if (stackSize() != other.stackSize()) { - return false; - } - for (int i = 0; i < stackSize(); i++) { - ValueNode x = stackAt(i); - ValueNode y = other.stackAt(i); - if (x != y && (x == null || x.isDeleted() || y == null || y.isDeleted() || x.kind() != y.kind())) { - return false; - } - } - if (lockedObjects.length != other.lockedObjects.length) { - return false; - } - for (int i = 0; i < lockedObjects.length; i++) { - if (GraphUtil.originalValue(lockedObjects[i]) != GraphUtil.originalValue(other.lockedObjects[i]) || monitorIds[i] != other.monitorIds[i]) { - throw new BailoutException("unbalanced monitors"); - } - } - return true; - } - - public void merge(MergeNode block, FrameStateBuilder other) { - assert isCompatibleWith(other); - - for (int i = 0; i < localsSize(); i++) { - storeLocal(i, merge(localAt(i), other.localAt(i), block)); - } - for (int i = 0; i < stackSize(); i++) { - storeStack(i, merge(stackAt(i), other.stackAt(i), block)); - } - for (int i = 0; i < lockedObjects.length; i++) { - lockedObjects[i] = merge(lockedObjects[i], other.lockedObjects[i], block); - assert monitorIds[i] == other.monitorIds[i]; - } - } - - private ValueNode merge(ValueNode currentValue, ValueNode otherValue, MergeNode block) { - if (currentValue == null || currentValue.isDeleted()) { - return null; - - } else if (block.isPhiAtMerge(currentValue)) { - if (otherValue == null || otherValue.isDeleted() || currentValue.kind() != otherValue.kind()) { - propagateDelete((PhiNode) currentValue); - return null; - } - ((PhiNode) currentValue).addInput(otherValue); - return currentValue; - - } else if (currentValue != otherValue) { - assert !(block instanceof LoopBeginNode) : "Phi functions for loop headers are create eagerly for all locals and stack slots"; - if (otherValue == null || otherValue.isDeleted() || currentValue.kind() != otherValue.kind()) { - return null; - } - - PhiNode phi = graph.addWithoutUnique(new PhiNode(currentValue.kind(), block)); - for (int i = 0; i < block.phiPredecessorCount(); i++) { - phi.addInput(currentValue); - } - phi.addInput(otherValue); - assert phi.valueCount() == block.phiPredecessorCount() + 1 : "valueCount=" + phi.valueCount() + " predSize= " + block.phiPredecessorCount(); - return phi; - - } else { - return currentValue; - } - } - - private void propagateDelete(FloatingNode node) { - assert node instanceof PhiNode || node instanceof ProxyNode; - if (node.isDeleted()) { - return; - } - // Collect all phi functions that use this phi so that we can delete them recursively (after - // we delete ourselves to avoid circles). - List propagateUsages = node.usages().filter(FloatingNode.class).filter(isA(PhiNode.class).or(ProxyNode.class)).snapshot(); - - // Remove the phi function from all FrameStates where it is used and then delete it. - assert node.usages().filter(isNotA(FrameState.class).nor(PhiNode.class).nor(ProxyNode.class)).isEmpty() : "phi function that gets deletes must only be used in frame states"; - node.replaceAtUsages(null); - node.safeDelete(); - - for (FloatingNode phiUsage : propagateUsages) { - propagateDelete(phiUsage); - } - } - - public void insertLoopPhis(LoopBeginNode loopBegin) { - for (int i = 0; i < localsSize(); i++) { - storeLocal(i, createLoopPhi(loopBegin, localAt(i))); - } - for (int i = 0; i < stackSize(); i++) { - storeStack(i, createLoopPhi(loopBegin, stackAt(i))); - } - for (int i = 0; i < lockedObjects.length; i++) { - lockedObjects[i] = createLoopPhi(loopBegin, lockedObjects[i]); - } - } - - public void insertLoopProxies(LoopExitNode loopExit, FrameStateBuilder loopEntryState) { - for (int i = 0; i < localsSize(); i++) { - ValueNode value = localAt(i); - if (value != null && (!loopEntryState.contains(value) || loopExit.loopBegin().isPhiAtMerge(value))) { - Debug.log(" inserting proxy for %s", value); - storeLocal(i, ProxyNode.forValue(value, loopExit, graph)); - } - } - for (int i = 0; i < stackSize(); i++) { - ValueNode value = stackAt(i); - if (value != null && (!loopEntryState.contains(value) || loopExit.loopBegin().isPhiAtMerge(value))) { - Debug.log(" inserting proxy for %s", value); - storeStack(i, ProxyNode.forValue(value, loopExit, graph)); - } - } - for (int i = 0; i < lockedObjects.length; i++) { - ValueNode value = lockedObjects[i]; - if (value != null && (!loopEntryState.contains(value) || loopExit.loopBegin().isPhiAtMerge(value))) { - Debug.log(" inserting proxy for %s", value); - lockedObjects[i] = ProxyNode.forValue(value, loopExit, graph); - } - } - } - - public void insertProxies(AbstractBeginNode begin) { - for (int i = 0; i < localsSize(); i++) { - ValueNode value = localAt(i); - if (value != null) { - Debug.log(" inserting proxy for %s", value); - storeLocal(i, ProxyNode.forValue(value, begin, graph)); - } - } - for (int i = 0; i < stackSize(); i++) { - ValueNode value = stackAt(i); - if (value != null) { - Debug.log(" inserting proxy for %s", value); - storeStack(i, ProxyNode.forValue(value, begin, graph)); - } - } - for (int i = 0; i < lockedObjects.length; i++) { - ValueNode value = lockedObjects[i]; - if (value != null) { - Debug.log(" inserting proxy for %s", value); - lockedObjects[i] = ProxyNode.forValue(value, begin, graph); - } - } - } - - private PhiNode createLoopPhi(MergeNode block, ValueNode value) { - if (value == null) { - return null; - } - assert !block.isPhiAtMerge(value) : "phi function for this block already created"; - - PhiNode phi = graph.addWithoutUnique(new PhiNode(value.kind(), block)); - phi.addInput(value); - return phi; - } - - public void cleanupDeletedPhis() { - for (int i = 0; i < localsSize(); i++) { - if (localAt(i) != null && localAt(i).isDeleted()) { - assert localAt(i) instanceof PhiNode || localAt(i) instanceof ProxyNode : "Only phi and value proxies can be deleted during parsing: " + localAt(i); - storeLocal(i, null); - } - } - } - - public void clearNonLiveLocals(Block block, LocalLiveness liveness, boolean liveIn) { - if (liveness == null) { - return; - } - if (liveIn) { - for (int i = 0; i < locals.length; i++) { - if (!liveness.localIsLiveIn(block, i)) { - locals[i] = null; - } - } - } else { - for (int i = 0; i < locals.length; i++) { - if (!liveness.localIsLiveOut(block, i)) { - locals[i] = null; - } - } - } - } - - /** - * @see BytecodeFrame#rethrowException - */ - public boolean rethrowException() { - return rethrowException; - } - - /** - * @see BytecodeFrame#rethrowException - */ - public void setRethrowException(boolean b) { - rethrowException = b; - } - - /** - * Returns the size of the local variables. - * - * @return the size of the local variables - */ - public int localsSize() { - return locals.length; - } - - /** - * Gets the current size (height) of the stack. - */ - public int stackSize() { - return stackSize; - } - - /** - * Gets the value in the local variables at the specified index, without any sanity checking. - * - * @param i the index into the locals - * @return the instruction that produced the value for the specified local - */ - public final ValueNode localAt(int i) { - return locals[i]; - } - - /** - * Get the value on the stack at the specified stack index. - * - * @param i the index into the stack, with {@code 0} being the bottom of the stack - * @return the instruction at the specified position in the stack - */ - public final ValueNode stackAt(int i) { - return stack[i]; - } - - /** - * Adds a locked monitor to this frame state. - * - * @param object the object whose monitor will be locked. - */ - public void pushLock(ValueNode object, MonitorIdNode monitorId) { - assert object.isAlive() && object.kind() == Kind.Object : "unexpected value: " + object; - lockedObjects = Arrays.copyOf(lockedObjects, lockedObjects.length + 1); - monitorIds = Arrays.copyOf(monitorIds, monitorIds.length + 1); - lockedObjects[lockedObjects.length - 1] = object; - monitorIds[monitorIds.length - 1] = monitorId; - assert lockedObjects.length == monitorIds.length; - } - - /** - * Removes a locked monitor from this frame state. - * - * @return the object whose monitor was removed from the locks list. - */ - public ValueNode popLock() { - try { - return lockedObjects[lockedObjects.length - 1]; - } finally { - lockedObjects = lockedObjects.length == 1 ? EMPTY_ARRAY : Arrays.copyOf(lockedObjects, lockedObjects.length - 1); - monitorIds = monitorIds.length == 1 ? EMPTY_MONITOR_ARRAY : Arrays.copyOf(monitorIds, monitorIds.length - 1); - } - } - - public MonitorIdNode peekMonitorId() { - return monitorIds[monitorIds.length - 1]; - } - - /** - * @return the current lock depth - */ - public int lockDepth() { - assert lockedObjects.length == monitorIds.length; - return lockedObjects.length; - } - - /** - * Loads the local variable at the specified index, checking that the returned value is non-null - * and that two-stack values are properly handled. - * - * @param i the index of the local variable to load - * @return the instruction that produced the specified local - */ - public ValueNode loadLocal(int i) { - ValueNode x = locals[i]; - assert !x.isDeleted(); - assert !isTwoSlot(x.kind()) || locals[i + 1] == null; - assert i == 0 || locals[i - 1] == null || !isTwoSlot(locals[i - 1].kind()); - return x; - } - - /** - * Stores a given local variable at the specified index. If the value occupies - * {@linkplain FrameStateBuilder#isTwoSlot(Kind) two slots}, then the next local variable index - * is also overwritten. - * - * @param i the index at which to store - * @param x the instruction which produces the value for the local - */ - public void storeLocal(int i, ValueNode x) { - assert x == null || x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal : "unexpected value: " + x; - locals[i] = x; - if (x != null && isTwoSlot(x.kind())) { - // if this is a double word, then kill i+1 - locals[i + 1] = null; - } - if (x != null && i > 0) { - ValueNode p = locals[i - 1]; - if (p != null && isTwoSlot(p.kind())) { - // if there was a double word at i - 1, then kill it - locals[i - 1] = null; - } - } - } - - public void storeStack(int i, ValueNode x) { - assert x == null || x.isAlive() && (stack[i] == null || x.kind() == stack[i].kind()) : "Method does not handle changes from one-slot to two-slot values or non-alive values"; - stack[i] = x; - } - - /** - * Pushes an instruction onto the stack with the expected type. - * - * @param kind the type expected for this instruction - * @param x the instruction to push onto the stack - */ - public void push(Kind kind, ValueNode x) { - assert x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal; - xpush(assertKind(kind, x)); - if (isTwoSlot(kind)) { - xpush(null); - } - } - - /** - * Pushes a value onto the stack without checking the type. - * - * @param x the instruction to push onto the stack - */ - public void xpush(ValueNode x) { - assert x == null || (x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal); - stack[stackSize++] = x; - } - - /** - * Pushes a value onto the stack and checks that it is an int. - * - * @param x the instruction to push onto the stack - */ - public void ipush(ValueNode x) { - xpush(assertInt(x)); - } - - /** - * Pushes a value onto the stack and checks that it is a float. - * - * @param x the instruction to push onto the stack - */ - public void fpush(ValueNode x) { - xpush(assertFloat(x)); - } - - /** - * Pushes a value onto the stack and checks that it is an object. - * - * @param x the instruction to push onto the stack - */ - public void apush(ValueNode x) { - xpush(assertObject(x)); - } - - /** - * Pushes a value onto the stack and checks that it is a long. - * - * @param x the instruction to push onto the stack - */ - public void lpush(ValueNode x) { - xpush(assertLong(x)); - xpush(null); - } - - /** - * Pushes a value onto the stack and checks that it is a double. - * - * @param x the instruction to push onto the stack - */ - public void dpush(ValueNode x) { - xpush(assertDouble(x)); - xpush(null); - } - - public void pushReturn(Kind kind, ValueNode x) { - if (kind != Kind.Void) { - push(kind.getStackKind(), x); - } - } - - /** - * Pops an instruction off the stack with the expected type. - * - * @param kind the expected type - * @return the instruction on the top of the stack - */ - public ValueNode pop(Kind kind) { - assert kind != Kind.Void; - if (isTwoSlot(kind)) { - xpop(); - } - return assertKind(kind, xpop()); - } - - /** - * Pops a value off of the stack without checking the type. - * - * @return x the instruction popped off the stack - */ - public ValueNode xpop() { - ValueNode result = stack[--stackSize]; - assert result == null || !result.isDeleted(); - return result; - } - - /** - * Pops a value off of the stack and checks that it is an int. - * - * @return x the instruction popped off the stack - */ - public ValueNode ipop() { - return assertInt(xpop()); - } - - /** - * Pops a value off of the stack and checks that it is a float. - * - * @return x the instruction popped off the stack - */ - public ValueNode fpop() { - return assertFloat(xpop()); - } - - /** - * Pops a value off of the stack and checks that it is an object. - * - * @return x the instruction popped off the stack - */ - public ValueNode apop() { - return assertObject(xpop()); - } - - /** - * Pops a value off of the stack and checks that it is a long. - * - * @return x the instruction popped off the stack - */ - public ValueNode lpop() { - assertHigh(xpop()); - return assertLong(xpop()); - } - - /** - * Pops a value off of the stack and checks that it is a double. - * - * @return x the instruction popped off the stack - */ - public ValueNode dpop() { - assertHigh(xpop()); - return assertDouble(xpop()); - } - - /** - * Pop the specified number of slots off of this stack and return them as an array of - * instructions. - * - * @return an array containing the arguments off of the stack - */ - public ValueNode[] popArguments(int slotSize, int argSize) { - int base = stackSize - slotSize; - ValueNode[] r = new ValueNode[argSize]; - int argIndex = 0; - int stackindex = 0; - while (stackindex < slotSize) { - ValueNode element = stack[base + stackindex]; - assert element != null; - r[argIndex++] = element; - stackindex += stackSlots(element.kind()); - } - stackSize = base; - return r; - } - - /** - * Peeks an element from the operand stack. - * - * @param argumentNumber The number of the argument, relative from the top of the stack (0 = - * top). Long and double arguments only count as one argument, i.e., null-slots are - * ignored. - * @return The peeked argument. - */ - public ValueNode peek(int argumentNumber) { - int idx = stackSize() - 1; - for (int i = 0; i < argumentNumber; i++) { - if (stackAt(idx) == null) { - idx--; - assert isTwoSlot(stackAt(idx).kind()); - } - idx--; - } - return stackAt(idx); - } - - /** - * Clears all values on this stack. - */ - public void clearStack() { - stackSize = 0; - } - - 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; - } - - public boolean contains(ValueNode value) { - for (int i = 0; i < localsSize(); i++) { - if (localAt(i) == value) { - return true; - } - } - for (int i = 0; i < stackSize(); i++) { - if (stackAt(i) == value) { - return true; - } - } - assert lockedObjects.length == monitorIds.length; - for (int i = 0; i < lockedObjects.length; i++) { - if (lockedObjects[i] == value || monitorIds[i] == value) { - return true; - } - } - return false; - } -} diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Tue Mar 18 09:56:20 2014 +0000 @@ -313,7 +313,7 @@ if (kind == Kind.Object) { value = frameState.xpop(); // astore and astore_ may be used to store a returnAddress (jsr) - assert value.kind() == Kind.Object || value.kind() == Kind.Int; + assert value.getKind() == Kind.Object || value.getKind() == Kind.Int; } else { value = frameState.pop(kind); } @@ -767,15 +767,15 @@ ValueNode b = mirror ? x : y; CompareNode condition; - assert !a.kind().isNumericFloat(); + assert !a.getKind().isNumericFloat(); if (cond == Condition.EQ || cond == Condition.NE) { - if (a.kind() == Kind.Object) { + if (a.getKind() == Kind.Object) { condition = new ObjectEqualsNode(a, b); } else { condition = new IntegerEqualsNode(a, b); } } else { - assert a.kind() != Kind.Object && !cond.isUnsigned(); + assert a.getKind() != Kind.Object && !cond.isUnsigned(); condition = new IntegerLessThanNode(a, b); } condition = currentGraph.unique(condition); @@ -1696,7 +1696,7 @@ if (Modifier.isSynchronized(method.getModifiers())) { MonitorExitNode monitorExit = genMonitorExit(methodSynchronizedObject, returnValue); if (returnValue != null) { - frameState.push(returnValue.kind(), returnValue); + frameState.push(returnValue.getKind(), returnValue); } monitorExit.setStateAfter(frameState.create(bci)); assert !frameState.rethrowException(); @@ -1857,11 +1857,11 @@ Debug.log(String.format("| state [nr locals = %d, stack depth = %d, method = %s]", frameState.localsSize(), frameState.stackSize(), method)); for (int i = 0; i < frameState.localsSize(); ++i) { ValueNode value = frameState.localAt(i); - Debug.log(String.format("| local[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().getJavaName(), value)); + Debug.log(String.format("| local[%d] = %-8s : %s", i, value == null ? "bogus" : value.getKind().getJavaName(), value)); } for (int i = 0; i < frameState.stackSize(); ++i) { ValueNode value = frameState.stackAt(i); - Debug.log(String.format("| stack[%d] = %-8s : %s", i, value == null ? "bogus" : value.kind().getJavaName(), value)); + Debug.log(String.format("| stack[%d] = %-8s : %s", i, value == null ? "bogus" : value.getKind().getJavaName(), value)); } } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/HIRFrameStateBuilder.java Tue Mar 18 09:56:20 2014 +0000 @@ -49,6 +49,7 @@ private final ValueNode[] stack; private ValueNode[] lockedObjects; private MonitorIdNode[] monitorIds; + private final StructuredGraph graph; /** * @see BytecodeFrame#rethrowException @@ -56,13 +57,16 @@ private boolean rethrowException; public HIRFrameStateBuilder(ResolvedJavaMethod method, StructuredGraph graph, boolean eagerResolve) { - super(method, graph); + super(method); + + assert graph != null; this.locals = new ValueNode[method.getMaxLocals()]; // we always need at least one stack slot (for exceptions) this.stack = new ValueNode[Math.max(1, method.getMaxStackSize())]; this.lockedObjects = EMPTY_ARRAY; this.monitorIds = EMPTY_MONITOR_ARRAY; + this.graph = graph; int javaIndex = 0; int index = 0; @@ -97,6 +101,8 @@ private HIRFrameStateBuilder(HIRFrameStateBuilder other) { super(other); + assert other.graph != null; + graph = other.graph; locals = other.locals.clone(); stack = other.stack.clone(); lockedObjects = other.lockedObjects == EMPTY_ARRAY ? EMPTY_ARRAY : other.lockedObjects.clone(); @@ -150,7 +156,7 @@ for (int i = 0; i < stackSize(); i++) { ValueNode x = stackAt(i); ValueNode y = other.stackAt(i); - if (x != y && (x == null || x.isDeleted() || y == null || y.isDeleted() || x.kind() != y.kind())) { + if (x != y && (x == null || x.isDeleted() || y == null || y.isDeleted() || x.getKind() != y.getKind())) { return false; } } @@ -185,7 +191,7 @@ return null; } else if (block.isPhiAtMerge(currentValue)) { - if (otherValue == null || otherValue.isDeleted() || currentValue.kind() != otherValue.kind()) { + if (otherValue == null || otherValue.isDeleted() || currentValue.getKind() != otherValue.getKind()) { propagateDelete((PhiNode) currentValue); return null; } @@ -194,11 +200,11 @@ } else if (currentValue != otherValue) { assert !(block instanceof LoopBeginNode) : "Phi functions for loop headers are create eagerly for all locals and stack slots"; - if (otherValue == null || otherValue.isDeleted() || currentValue.kind() != otherValue.kind()) { + if (otherValue == null || otherValue.isDeleted() || currentValue.getKind() != otherValue.getKind()) { return null; } - PhiNode phi = graph.addWithoutUnique(new PhiNode(currentValue.kind(), block)); + PhiNode phi = graph.addWithoutUnique(new PhiNode(currentValue.getKind(), block)); for (int i = 0; i < block.phiPredecessorCount(); i++) { phi.addInput(currentValue); } @@ -296,7 +302,7 @@ } assert !block.isPhiAtMerge(value) : "phi function for this block already created"; - PhiNode phi = graph.addWithoutUnique(new PhiNode(value.kind(), block)); + PhiNode phi = graph.addWithoutUnique(new PhiNode(value.getKind(), block)); phi.addInput(value); return phi; } @@ -364,7 +370,7 @@ * @param object the object whose monitor will be locked. */ public void pushLock(ValueNode object, MonitorIdNode monitorId) { - assert object.isAlive() && object.kind() == Kind.Object : "unexpected value: " + object; + assert object.isAlive() && object.getKind() == Kind.Object : "unexpected value: " + object; lockedObjects = Arrays.copyOf(lockedObjects, lockedObjects.length + 1); monitorIds = Arrays.copyOf(monitorIds, monitorIds.length + 1); lockedObjects[lockedObjects.length - 1] = object; @@ -402,22 +408,22 @@ public ValueNode loadLocal(int i) { ValueNode x = locals[i]; assert !x.isDeleted(); - assert !isTwoSlot(x.kind()) || locals[i + 1] == null; - assert i == 0 || locals[i - 1] == null || !isTwoSlot(locals[i - 1].kind()); + assert !isTwoSlot(x.getKind()) || locals[i + 1] == null; + assert i == 0 || locals[i - 1] == null || !isTwoSlot(locals[i - 1].getKind()); return x; } @Override public void storeLocal(int i, ValueNode x) { - assert x == null || x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal : "unexpected value: " + x; + assert x == null || x.isAlive() && x.getKind() != Kind.Void && x.getKind() != Kind.Illegal : "unexpected value: " + x; locals[i] = x; - if (x != null && isTwoSlot(x.kind())) { + if (x != null && isTwoSlot(x.getKind())) { // if this is a double word, then kill i+1 locals[i + 1] = null; } if (x != null && i > 0) { ValueNode p = locals[i - 1]; - if (p != null && isTwoSlot(p.kind())) { + if (p != null && isTwoSlot(p.getKind())) { // if there was a double word at i - 1, then kill it locals[i - 1] = null; } @@ -426,13 +432,13 @@ @Override public void storeStack(int i, ValueNode x) { - assert x == null || x.isAlive() && (stack[i] == null || x.kind() == stack[i].kind()) : "Method does not handle changes from one-slot to two-slot values or non-alive values"; + assert x == null || x.isAlive() && (stack[i] == null || x.getKind() == stack[i].getKind()) : "Method does not handle changes from one-slot to two-slot values or non-alive values"; stack[i] = x; } @Override public void push(Kind kind, ValueNode x) { - assert x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal; + assert x.isAlive() && x.getKind() != Kind.Void && x.getKind() != Kind.Illegal; xpush(assertKind(kind, x)); if (isTwoSlot(kind)) { xpush(null); @@ -441,7 +447,7 @@ @Override public void xpush(ValueNode x) { - assert x == null || (x.isAlive() && x.kind() != Kind.Void && x.kind() != Kind.Illegal); + assert x == null || (x.isAlive() && x.getKind() != Kind.Void && x.getKind() != Kind.Illegal); stack[stackSize++] = x; } @@ -532,7 +538,7 @@ ValueNode element = stack[base + stackindex]; assert element != null; r[argIndex++] = element; - stackindex += stackSlots(element.kind()); + stackindex += stackSlots(element.getKind()); } stackSize = base; return r; @@ -544,22 +550,13 @@ for (int i = 0; i < argumentNumber; i++) { if (stackAt(idx) == null) { idx--; - assert isTwoSlot(stackAt(idx).kind()); + assert isTwoSlot(stackAt(idx).getKind()); } idx--; } return stackAt(idx); } - 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; - } - public boolean contains(ValueNode value) { for (int i = 0; i < localsSize(); i++) { if (localAt(i) == value) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragment.java Tue Mar 18 09:56:20 2014 +0000 @@ -332,7 +332,7 @@ PhiNode phi; switch (vpn.type()) { case Value: - phi = graph.addWithoutUnique(new PhiNode(vpn.kind(), merge)); + phi = graph.addWithoutUnique(new PhiNode(vpn.getKind(), merge)); break; case Guard: phi = graph.addWithoutUnique(new PhiNode(vpn.type(), merge)); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java --- a/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.loop/src/com/oracle/graal/loop/LoopFragmentInside.java Tue Mar 18 09:56:20 2014 +0000 @@ -170,7 +170,7 @@ PhiNode ret; switch (phi.type()) { case Value: - ret = new PhiNode(phi.kind(), merge); + ret = new PhiNode(phi.getKind(), merge); break; case Guard: ret = new PhiNode(PhiType.Guard, merge); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java Tue Mar 18 09:56:20 2014 +0000 @@ -254,12 +254,12 @@ copy.remove(copy.size() - 1); } ValueNode lastSlot = copy.get(copy.size() - 1); - assert lastSlot.kind().getStackKind() == popKind.getStackKind(); + assert lastSlot.getKind().getStackKind() == popKind.getStackKind(); copy.remove(copy.size() - 1); } for (ValueNode node : pushedValues) { copy.add(node); - if (node.kind() == Kind.Long || node.kind() == Kind.Double) { + if (node.getKind() == Kind.Long || node.getKind() == Kind.Double) { copy.add(null); } } @@ -404,7 +404,7 @@ assertTrue(values.size() - localsSize - stackSize == monitorIds.size(), "mismatch in number of locks"); for (ValueNode value : values) { assertTrue(value == null || !value.isDeleted(), "frame state must not contain deleted nodes"); - assertTrue(value == null || value instanceof VirtualObjectNode || (value.kind() != Kind.Void), "unexpected value: %s", value); + assertTrue(value == null || value instanceof VirtualObjectNode || (value.getKind() != Kind.Void), "unexpected value: %s", value); } return super.verify(); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardedValueNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -54,7 +54,7 @@ @Override public void generate(LIRGeneratorTool generator) { - if (object.kind() != Kind.Void && object.kind() != Kind.Illegal) { + if (object.getKind() != Kind.Void && object.getKind() != Kind.Illegal) { generator.setResult(this, generator.operand(object)); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -99,7 +99,7 @@ @Override public Node canonical(CanonicalizerTool tool) { - if (stamp() == StampFactory.illegal(object.kind())) { + if (stamp() == StampFactory.illegal(object.getKind())) { // The guard always fails return graph().add(new DeoptimizeNode(action, reason)); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/IfNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -356,10 +356,10 @@ boolean inverted = trueEnd == merge.forwardEndAt(1); ValueNode trueValue = singlePhi.valueAt(inverted ? 1 : 0); ValueNode falseValue = singlePhi.valueAt(inverted ? 0 : 1); - if (trueValue.kind() != falseValue.kind()) { + if (trueValue.getKind() != falseValue.getKind()) { return false; } - if (trueValue.kind() != Kind.Int && trueValue.kind() != Kind.Long) { + if (trueValue.getKind() != Kind.Int && trueValue.getKind() != Kind.Long) { return false; } ConditionalNode conditional = canonicalizeConditionalCascade(trueValue, falseValue); @@ -379,10 +379,10 @@ ValueNode falseValue = falseEnd.result(); ConditionalNode conditional = null; if (trueValue != null) { - if (trueValue.kind() != falseValue.kind()) { + if (trueValue.getKind() != falseValue.getKind()) { return false; } - if (trueValue.kind() != Kind.Int && trueValue.kind() != Kind.Long) { + if (trueValue.getKind() != Kind.Int && trueValue.getKind() != Kind.Long) { return false; } conditional = canonicalizeConditionalCascade(trueValue, falseValue); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -138,14 +138,14 @@ if (stateAfter == null) { return null; } - FrameState stateDuring = stateAfter.duplicateModified(bci(), stateAfter.rethrowException(), kind()); + FrameState stateDuring = stateAfter.duplicateModified(bci(), stateAfter.rethrowException(), getKind()); stateDuring.setDuringCall(true); return stateDuring; } @Override public void intrinsify(Node node) { - assert !(node instanceof ValueNode) || (((ValueNode) node).kind() == Kind.Void) == (kind() == Kind.Void); + assert !(node instanceof ValueNode) || (((ValueNode) node).getKind() == Kind.Void) == (getKind() == Kind.Void); CallTargetNode call = callTarget; FrameState stateAfter = stateAfter(); if (node instanceof StateSplit) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/InvokeWithExceptionNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -157,7 +157,7 @@ public FrameState stateDuring() { FrameState tempStateAfter = stateAfter(); - FrameState stateDuring = tempStateAfter.duplicateModified(bci(), tempStateAfter.rethrowException(), kind()); + FrameState stateDuring = tempStateAfter.duplicateModified(bci(), tempStateAfter.rethrowException(), getKind()); stateDuring.setDuringCall(true); return stateDuring; } @@ -177,7 +177,7 @@ @Override public void intrinsify(Node node) { - assert !(node instanceof ValueNode) || (((ValueNode) node).kind() == Kind.Void) == (kind() == Kind.Void); + assert !(node instanceof ValueNode) || (((ValueNode) node).getKind() == Kind.Void) == (getKind() == Kind.Void); CallTargetNode call = callTarget; FrameState state = stateAfter(); killExceptionEdge(); @@ -186,7 +186,7 @@ stateSplit.setStateAfter(state); } if (node == null) { - assert kind() == Kind.Void && usages().isEmpty(); + assert getKind() == Kind.Void && usages().isEmpty(); graph().removeSplit(this, next()); } else if (node instanceof ControlSinkNode) { this.replaceAtPredecessor(node); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -186,7 +186,7 @@ public void addInput(ValueNode x) { assert !(x instanceof PhiNode) || ((PhiNode) x).merge() instanceof LoopBeginNode || ((PhiNode) x).merge() != this.merge(); - assert x.kind() == kind() || type != PhiType.Value; + assert x.getKind() == getKind() || type != PhiType.Value; values.add(x); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PiNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -63,7 +63,7 @@ @Override public void generate(LIRGeneratorTool generator) { - if (object.kind() != Kind.Void && object.kind() != Kind.Illegal) { + if (object.getKind() != Kind.Void && object.getKind() != Kind.Illegal) { generator.setResult(this, generator.operand(object)); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -39,7 +39,7 @@ public UnwindNode(ValueNode exception) { super(StampFactory.forVoid()); - assert exception == null || exception.kind() == Kind.Object; + assert exception == null || exception.getKind() == Kind.Object; this.exception = exception; } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -79,7 +79,7 @@ return false; } - public final Kind kind() { + public final Kind getKind() { return stamp().getStackKind(); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNodeUtil.java Tue Mar 18 09:56:20 2014 +0000 @@ -32,7 +32,7 @@ public class ValueNodeUtil { public static ValueNode assertKind(Kind kind, ValueNode x) { - assert x != null && x.kind() == kind : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.kind()); + assert x != null && x.getKind() == kind : "kind=" + kind + ", value=" + x + ((x == null) ? "" : ", value.kind=" + x.getKind()); return x; } @@ -45,27 +45,27 @@ } public static ValueNode assertLong(ValueNode x) { - assert x != null && (x.kind() == Kind.Long); + assert x != null && (x.getKind() == Kind.Long); return x; } public static ValueNode assertInt(ValueNode x) { - assert x != null && (x.kind() == Kind.Int); + assert x != null && (x.getKind() == Kind.Int); return x; } public static ValueNode assertFloat(ValueNode x) { - assert x != null && (x.kind() == Kind.Float); + assert x != null && (x.getKind() == Kind.Float); return x; } public static ValueNode assertObject(ValueNode x) { - assert x != null && (x.kind() == Kind.Object); + assert x != null && (x.getKind() == Kind.Object); return x; } public static ValueNode assertDouble(ValueNode x) { - assert x != null && (x.kind() == Kind.Double); + assert x != null && (x.getKind() == Kind.Double); return x; } @@ -94,7 +94,7 @@ * @return the instruction representation as a string */ public static String valueString(ValueNode value) { - return (value == null) ? "-" : ("" + value.kind().getTypeChar() + value.toString(Verbosity.Id)); + return (value == null) ? "-" : ("" + value.getKind().getTypeChar() + value.toString(Verbosity.Id)); } public static ValueNode asNode(MemoryNode node) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -54,7 +54,7 @@ * @param y the instruction that produces the second input to this instruction */ public CompareNode(ValueNode x, ValueNode y) { - assert x != null && y != null && x.kind() == y.kind(); + assert x != null && y != null && x.getKind() == y.getKind(); this.x = x; this.y = y; } @@ -169,24 +169,24 @@ } public static CompareNode createCompareNode(StructuredGraph graph, Condition condition, ValueNode x, ValueNode y) { - assert x.kind() == y.kind(); + assert x.getKind() == y.getKind(); assert condition.isCanonical() : "condition is not canonical: " + condition; - assert !x.kind().isNumericFloat(); + assert !x.getKind().isNumericFloat(); CompareNode comparison; if (condition == Condition.EQ) { - if (x.kind() == Kind.Object) { + if (x.getKind() == Kind.Object) { comparison = new ObjectEqualsNode(x, y); } else { - assert x.kind().isNumericInteger(); + assert x.getKind().isNumericInteger(); comparison = new IntegerEqualsNode(x, y); } } else if (condition == Condition.LT) { - assert x.kind().isNumericInteger(); + assert x.getKind().isNumericInteger(); comparison = new IntegerLessThanNode(x, y); } else { assert condition == Condition.BT; - assert x.kind().isNumericInteger(); + assert x.getKind().isNumericInteger(); comparison = new IntegerBelowThanNode(x, y); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowThanNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowThanNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerBelowThanNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -39,8 +39,8 @@ */ public IntegerBelowThanNode(ValueNode x, ValueNode y) { super(x, y); - assert !x.kind().isNumericFloat() && x.kind() != Kind.Object; - assert !y.kind().isNumericFloat() && y.kind() != Kind.Object; + assert !x.getKind().isNumericFloat() && x.getKind() != Kind.Object; + assert !y.getKind().isNumericFloat() && y.getKind() != Kind.Object; } @Override diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -38,8 +38,8 @@ */ public IntegerEqualsNode(ValueNode x, ValueNode y) { super(x, y); - assert !x.kind().isNumericFloat() && x.kind() != Kind.Object; - assert !y.kind().isNumericFloat() && y.kind() != Kind.Object; + assert !x.getKind().isNumericFloat() && x.getKind() != Kind.Object; + assert !y.getKind().isNumericFloat() && y.getKind() != Kind.Object; } @Override @@ -58,7 +58,7 @@ ValueNode a = mirrored ? normalizeNode.y() : normalizeNode.x(); ValueNode b = mirrored ? normalizeNode.x() : normalizeNode.y(); - if (normalizeNode.x().kind() == Kind.Double || normalizeNode.x().kind() == Kind.Float) { + if (normalizeNode.x().getKind() == Kind.Double || normalizeNode.x().getKind() == Kind.Float) { return graph().unique(new FloatEqualsNode(a, b)); } else { return graph().unique(new IntegerEqualsNode(a, b)); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -39,8 +39,8 @@ */ public IntegerLessThanNode(ValueNode x, ValueNode y) { super(x, y); - assert !x.kind().isNumericFloat() && x.kind() != Kind.Object; - assert !y.kind().isNumericFloat() && y.kind() != Kind.Object; + assert !x.getKind().isNumericFloat() && x.getKind() != Kind.Object; + assert !y.getKind().isNumericFloat() && y.getKind() != Kind.Object; } @Override @@ -60,7 +60,7 @@ ValueNode a = mirrored ? normalizeNode.y() : normalizeNode.x(); ValueNode b = mirrored ? normalizeNode.x() : normalizeNode.y(); - if (normalizeNode.x().kind() == Kind.Double || normalizeNode.x().kind() == Kind.Float) { + if (normalizeNode.x().getKind() == Kind.Double || normalizeNode.x().getKind() == Kind.Float) { return graph().unique(new FloatLessThanNode(a, b, mirrored ^ normalizeNode.isUnorderedLess)); } else { return graph().unique(new IntegerLessThanNode(a, b)); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/LeftShiftNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -44,10 +44,10 @@ @Override public Constant evalConst(Constant... inputs) { assert inputs.length == 2; - if (kind() == Kind.Int) { + if (getKind() == Kind.Int) { return Constant.forInt(inputs[0].asInt() << inputs[1].asInt()); } else { - assert kind() == Kind.Long; + assert getKind() == Kind.Long; return Constant.forLong(inputs[0].asLong() << inputs[1].asLong()); } } @@ -60,10 +60,10 @@ int amount = y().asConstant().asInt(); int originalAmout = amount; int mask; - if (kind() == Kind.Int) { + if (getKind() == Kind.Int) { mask = 0x1f; } else { - assert kind() == Kind.Long; + assert getKind() == Kind.Long; mask = 0x3f; } amount &= mask; @@ -77,14 +77,14 @@ if (other instanceof LeftShiftNode) { int total = amount + otherAmount; if (total != (total & mask)) { - return ConstantNode.forIntegerKind(kind(), 0, graph()); + return ConstantNode.forIntegerKind(getKind(), 0, graph()); } return graph().unique(new LeftShiftNode(stamp(), other.x(), ConstantNode.forInt(total, graph()))); } else if ((other instanceof RightShiftNode || other instanceof UnsignedRightShiftNode) && otherAmount == amount) { - if (kind() == Kind.Long) { + if (getKind() == Kind.Long) { return graph().unique(new AndNode(stamp(), other.x(), ConstantNode.forLong(-1L << amount, graph()))); } else { - assert kind() == Kind.Int; + assert getKind() == Kind.Int; return graph().unique(new AndNode(stamp(), other.x(), ConstantNode.forInt(-1 << amount, graph()))); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -40,8 +40,8 @@ */ public ObjectEqualsNode(ValueNode x, ValueNode y) { super(x, y); - assert x.kind() == Kind.Object; - assert y.kind() == Kind.Object; + assert x.getKind() == Kind.Object; + assert y.getKind() == Kind.Object; } @Override diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/RightShiftNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -39,10 +39,10 @@ @Override public Constant evalConst(Constant... inputs) { assert inputs.length == 2; - if (kind() == Kind.Int) { + if (getKind() == Kind.Int) { return Constant.forInt(inputs[0].asInt() >> inputs[1].asInt()); } else { - assert kind() == Kind.Long; + assert getKind() == Kind.Long; return Constant.forLong(inputs[0].asLong() >> inputs[1].asLong()); } } @@ -58,10 +58,10 @@ int amount = y().asConstant().asInt(); int originalAmout = amount; int mask; - if (kind() == Kind.Int) { + if (getKind() == Kind.Int) { mask = 0x1f; } else { - assert kind() == Kind.Long; + assert getKind() == Kind.Long; mask = 0x3f; } amount &= mask; @@ -79,10 +79,10 @@ IntegerStamp istamp = (IntegerStamp) other.x().stamp(); if (istamp.isPositive()) { - return ConstantNode.forIntegerKind(kind(), 0, graph()); + return ConstantNode.forIntegerKind(getKind(), 0, graph()); } if (istamp.isStrictlyNegative()) { - return ConstantNode.forIntegerKind(kind(), -1L, graph()); + return ConstantNode.forIntegerKind(getKind(), -1L, graph()); } /* diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/UnsignedRightShiftNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -44,10 +44,10 @@ @Override public Constant evalConst(Constant... inputs) { assert inputs.length == 2; - if (kind() == Kind.Int) { + if (getKind() == Kind.Int) { return Constant.forInt(inputs[0].asInt() >>> inputs[1].asInt()); } else { - assert kind() == Kind.Long; + assert getKind() == Kind.Long; return Constant.forLong(inputs[0].asLong() >>> inputs[1].asLong()); } } @@ -60,10 +60,10 @@ int amount = y().asConstant().asInt(); int originalAmout = amount; int mask; - if (kind() == Kind.Int) { + if (getKind() == Kind.Int) { mask = 0x1f; } else { - assert kind() == Kind.Long; + assert getKind() == Kind.Long; mask = 0x3f; } amount &= mask; @@ -77,14 +77,14 @@ if (other instanceof UnsignedRightShiftNode) { int total = amount + otherAmount; if (total != (total & mask)) { - return ConstantNode.forIntegerKind(kind(), 0, graph()); + return ConstantNode.forIntegerKind(getKind(), 0, graph()); } return graph().unique(new UnsignedRightShiftNode(stamp(), other.x(), ConstantNode.forInt(total, graph()))); } else if (other instanceof LeftShiftNode && otherAmount == amount) { - if (kind() == Kind.Long) { + if (getKind() == Kind.Long) { return graph().unique(new AndNode(stamp(), other.x(), ConstantNode.forLong(-1L >>> amount, graph()))); } else { - assert kind() == Kind.Int; + assert getKind() == Kind.Int; return graph().unique(new AndNode(stamp(), other.x(), ConstantNode.forInt(-1 >>> amount, graph()))); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ForeignCallNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -107,7 +107,7 @@ } else if (stateAfter() != null && canDeoptimize()) { FrameState stateDuring = stateAfter(); if ((stateDuring.stackSize() > 0 && stateDuring.stackAt(stateDuring.stackSize() - 1) == this) || (stateDuring.stackSize() > 1 && stateDuring.stackAt(stateDuring.stackSize() - 2) == this)) { - stateDuring = stateDuring.duplicateModified(stateDuring.bci, stateDuring.rethrowException(), this.kind()); + stateDuring = stateDuring.duplicateModified(stateDuring.bci, stateDuring.rethrowException(), this.getKind()); } setDeoptimizationState(stateDuring); return stateDuring; diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -80,7 +80,7 @@ location instanceof ConstantLocationNode) { long displacement = ((ConstantLocationNode) location).getDisplacement(); Kind kind = location.getValueKind(); - if (object.kind() == Kind.Object) { + if (object.getKind() == Kind.Object) { Object base = object.asConstant().asObject(); if (base != null) { Constant constant = tool.getConstantReflection().readUnsafeConstant(kind, base, displacement, compressible); @@ -88,7 +88,7 @@ return ConstantNode.forConstant(constant, metaAccess, read.graph()); } } - } else if (object.kind().isNumericInteger()) { + } else if (object.getKind().isNumericInteger()) { long base = object.asConstant().asLong(); if (base != 0L) { Constant constant = tool.getConstantReflection().readUnsafeConstant(kind, null, base + displacement, compressible); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/SwitchNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -47,7 +47,7 @@ */ public SwitchNode(ValueNode value, AbstractBeginNode[] successors, int[] keySuccessors, double[] keyProbabilities) { super(StampFactory.forVoid()); - assert value.kind() == Kind.Int || value.kind() == Kind.Long || value.kind() == Kind.Object : value.kind() + " key not supported by SwitchNode"; + assert value.getKind() == Kind.Int || value.getKind() == Kind.Long || value.getKind() == Kind.Object : value.getKind() + " key not supported by SwitchNode"; assert keySuccessors.length == keyProbabilities.length; this.successors = new NodeSuccessorList<>(this, successors); this.value = value; @@ -67,7 +67,7 @@ } protected boolean assertValues() { - Kind kind = value.kind(); + Kind kind = value.getKind(); for (int i = 0; i < keyCount(); i++) { Constant key = keyAt(i); assert key.getKind() == kind; diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -60,7 +60,7 @@ @Override public Node canonical(CanonicalizerTool tool) { - assert kind() == Kind.Object && object.kind() == Kind.Object; + assert getKind() == Kind.Object && object.getKind() == Kind.Object; ObjectStamp my = (ObjectStamp) stamp(); ObjectStamp other = (ObjectStamp) object.stamp(); @@ -95,7 +95,7 @@ @Override public void generate(LIRGeneratorTool generator) { - assert kind() == Kind.Object && object.kind() == Kind.Object; + assert getKind() == Kind.Object && object.getKind() == Kind.Object; /* * The LIR only cares about the kind of an operand, not the actual type of an object. So we * do not have to introduce a new operand. diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -65,7 +65,7 @@ int entryIndex = state.getVirtualObject().entryIndexForOffset(offset); if (entryIndex != -1) { ValueNode entry = state.getEntry(entryIndex); - if (entry.kind() == kind() || state.getVirtualObject().entryKind(entryIndex) == accessKind()) { + if (entry.getKind() == getKind() || state.getVirtualObject().entryKind(entryIndex) == accessKind()) { tool.replaceWith(entry); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -79,7 +79,7 @@ if (entryIndex != -1) { Kind entryKind = state.getVirtualObject().entryKind(entryIndex); ValueNode entry = state.getEntry(entryIndex); - if (entry.kind() == value.kind() || entryKind == accessKind()) { + if (entry.getKind() == value.getKind() || entryKind == accessKind()) { tool.setVirtualEntry(state, entryIndex, value(), true); tool.delete(); } else { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfDynamicNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -46,7 +46,7 @@ public InstanceOfDynamicNode(ValueNode mirror, ValueNode object) { this.mirror = mirror; this.object = object; - assert mirror.kind() == Kind.Object : mirror.kind(); + assert mirror.getKind() == Kind.Object : mirror.getKind(); assert ObjectStamp.isExactType(mirror); assert ObjectStamp.typeOrNull(mirror).getName().equals("Ljava/lang/Class;"); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoweredCompareAndSwapNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -61,7 +61,7 @@ public LoweredCompareAndSwapNode(ValueNode object, LocationNode location, ValueNode expectedValue, ValueNode newValue, BarrierType barrierType, boolean compressible) { super(object, location, StampFactory.forKind(Kind.Boolean.getStackKind()), barrierType, compressible); - assert expectedValue.kind() == newValue.kind(); + assert expectedValue.getKind() == newValue.getKind(); this.expectedValue = expectedValue; this.newValue = newValue; } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -61,7 +61,7 @@ @Override public boolean isSorted() { - Kind kind = value().kind(); + Kind kind = value().getKind(); if (kind.isNumericInteger()) { Constant lastKey = null; for (int i = 0; i < keyCount(); i++) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Tue Mar 18 09:56:20 2014 +0000 @@ -159,7 +159,7 @@ // this piece of code handles phis if (!(merge instanceof LoopBeginNode)) { for (PhiNode phi : merge.phis()) { - if (phi.type() == PhiType.Value && phi.kind() == Kind.Object) { + if (phi.type() == PhiType.Value && phi.getKind() == Kind.Object) { ValueNode firstValue = phi.valueAt(0); ResolvedJavaType type = getNodeType(firstValue); boolean nonNull = knownNonNull.contains(firstValue); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningUtil.java Tue Mar 18 09:56:20 2014 +0000 @@ -482,7 +482,7 @@ private void createGuard(StructuredGraph graph, MetaAccessProvider metaAccess) { ValueNode nonNullReceiver = InliningUtil.nonNullReceiver(invoke); ConstantNode typeHub = ConstantNode.forConstant(type.getEncoding(Representation.ObjectHub), metaAccess, graph); - LoadHubNode receiverHub = graph.unique(new LoadHubNode(nonNullReceiver, typeHub.kind(), null)); + LoadHubNode receiverHub = graph.unique(new LoadHubNode(nonNullReceiver, typeHub.getKind(), null)); CompareNode typeCheck = CompareNode.createCompareNode(graph, Condition.EQ, receiverHub, typeHub); FixedGuardNode guard = graph.add(new FixedGuardNode(typeCheck, DeoptimizationReason.TypeCheckedInliningViolated, DeoptimizationAction.InvalidateReprofile)); @@ -624,8 +624,8 @@ returnMerge.setStateAfter(invoke.stateAfter()); PhiNode returnValuePhi = null; - if (invoke.asNode().kind() != Kind.Void) { - returnValuePhi = graph.addWithoutUnique(new PhiNode(invoke.asNode().kind(), returnMerge)); + if (invoke.asNode().getKind() != Kind.Void) { + returnValuePhi = graph.addWithoutUnique(new PhiNode(invoke.asNode().getKind(), returnMerge)); } MergeNode exceptionMerge = null; @@ -812,7 +812,7 @@ FixedNode lastSucc = successors[concretes.size()]; for (int i = concretes.size() - 1; i >= 0; --i) { - LoadMethodNode method = graph.add(new LoadMethodNode(concretes.get(i), hub, constantMethods[i].kind())); + LoadMethodNode method = graph.add(new LoadMethodNode(concretes.get(i), hub, constantMethods[i].getKind())); CompareNode methodCheck = CompareNode.createCompareNode(graph, Condition.EQ, method, constantMethods[i]); IfNode ifNode = graph.add(new IfNode(methodCheck, successors[i], lastSucc, probability[i])); method.setNext(ifNode); @@ -910,7 +910,7 @@ result.asNode().replaceFirstInput(result.callTarget(), callTarget); result.setUseForInlining(useForInlining); - Kind kind = invoke.asNode().kind(); + Kind kind = invoke.asNode().getKind(); if (kind != Kind.Void) { FrameState stateAfter = invoke.stateAfter(); stateAfter = stateAfter.duplicate(stateAfter.bci); @@ -1314,7 +1314,7 @@ assert inlineGraph.getGuardsStage().ordinal() >= graph.getGuardsStage().ordinal(); assert !invokeNode.graph().isAfterFloatingReadPhase() : "inline isn't handled correctly after floating reads phase"; - Kind returnKind = invokeNode.kind(); + Kind returnKind = invokeNode.getKind(); FrameState stateAfter = invoke.stateAfter(); assert stateAfter == null || stateAfter.isAlive(); @@ -1431,7 +1431,7 @@ if (frameState.outerFrameState() == null) { assert frameState.bci == FrameState.INVALID_FRAMESTATE_BCI || frameState.method().equals(inlineGraph.method()); if (outerFrameState == null) { - outerFrameState = stateAfter.duplicateModified(invoke.bci(), stateAfter.rethrowException(), invokeNode.kind()); + outerFrameState = stateAfter.duplicateModified(invoke.bci(), stateAfter.rethrowException(), invokeNode.getKind()); outerFrameState.setDuringCall(true); } frameState.setOuterFrameState(outerFrameState); @@ -1486,7 +1486,7 @@ if (returnNode.result() != null) { if (returnValuePhi == null) { - returnValuePhi = merge.graph().addWithoutUnique(new PhiNode(returnNode.result().kind(), merge)); + returnValuePhi = merge.graph().addWithoutUnique(new PhiNode(returnNode.result().getKind(), merge)); } returnValuePhi.addInput(returnNode.result()); } @@ -1515,7 +1515,7 @@ assert !callTarget.isStatic() : callTarget.targetMethod(); StructuredGraph graph = callTarget.graph(); ValueNode firstParam = callTarget.arguments().get(0); - if (firstParam.kind() == Kind.Object && !ObjectStamp.isObjectNonNull(firstParam)) { + if (firstParam.getKind() == Kind.Object && !ObjectStamp.isObjectNonNull(firstParam)) { IsNullNode condition = graph.unique(new IsNullNode(firstParam)); Stamp stamp = firstParam.stamp().join(objectNonNull()); GuardingPiNode nonNullReceiver = graph.add(new GuardingPiNode(firstParam, condition, true, NullCheckException, InvalidateReprofile, stamp)); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ReadEliminationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ReadEliminationPhase.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ReadEliminationPhase.java Tue Mar 18 09:56:20 2014 +0000 @@ -87,7 +87,7 @@ } if (lastLocationAccess instanceof PhiNode) { PhiNode phi = (PhiNode) lastLocationAccess; - PhiNode newPhi = phi.graph().addWithoutUnique(new PhiNode(n.kind(), phi.merge())); + PhiNode newPhi = phi.graph().addWithoutUnique(new PhiNode(n.getKind(), phi.merge())); nodeMap.set(phi, newPhi); for (ValueNode value : phi.values()) { newPhi.addInput(getValue(n, (MemoryNode) value, nodeMap)); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Tue Mar 18 09:56:20 2014 +0000 @@ -486,7 +486,7 @@ // introduce a new phi PhiNode newPhi = bottomPhis.get(node); if (newPhi == null) { - newPhi = graph.addWithoutUnique(new PhiNode(node.kind(), newBottomMerge)); + newPhi = graph.addWithoutUnique(new PhiNode(node.getKind(), newBottomMerge)); bottomPhis.put(node, newPhi); newPhi.addInput(node); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java --- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Tue Mar 18 09:56:20 2014 +0000 @@ -470,10 +470,10 @@ prefix = "B"; } else if (node instanceof ValueNode) { ValueNode value = (ValueNode) node; - if (value.kind() == Kind.Illegal) { + if (value.getKind() == Kind.Illegal) { prefix = "v"; } else { - prefix = String.valueOf(value.kind().getTypeChar()); + prefix = String.valueOf(value.getKind().getTypeChar()); } } else { prefix = "?"; diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements.hsail/src/com/oracle/graal/replacements/hsail/HSAILMathIntrinsicsNode.java --- a/graal/com.oracle.graal.replacements.hsail/src/com/oracle/graal/replacements/hsail/HSAILMathIntrinsicsNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements.hsail/src/com/oracle/graal/replacements/hsail/HSAILMathIntrinsicsNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -77,7 +77,7 @@ * @param op the math operation */ public HSAILMathIntrinsicsNode(ValueNode x, HSAILArithmetic op) { - super(StampFactory.forKind(x.kind())); + super(StampFactory.forKind(x.getKind())); this.param = x; this.operation = op; } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/GraphKit.java Tue Mar 18 09:56:20 2014 +0000 @@ -132,12 +132,12 @@ InvokeNode invoke = append(new InvokeNode(callTarget, bci)); if (frameStateBuilder != null) { - if (invoke.kind() != Kind.Void) { - frameStateBuilder.push(invoke.kind(), invoke); + if (invoke.getKind() != Kind.Void) { + frameStateBuilder.push(invoke.getKind(), invoke); } invoke.setStateAfter(frameStateBuilder.create(0)); - if (invoke.kind() != Kind.Void) { - frameStateBuilder.pop(invoke.kind()); + if (invoke.getKind() != Kind.Void) { + frameStateBuilder.pop(invoke.getKind()); } } return invoke; diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/NodeIntrinsificationPhase.java Tue Mar 18 09:56:20 2014 +0000 @@ -326,7 +326,7 @@ public void cleanUpReturnCheckCast(Node newInstance) { if (newInstance.recordsUsages() && newInstance instanceof ValueNode && - (((ValueNode) newInstance).kind() != Kind.Object || ((ValueNode) newInstance).stamp() == StampFactory.forNodeIntrinsic())) { + (((ValueNode) newInstance).getKind() != Kind.Object || ((ValueNode) newInstance).stamp() == StampFactory.forNodeIntrinsic())) { StructuredGraph graph = (StructuredGraph) newInstance.graph(); for (CheckCastNode checkCastNode : newInstance.usages().filter(CheckCastNode.class).snapshot()) { for (Node checkCastUsage : checkCastNode.usages().snapshot()) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/SnippetTemplate.java Tue Mar 18 09:56:20 2014 +0000 @@ -777,7 +777,7 @@ if (argument instanceof ValueNode) { replacements.put((ParameterNode) parameter, (ValueNode) argument); } else { - Kind kind = ((ParameterNode) parameter).kind(); + Kind kind = ((ParameterNode) parameter).getKind(); assert argument != null || kind == Kind.Object : this + " cannot accept null for non-object parameter named " + args.info.names[i]; Constant constant = forBoxed(argument, kind); replacements.put((ParameterNode) parameter, ConstantNode.forConstant(constant, metaAccess, replaceeGraph)); @@ -804,7 +804,7 @@ if (value instanceof ValueNode) { replacements.put(param, (ValueNode) value); } else { - Constant constant = forBoxed(value, param.kind()); + Constant constant = forBoxed(value, param.getKind()); ConstantNode element = ConstantNode.forConstant(constant, metaAccess, replaceeGraph); replacements.put(param, element); } @@ -1161,10 +1161,10 @@ buf.append(" ").append(name); } else if (value instanceof ParameterNode) { ParameterNode param = (ParameterNode) value; - buf.append(param.kind().getJavaName()).append(' ').append(name); + buf.append(param.getKind().getJavaName()).append(' ').append(name); } else { ParameterNode[] params = (ParameterNode[]) value; - String kind = params.length == 0 ? "?" : params[0].kind().getJavaName(); + String kind = params.length == 0 ? "?" : params[0].getKind().getJavaName(); buf.append(kind).append('[').append(params.length).append("] ").append(name); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/DirectObjectStoreNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -58,8 +58,8 @@ @Override public void lower(LoweringTool tool) { - IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, value.kind(), displacement, offset, graph(), 1); - WriteNode write = graph().add(new WriteNode(object, value, location, BarrierType.NONE, value.kind() == Kind.Object)); + IndexedLocationNode location = IndexedLocationNode.create(locationIdentity, value.getKind(), displacement, offset, graph(), 1); + WriteNode write = graph().add(new WriteNode(object, value, location, BarrierType.NONE, value.getKind() == Kind.Object)); graph().replaceFixedWithFixed(this, write); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/MacroNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -159,7 +159,7 @@ InvokeNode invoke = graph().add(new InvokeNode(callTarget, bci)); if (stateAfter() != null) { invoke.setStateAfter(stateAfter().duplicate()); - if (kind() != Kind.Void) { + if (getKind() != Kind.Void) { invoke.stateAfter().replaceFirstInput(this, invoke); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReadRegisterNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReadRegisterNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReadRegisterNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -76,7 +76,7 @@ @Override public void generate(LIRGenerator generator) { - Value result = register.asValue(kind()); + Value result = register.asValue(getKind()); if (incoming) { generator.emitIncomingValues(new Value[]{result}); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/ReverseBytesNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -37,8 +37,8 @@ @Input private ValueNode value; public ReverseBytesNode(ValueNode value) { - super(StampFactory.forKind(value.kind())); - assert kind().isNumericInteger(); + super(StampFactory.forKind(value.getKind())); + assert getKind().isNumericInteger(); this.value = value; } @@ -46,9 +46,9 @@ public Node canonical(CanonicalizerTool tool) { if (value.isConstant()) { long v = value.asConstant().asLong(); - if (kind().getStackKind() == Kind.Int) { + if (getKind().getStackKind() == Kind.Int) { return ConstantNode.forInt(Integer.reverseBytes((int) v), graph()); - } else if (kind() == Kind.Long) { + } else if (getKind() == Kind.Long) { return ConstantNode.forLong(Long.reverseBytes(v), graph()); } } @@ -67,7 +67,7 @@ @Override public void generate(LIRGenerator gen) { - Variable result = gen.newVariable(value.kind()); + Variable result = gen.newVariable(value.getKind()); gen.emitByteSwap(result, gen.operand(value)); gen.setResult(this, result); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluatorCanonicalizer.java Tue Mar 18 09:56:20 2014 +0000 @@ -49,7 +49,7 @@ if (node instanceof LoadFieldNode) { LoadFieldNode loadFieldNode = (LoadFieldNode) node; if (!loadFieldNode.isStatic() && loadFieldNode.object().isConstant() && !loadFieldNode.object().isNullConstant()) { - if (Modifier.isFinal(loadFieldNode.field().getModifiers()) || (loadFieldNode.kind() == Kind.Object && loadFieldNode.field().getAnnotation(Child.class) != null) || + if (Modifier.isFinal(loadFieldNode.field().getModifiers()) || (loadFieldNode.getKind() == Kind.Object && loadFieldNode.field().getAnnotation(Child.class) != null) || loadFieldNode.field().getAnnotation(CompilerDirectives.CompilationFinal.class) != null) { Constant constant = loadFieldNode.field().readValue(loadFieldNode.object().asConstant()); assert verifyFieldValue(loadFieldNode.field(), constant); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCache.java Tue Mar 18 09:56:20 2014 +0000 @@ -79,7 +79,7 @@ List key = new ArrayList<>(arguments.size() + 1); key.add(method); for (ValueNode v : arguments) { - if (v.kind() == Kind.Object) { + if (v.getKind() == Kind.Object) { key.add(v.stamp()); } } @@ -125,7 +125,7 @@ new GraphBuilderPhase.Instance(phaseContext.getMetaAccess(), config, optimisticOptimizations).apply(graph); for (ParameterNode param : graph.getNodes(ParameterNode.class)) { - if (param.kind() == Kind.Object) { + if (param.getKind() == Kind.Object) { ValueNode actualArgument = arguments.get(param.index()); param.setStamp(param.stamp().join(actualArgument.stamp())); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/nodes/typesystem/CustomizedUnsafeLoadFinalNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -75,7 +75,7 @@ int entryIndex = state.getVirtualObject().entryIndexForOffset(constantOffset); if (entryIndex != -1) { ValueNode entry = state.getEntry(entryIndex); - if (entry.kind() == kind() || state.getVirtualObject().entryKind(entryIndex) == accessKind) { + if (entry.getKind() == getKind() || state.getVirtualObject().entryKind(entryIndex) == accessKind) { tool.replaceWith(entry); } } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PEReadEliminationClosure.java Tue Mar 18 09:56:20 2014 +0000 @@ -162,7 +162,7 @@ } } if (phi) { - PhiNode phiNode = getCachedPhi(entry, value.kind()); + PhiNode phiNode = getCachedPhi(entry, value.getKind()); mergeEffects.addFloatingNode(phiNode, "mergeReadCache"); for (int i = 0; i < states.size(); i++) { afterMergeEffects.addPhiInput(phiNode, states.get(i).getReadCache(key.object, key.identity, PEReadEliminationClosure.this)); @@ -173,7 +173,7 @@ } } for (PhiNode phi : merge.phis()) { - if (phi.kind() == Kind.Object) { + if (phi.getKind() == Kind.Object) { for (Map.Entry entry : states.get(0).readCache.entrySet()) { if (entry.getKey().object == phi.valueAt(0)) { mergeReadCachePhi(phi, entry.getKey().identity, states); @@ -194,7 +194,7 @@ values[i] = value; } - PhiNode phiNode = getCachedPhi(new ReadCacheEntry(identity, phi), values[0].kind()); + PhiNode phiNode = getCachedPhi(new ReadCacheEntry(identity, phi), values[0].getKind()); mergeEffects.addFloatingNode(phiNode, "mergeReadCachePhi"); for (int i = 0; i < values.length; i++) { afterMergeEffects.addPhiInput(phiNode, values[i]); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/PartialEscapeClosure.java Tue Mar 18 09:56:20 2014 +0000 @@ -407,7 +407,7 @@ ValueNode[] entries = objStates[i].getEntries(); int valueIndex = 0; while (valueIndex < values.length) { - Kind otherKind = entries[valueIndex].kind(); + Kind otherKind = entries[valueIndex].getKind(); Kind entryKind = object.entryKind(valueIndex); if (entryKind == Kind.Int && (otherKind == Kind.Long || otherKind == Kind.Double)) { if (twoSlotKinds == null) { @@ -433,7 +433,7 @@ assert valueIndex < object.entryCount() - 1 && object.entryKind(valueIndex) == Kind.Int && object.entryKind(valueIndex + 1) == Kind.Int; for (int i = 0; i < objStates.length; i++) { ValueNode value = objStates[i].getEntry(valueIndex); - Kind valueKind = value.kind(); + Kind valueKind = value.getKind(); if (valueKind != twoSlotKinds[valueIndex]) { ValueNode nextValue = objStates[i].getEntry(valueIndex + 1); if (value.isConstant() && value.asConstant().equals(Constant.INT_0) && nextValue.isConstant() && nextValue.asConstant().equals(Constant.INT_0)) { @@ -458,7 +458,7 @@ for (int i = 1; i < objStates.length; i++) { ValueNode[] fields = objStates[i].getEntries(); if (phis[valueIndex] == null && values[valueIndex] != fields[valueIndex]) { - phis[valueIndex] = new PhiNode(values[valueIndex].kind(), merge); + phis[valueIndex] = new PhiNode(values[valueIndex].getKind(), merge); } } if (twoSlotKinds != null && twoSlotKinds[valueIndex] != null) { diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/ReadEliminationClosure.java Tue Mar 18 09:56:20 2014 +0000 @@ -229,7 +229,7 @@ } } if (phi) { - PhiNode phiNode = getCachedPhi(entry, value.kind()); + PhiNode phiNode = getCachedPhi(entry, value.getKind()); mergeEffects.addFloatingNode(phiNode, "mergeReadCache"); for (int i = 0; i < states.size(); i++) { afterMergeEffects.addPhiInput(phiNode, states.get(i).getCacheEntry(key)); @@ -240,7 +240,7 @@ } } for (PhiNode phi : merge.phis()) { - if (phi.kind() == Kind.Object) { + if (phi.getKind() == Kind.Object) { for (Map.Entry, ValueNode> entry : states.get(0).readCache.entrySet()) { if (entry.getKey().object == phi.valueAt(0)) { mergeReadCachePhi(phi, entry.getKey(), states); @@ -262,7 +262,7 @@ } CacheEntry newIdentifier = identifier.duplicateWithObject(phi); - PhiNode phiNode = getCachedPhi(newIdentifier, values[0].kind()); + PhiNode phiNode = getCachedPhi(newIdentifier, values[0].getKind()); mergeEffects.addFloatingNode(phiNode, "mergeReadCachePhi"); for (int i = 0; i < values.length; i++) { afterMergeEffects.addPhiInput(phiNode, values[i]); diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualizerToolImpl.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualizerToolImpl.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/VirtualizerToolImpl.java Tue Mar 18 09:56:20 2014 +0000 @@ -93,11 +93,11 @@ ObjectState valueState = closure.getObjectState(state, value); if (valueState == null) { newValue = getReplacedValue(value); - assert unsafe || obj.getEntry(index) == null || obj.getEntry(index).kind() == newValue.kind() || (isObjectEntry(obj.getEntry(index)) && isObjectEntry(newValue)); + assert unsafe || obj.getEntry(index) == null || obj.getEntry(index).getKind() == newValue.getKind() || (isObjectEntry(obj.getEntry(index)) && isObjectEntry(newValue)); } else { if (valueState.getState() != EscapeState.Virtual) { newValue = valueState.getMaterializedValue(); - assert newValue.kind() == Kind.Object; + assert newValue.getKind() == Kind.Object; } else { newValue = valueState.getVirtualObject(); } @@ -108,7 +108,7 @@ } private static boolean isObjectEntry(ValueNode value) { - return value.kind() == Kind.Object || value instanceof VirtualObjectNode; + return value.getKind() == Kind.Object || value instanceof VirtualObjectNode; } @Override diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/nodes/WordCastNode.java Tue Mar 18 09:56:20 2014 +0000 @@ -37,12 +37,12 @@ public final class WordCastNode extends FixedWithNextNode implements LIRLowerable, Canonicalizable { public static WordCastNode wordToObject(ValueNode input, Kind wordKind) { - assert input.kind() == wordKind; + assert input.getKind() == wordKind; return new WordCastNode(StampFactory.object(), input); } public static WordCastNode objectToWord(ValueNode input, Kind wordKind) { - assert input.kind() == Kind.Object; + assert input.getKind() == Kind.Object; return new WordCastNode(StampFactory.forKind(wordKind), input); } @@ -68,10 +68,10 @@ @Override public void generate(LIRGeneratorTool generator) { - assert kind() != input.kind(); - assert generator.target().arch.getSizeInBytes(kind()) == generator.target().arch.getSizeInBytes(input.kind()); + assert getKind() != input.getKind(); + assert generator.target().arch.getSizeInBytes(getKind()) == generator.target().arch.getSizeInBytes(input.getKind()); - AllocatableValue result = generator.newVariable(kind()); + AllocatableValue result = generator.newVariable(getKind()); generator.emitMove(result, generator.operand(input)); generator.setResult(this, result); } diff -r c4219e527b83 -r 80147dac0d6e graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Fri Mar 14 17:19:52 2014 +0100 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Tue Mar 18 09:56:20 2014 +0000 @@ -116,7 +116,7 @@ * Remove casts between word types (which by now no longer have kind Object). */ protected void rewriteCheckCast(StructuredGraph graph, CheckCastNode node) { - if (node.kind() == wordKind) { + if (node.getKind() == wordKind) { node.replaceAtUsages(node.object()); graph.removeFixed(node); } @@ -173,7 +173,7 @@ } if (!callTargetNode.isStatic()) { - assert callTargetNode.receiver().kind() == wordKind : "changeToWord() missed the receiver"; + assert callTargetNode.receiver().getKind() == wordKind : "changeToWord() missed the receiver"; targetMethod = wordImplType.resolveMethod(targetMethod); } Operation operation = targetMethod.getAnnotation(Word.Operation.class); @@ -295,16 +295,16 @@ } private static ValueNode convert(StructuredGraph graph, ValueNode value, Kind toKind, boolean unsigned) { - if (value.kind() == toKind) { + if (value.getKind() == toKind) { return value; } if (toKind == Kind.Int) { - assert value.kind() == Kind.Long; + assert value.getKind() == Kind.Long; return graph.unique(new NarrowNode(value, 32)); } else { assert toKind == Kind.Long; - assert value.kind().getStackKind() == Kind.Int; + assert value.getKind().getStackKind() == Kind.Int; if (unsigned) { return graph.unique(new ZeroExtendNode(value, 64)); } else { @@ -328,7 +328,7 @@ } private ValueNode comparisonOp(StructuredGraph graph, Condition condition, ValueNode left, ValueNode right) { - assert left.kind() == wordKind && right.kind() == wordKind; + assert left.getKind() == wordKind && right.getKind() == wordKind; // mirroring gets the condition into canonical form boolean mirror = condition.canonicalMirror();