# HG changeset patch # User Thomas Wuerthinger # Date 1347018053 -7200 # Node ID 92bc58dc5b5e161d108f05cb2c08e2d8f844c76d # Parent 6e66d97a16aeef09b52079e287a57a55c828ccf4 More clean up and documentation in api.code and api.meta. diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java Fri Sep 07 13:40:53 2012 +0200 @@ -128,7 +128,7 @@ } StringBuilder s = new StringBuilder(); - s.append(kind.javaName).append("["); + s.append(getKind().javaName).append("["); String sep = ""; if (isLegal(getBase())) { s.append(getBase()); @@ -151,14 +151,14 @@ public boolean equals(Object obj) { if (obj instanceof Address) { Address addr = (Address) obj; - return kind == addr.kind && getDisplacement() == addr.getDisplacement() && getBase().equals(addr.getBase()) && getScale() == addr.getScale() && getIndex().equals(addr.getIndex()); + return getKind() == addr.getKind() && getDisplacement() == addr.getDisplacement() && getBase().equals(addr.getBase()) && getScale() == addr.getScale() && getIndex().equals(addr.getIndex()); } return false; } @Override public int hashCode() { - return getBase().hashCode() ^ getIndex().hashCode() ^ (getDisplacement() << 4) ^ (getScale().value << 8) ^ (kind.ordinal() << 12); + return getBase().hashCode() ^ getIndex().hashCode() ^ (getDisplacement() << 4) ^ (getScale().value << 8) ^ (getKind().ordinal() << 12); } /** diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Assumptions.java Fri Sep 07 13:40:53 2012 +0200 @@ -34,6 +34,9 @@ private static final long serialVersionUID = 5152062717588239131L; + /** + * Abstract base class for assumptions. + */ public abstract static class Assumption implements Serializable { private static final long serialVersionUID = -1936652569665112915L; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java Fri Sep 07 13:40:53 2012 +0200 @@ -31,6 +31,17 @@ public interface CodeCacheProvider extends MetaAccessProvider { /** + * Adds the given compilation result as an implementation of the given method without making it the default implementation. + * + * @param method a method to which the executable code is begin added + * @param compResult the compilation result to be added + * @param info the object into which details of the installed code will be written. + * Ignored if null, otherwise the info is written to index 0 of this array. + * @return a reference to the compiled and ready-to-run code + */ + InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info); + + /** * Get the size in bytes for locking information on the stack. */ int sizeOfLockData(); @@ -50,8 +61,6 @@ */ RegisterConfig getRegisterConfig(JavaMethod method); - RegisterConfig getGlobalStubRegisterConfig(); - /** * Custom area on the stack of each compiled method that the VM can use for its own purposes. * @return the size of the custom area in bytes @@ -77,17 +86,6 @@ long getMaxCallTargetOffset(RuntimeCall rtcall); /** - * Adds the given compilation result as an implementation of the given method without making it the default implementation. - * - * @param method a method to which the executable code is begin added - * @param compResult the compilation result to be added - * @param info the object into which details of the installed code will be written. - * Ignored if null, otherwise the info is written to index 0 of this array. - * @return a reference to the compiled and ready-to-run code - */ - InstalledCode addMethod(ResolvedJavaMethod method, CompilationResult compResult, CodeInfo[] info); - - /** * Encodes a deoptimization action and a deoptimization reason in an integer value. * @return the encoded value as an integer */ diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationResult.java Fri Sep 07 13:40:53 2012 +0200 @@ -291,6 +291,10 @@ } } + /** + * Represents a mark in the machine code that can be used by the runtime for its own purposes. A mark + * can reference other marks. + */ public static final class Mark extends Site { private static final long serialVersionUID = 3612943150662354844L; public final Object id; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DeoptimizationAction.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DeoptimizationAction.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/DeoptimizationAction.java Fri Sep 07 13:40:53 2012 +0200 @@ -22,11 +22,32 @@ */ package com.oracle.graal.api.code; - +/** + * Specifies the action that should be taken by the runtime in case a certain deoptimization is triggered. + */ public enum DeoptimizationAction { - None, // just interpret, do not invalidate nmethod - RecompileIfTooManyDeopts, // recompile the nmethod; need not invalidate - InvalidateReprofile, // invalidate the nmethod, reset IC, maybe recompile - InvalidateRecompile, // invalidate the nmethod, recompile (probably) - InvalidateStopCompiling; // invalidate the nmethod and do not compile + /** + * Do not invalidate the machine code. + */ + None, + + /** + * Do not invalidate the machine code, but schedule a recompilation if this deoptimization is triggered too often. + */ + RecompileIfTooManyDeopts, + + /** + * Invalidate the machine code and reset the profiling information. + */ + InvalidateReprofile, + + /** + * Invalidate the machine code and immediately schedule a recompilation. + */ + InvalidateRecompile, + + /** + * Invalidate the machine code and stop compiling the outermost method of this compilation. + */ + InvalidateStopCompiling; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/MonitorValue.java Fri Sep 07 13:40:53 2012 +0200 @@ -24,6 +24,9 @@ import com.oracle.graal.api.meta.*; +/** + * Represents lock information in the debug information. + */ public final class MonitorValue extends Value { private static final long serialVersionUID = 8241681800464483691L; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RegisterValue.java Fri Sep 07 13:40:53 2012 +0200 @@ -44,7 +44,7 @@ @Override public int hashCode() { - return (getRegister().number << 4) ^ kind.ordinal(); + return (getRegister().number << 4) ^ getKind().ordinal(); } @Override diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlot.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlot.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/StackSlot.java Fri Sep 07 13:40:53 2012 +0200 @@ -63,7 +63,7 @@ StackSlot[] slots = cache[kind.ordinal()]; if (index < slots.length) { StackSlot slot = slots[index]; - assert slot.kind == kind && slot.offset == offset && slot.addFrameSize == addFrameSize; + assert slot.getKind() == kind && slot.offset == offset && slot.addFrameSize == addFrameSize; return slot; } } @@ -104,7 +104,7 @@ @Override public int hashCode() { - return kind.ordinal() ^ (offset << 4) ^ (addFrameSize ? 15 : 0); + return getKind().ordinal() ^ (offset << 4) ^ (addFrameSize ? 15 : 0); } @Override @@ -114,7 +114,7 @@ } if (o instanceof StackSlot) { StackSlot l = (StackSlot) o; - return l.kind == kind && l.offset == offset && l.addFrameSize == addFrameSize; + return l.getKind() == getKind() && l.offset == offset && l.addFrameSize == addFrameSize; } return false; } @@ -136,7 +136,7 @@ public StackSlot asOutArg() { assert offset >= 0; if (addFrameSize) { - return get(kind, offset, false); + return get(getKind(), offset, false); } return this; } @@ -147,7 +147,7 @@ public StackSlot asInArg() { assert offset >= 0; if (!addFrameSize) { - return get(kind, offset, true); + return get(getKind(), offset, true); } return this; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java Fri Sep 07 13:40:53 2012 +0200 @@ -24,7 +24,10 @@ import com.oracle.graal.api.meta.*; -public class ValueUtil { +/** + * Utility class for working with the {@link Value} class and its subclasses. + */ +public final class ValueUtil { public static boolean isIllegal(Value value) { assert value != null; return value == Value.IllegalValue; @@ -54,7 +57,6 @@ return (Constant) value; } - public static boolean isStackSlot(Value value) { assert value != null; return value instanceof StackSlot; @@ -75,7 +77,6 @@ return (Address) value; } - public static boolean isRegister(Value value) { assert value != null; return value instanceof RegisterValue; @@ -87,31 +88,30 @@ } public static Register asIntReg(Value value) { - assert value.kind == Kind.Int || value.kind == Kind.Jsr; + assert value.getKind() == Kind.Int || value.getKind() == Kind.Jsr; return asRegister(value); } public static Register asLongReg(Value value) { - assert value.kind == Kind.Long : value.kind; + assert value.getKind() == Kind.Long : value.getKind(); return asRegister(value); } public static Register asObjectReg(Value value) { - assert value.kind == Kind.Object; + assert value.getKind() == Kind.Object; return asRegister(value); } public static Register asFloatReg(Value value) { - assert value.kind == Kind.Float; + assert value.getKind() == Kind.Float; return asRegister(value); } public static Register asDoubleReg(Value value) { - assert value.kind == Kind.Double; + assert value.getKind() == Kind.Double; return asRegister(value); } - public static boolean sameRegister(Value v1, Value v2) { return isRegister(v1) && isRegister(v2) && asRegister(v1) == asRegister(v2); } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java Fri Sep 07 13:40:53 2012 +0200 @@ -95,7 +95,7 @@ @Override public int hashCode() { - return kind.ordinal() + type.hashCode(); + return getKind().ordinal() + type.hashCode(); } @Override diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java --- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java Fri Sep 07 13:40:53 2012 +0200 @@ -22,6 +22,9 @@ */ /** * Package that defines the interface between a Java application that wants to install code and the runtime. + * The runtime provides in implementation of the {@link com.oracle.graal.api.code.CodeCacheProvider} interface. + * The method {@link com.oracle.graal.api.code.CodeCacheProvider#addMethod(com.oracle.graal.api.meta.ResolvedJavaMethod, CompilationResult, CodeInfo[])} + * can be used to install code for a given method. */ package com.oracle.graal.api.code; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java Fri Sep 07 13:40:53 2012 +0200 @@ -102,7 +102,7 @@ * @return {@code true} if this constant is a primitive, or an object constant that is not null */ public boolean isNonNull() { - return !kind.isObject() || object != null; + return !getKind().isObject() || object != null; } /** @@ -110,12 +110,12 @@ * @return {@code true} if this constant is the null constant */ public boolean isNull() { - return kind.isObject() && object == null; + return getKind().isObject() && object == null; } @Override public String toString() { - return kind.javaName + "[" + kind.format(boxedValue()) + (kind != Kind.Object ? "|0x" + Long.toHexString(primitive) : "") + "]"; + return getKind().javaName + "[" + getKind().format(boxedValue()) + (getKind() != Kind.Object ? "|0x" + Long.toHexString(primitive) : "") + "]"; } /** @@ -124,17 +124,17 @@ * @return this constant's value as a string */ public String valueString() { - if (kind.isPrimitive()) { + if (getKind().isPrimitive()) { return boxedValue().toString(); - } else if (kind.isObject()) { + } else if (getKind().isObject()) { if (object == null) { return "null"; } else if (object instanceof String) { return "\"" + object + "\""; } else { - return ""; + return ""; } - } else if (kind.isJsr()) { + } else if (getKind().isJsr()) { return "bci:" + boxedValue().toString(); } else { return "???"; @@ -147,7 +147,7 @@ */ public Object boxedValue() { // Checkstyle: stop - switch (kind) { + switch (getKind()) { case Byte: return (byte) asInt(); case Boolean: return asInt() == 0 ? Boolean.FALSE : Boolean.TRUE; case Short: return (short) asInt(); @@ -165,10 +165,10 @@ private boolean valueEqual(Constant other, boolean ignoreKind) { // must have equivalent kinds to be equal - if (!ignoreKind && kind != other.kind) { + if (!ignoreKind && getKind() != other.getKind()) { return false; } - if (kind.isObject()) { + if (getKind().isObject()) { return object == other.object; } return primitive == other.primitive; @@ -179,7 +179,7 @@ * @return the int value of this constant */ public int asInt() { - if (kind.stackKind().isStackInt() || kind.isJsr()) { + if (getKind().stackKind().isStackInt() || getKind().isJsr()) { return (int) primitive; } throw new Error("Constant is not int: " + this); @@ -190,7 +190,7 @@ * @return the boolean value of this constant */ public boolean asBoolean() { - if (kind == Kind.Boolean) { + if (getKind() == Kind.Boolean) { return primitive != 0L; } throw new Error("Constant is not boolean: " + this); @@ -202,7 +202,7 @@ */ public long asLong() { // Checkstyle: stop - switch (kind.stackKind()) { + switch (getKind().stackKind()) { case Jsr: case Int: case Long: return primitive; @@ -218,7 +218,7 @@ * @return the float value of this constant */ public float asFloat() { - if (kind.isFloat()) { + if (getKind().isFloat()) { return Float.intBitsToFloat((int) primitive); } throw new Error("Constant is not float: " + this); @@ -229,10 +229,10 @@ * @return the double value of this constant */ public double asDouble() { - if (kind.isFloat()) { + if (getKind().isFloat()) { return Float.intBitsToFloat((int) primitive); } - if (kind.isDouble()) { + if (getKind().isDouble()) { return Double.longBitsToDouble(primitive); } throw new Error("Constant is not double: " + this); @@ -243,7 +243,7 @@ * @return the object which this constant represents */ public Object asObject() { - if (kind.isObject()) { + if (getKind().isObject()) { return object; } throw new Error("Constant is not object: " + this); @@ -254,7 +254,7 @@ * @return the object which this constant represents */ public int asJsr() { - if (kind.isJsr()) { + if (getKind().isJsr()) { return (int) primitive; } throw new Error("Constant is not jsr: " + this); @@ -264,7 +264,7 @@ * Unchecked access to a primitive value. */ public long asPrimitive() { - if (kind.isObject()) { + if (getKind().isObject()) { throw new Error("Constant is not primitive: " + this); } return primitive; @@ -276,7 +276,7 @@ */ @Override public int hashCode() { - if (kind.isObject()) { + if (getKind().isObject()) { return System.identityHashCode(object); } return (int) primitive; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java Fri Sep 07 13:40:53 2012 +0200 @@ -24,9 +24,19 @@ import java.lang.reflect.*; - +/** + * Interface implemented by the runtime to allow access to its meta data. + * + */ public interface MetaAccessProvider { + /** + * Returns the resolved Java type representing a given Java class. + * + * @param clazz the Java class object + * @return the resolved Java type object + */ + ResolvedJavaType getResolvedJavaType(Class< ? > clazz); /** * Returns the JavaType object representing the base type for the given kind. @@ -40,16 +50,9 @@ */ ResolvedJavaType getTypeOf(Constant constant); - /** - * Returns the resolved Java type representing a given Java class. - * @param clazz the Java class object - * @return the resolved Java type object - */ - ResolvedJavaType getResolvedJavaType(Class clazz); - - /** - * Used by the canonicalizer to compare objects, since a given runtime might not want to expose the real objects to the compiler. + * Used by the canonicalizer to compare objects, since a given runtime might not want to expose the real objects to + * the compiler. * * @return true if the two parameters represent the same runtime object, false otherwise */ diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/UnresolvedField.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/UnresolvedField.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/UnresolvedField.java Fri Sep 07 13:40:53 2012 +0200 @@ -28,9 +28,9 @@ */ public class UnresolvedField implements JavaField { - public final String name; - public final JavaType holder; - public final JavaType type; + private final String name; + private final JavaType holder; + private final JavaType type; public UnresolvedField(JavaType holder, String name, JavaType type) { this.name = name; @@ -54,16 +54,6 @@ return holder; } - @Override - public int hashCode() { - return System.identityHashCode(this); - } - - @Override - public boolean equals(Object o) { - return o == this; - } - /** * Converts this compiler interface field to a string. */ diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/UnresolvedMethod.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/UnresolvedMethod.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/UnresolvedMethod.java Fri Sep 07 13:40:53 2012 +0200 @@ -28,9 +28,9 @@ */ public class UnresolvedMethod implements JavaMethod { - public final String name; - public final JavaType holder; - public final Signature signature; + private final String name; + private final JavaType holder; + private final Signature signature; public UnresolvedMethod(JavaType holder, String name, Signature signature) { this.name = name; @@ -51,16 +51,6 @@ } @Override - public int hashCode() { - return System.identityHashCode(this); - } - - @Override - public boolean equals(Object o) { - return o == this; - } - - @Override public String toString() { return MetaUtil.format("%H.%n(%p) [unresolved]", this); } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java Fri Sep 07 13:40:53 2012 +0200 @@ -41,7 +41,7 @@ /** * The kind of this value. */ - public final Kind kind; + private final Kind kind; /** * Initializes a new value of the specified kind. @@ -55,6 +55,14 @@ * String representation of the kind, which should be the end of all {@link #toString()} implementation of subclasses. */ protected final String kindSuffix() { - return "|" + kind.typeChar; + return "|" + getKind().typeChar; + } + + /** + * Gets the kind of the value. + * @return the kind + */ + public final Kind getKind() { + return kind; } } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java Fri Sep 07 13:40:53 2012 +0200 @@ -20,7 +20,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + /** - * Package that defines the interface between a runtime and a Java application that wants to access meta information. + * Package that defines the interface between a runtime and a Java application that wants to access meta information. The runtime + * provides an implementation of the {@link com.oracle.graal.api.meta.MetaAccessProvider} interface. The method + * {@link com.oracle.graal.api.meta.MetaAccessProvider#getResolvedJavaType(Class)} allows to get access to the + * {@link com.oracle.graal.api.meta.ResolvedJavaType} corresponding to a given {@link java.lang.Class}. */ package com.oracle.graal.api.meta; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java Fri Sep 07 13:40:53 2012 +0200 @@ -490,15 +490,15 @@ void assignLocation(Value newLocation) { if (isRegister(newLocation)) { assert this.location == null : "cannot re-assign location for " + this; - if (newLocation.kind == Kind.Illegal && kind != Kind.Illegal) { + if (newLocation.getKind() == Kind.Illegal && kind != Kind.Illegal) { this.location = asRegister(newLocation).asValue(kind); return; } } else { assert this.location == null || isRegister(this.location) : "cannot re-assign location for " + this; assert isStackSlot(newLocation); - assert newLocation.kind != Kind.Illegal; - assert newLocation.kind == this.kind; + assert newLocation.getKind() != Kind.Illegal; + assert newLocation.getKind() == this.kind; } this.location = newLocation; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Fri Sep 07 13:40:53 2012 +0200 @@ -1021,7 +1021,7 @@ static RegisterPriority registerPriorityOfOutputOperand(LIRInstruction op) { if (op instanceof MoveOp) { MoveOp move = (MoveOp) op; - if (isStackSlot(move.getInput()) && move.getInput().kind != Kind.Object) { + if (isStackSlot(move.getInput()) && move.getInput().getKind() != Kind.Object) { // method argument (condition must be equal to handleMethodArguments) return RegisterPriority.None; } @@ -1051,7 +1051,7 @@ void handleMethodArguments(LIRInstruction op) { if (op instanceof MoveOp) { MoveOp move = (MoveOp) op; - if (isStackSlot(move.getInput()) && move.getInput().kind != Kind.Object) { + if (isStackSlot(move.getInput()) && move.getInput().getKind() != Kind.Object) { StackSlot slot = (StackSlot) move.getInput(); if (GraalOptions.DetailedAsserts) { assert op.id() > 0 : "invalid id"; @@ -1154,7 +1154,7 @@ @Override public Value doValue(Value operand, OperandMode mode, EnumSet flags) { if (isVariableOrRegister(operand)) { - addDef(operand, opId, registerPriorityOfOutputOperand(op), operand.kind.stackKind()); + addDef(operand, opId, registerPriorityOfOutputOperand(op), operand.getKind().stackKind()); addRegisterHint(op, operand, mode, flags); } return operand; @@ -1164,7 +1164,7 @@ @Override public Value doValue(Value operand, OperandMode mode, EnumSet flags) { if (isVariableOrRegister(operand)) { - addTemp(operand, opId, RegisterPriority.MustHaveRegister, operand.kind.stackKind()); + addTemp(operand, opId, RegisterPriority.MustHaveRegister, operand.getKind().stackKind()); addRegisterHint(op, operand, mode, flags); } return operand; @@ -1175,7 +1175,7 @@ public Value doValue(Value operand, OperandMode mode, EnumSet flags) { if (isVariableOrRegister(operand)) { RegisterPriority p = registerPriorityOfInputOperand(flags); - addUse(operand, blockFrom, opId + 1, p, operand.kind.stackKind()); + addUse(operand, blockFrom, opId + 1, p, operand.getKind().stackKind()); addRegisterHint(op, operand, mode, flags); } return operand; @@ -1186,7 +1186,7 @@ public Value doValue(Value operand, OperandMode mode, EnumSet flags) { if (isVariableOrRegister(operand)) { RegisterPriority p = registerPriorityOfInputOperand(flags); - addUse(operand, blockFrom, opId, p, operand.kind.stackKind()); + addUse(operand, blockFrom, opId, p, operand.getKind().stackKind()); addRegisterHint(op, operand, mode, flags); } return operand; @@ -1200,7 +1200,7 @@ op.forEachState(new ValueProcedure() { @Override public Value doValue(Value operand) { - addUse(operand, blockFrom, opId + 1, RegisterPriority.None, operand.kind.stackKind()); + addUse(operand, blockFrom, opId + 1, RegisterPriority.None, operand.getKind().stackKind()); return operand; } }); diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java Fri Sep 07 13:40:53 2012 +0200 @@ -207,7 +207,7 @@ } private void insertMove(Value fromOpr, Interval toInterval) { - assert fromOpr.kind == toInterval.kind() : "move between different types"; + assert fromOpr.getKind() == toInterval.kind() : "move between different types"; assert insertIdx != -1 : "must setup insert position first"; Value toOpr = toInterval.operand; diff -r 6e66d97a16ae -r 92bc58dc5b5e 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 Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java Fri Sep 07 13:40:53 2012 +0200 @@ -213,12 +213,12 @@ @Override public Value setResult(ValueNode x, Value operand) { - assert (isVariable(operand) && x.kind() == operand.kind) || + assert (isVariable(operand) && x.kind() == operand.getKind()) || (isRegister(operand) && !attributes(asRegister(operand)).isAllocatable()) || - (isConstant(operand) && x.kind() == operand.kind.stackKind()) : operand.kind + " for node " + x; + (isConstant(operand) && x.kind() == operand.getKind().stackKind()) : operand.getKind() + " for node " + x; assert operand(x) == null : "operand cannot be set twice"; assert operand != null && isLegal(operand) : "operand must be legal"; - assert operand.kind.stackKind() == x.kind(); + assert operand.getKind().stackKind() == x.kind(); assert !(x instanceof VirtualObjectNode); nodeOperands.set(x, operand); return operand; @@ -246,7 +246,7 @@ return value; } if (storeKind == Kind.Byte || storeKind == Kind.Boolean) { - Variable tempVar = new Variable(value.kind, lir.nextVariable(), Register.RegisterFlag.Byte); + Variable tempVar = new Variable(value.getKind(), lir.nextVariable(), Register.RegisterFlag.Byte); emitMove(value, tempVar); return tempVar; } @@ -513,7 +513,7 @@ for (LocalNode local : graph.getNodes(LocalNode.class)) { Value param = params[local.index()]; - assert param.kind == local.kind().stackKind(); + assert param.getKind() == local.kind().stackKind(); setResult(local, emitMove(param)); } } @@ -896,12 +896,12 @@ private static Value toStackKind(Value value) { - if (value.kind.stackKind() != value.kind) { + if (value.getKind().stackKind() != value.getKind()) { // We only have stack-kinds in the LIR, so convert the operand kind for values from the calling convention. if (isRegister(value)) { - return asRegister(value).asValue(value.kind.stackKind()); + return asRegister(value).asValue(value.getKind().stackKind()); } else if (isStackSlot(value)) { - return StackSlot.get(value.kind.stackKind(), asStackSlot(value).rawOffset(), asStackSlot(value).rawAddFrameSize()); + return StackSlot.get(value.getKind().stackKind(), asStackSlot(value).rawOffset(), asStackSlot(value).rawAddFrameSize()); } else { throw GraalInternalError.shouldNotReachHere(); } @@ -1012,7 +1012,7 @@ } else { Variable value = load(operand(x.value())); LabelRef defaultTarget = x.defaultSuccessor() == null ? null : getLIRBlock(x.defaultSuccessor()); - if (value.kind == Kind.Object || keyCount < GraalOptions.SequentialSwitchLimit) { + if (value.getKind() == Kind.Object || keyCount < GraalOptions.SequentialSwitchLimit) { // only a few entries emitSequentialSwitch(x, value, defaultTarget); } else { @@ -1166,7 +1166,7 @@ } Variable variable = load(value); if (var.kind == Kind.Byte || var.kind == Kind.Boolean) { - Variable tempVar = new Variable(value.kind, lir.nextVariable(), Register.RegisterFlag.Byte); + Variable tempVar = new Variable(value.getKind(), lir.nextVariable(), Register.RegisterFlag.Byte); emitMove(variable, tempVar); variable = tempVar; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/PhiResolver.java Fri Sep 07 13:40:53 2012 +0200 @@ -225,7 +225,7 @@ private void moveToTemp(Value src) { assert isIllegal(temp); - temp = gen.newVariable(src.kind); + temp = gen.newVariable(src.getKind()); emitMove(src, temp); } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java Fri Sep 07 13:40:53 2012 +0200 @@ -115,7 +115,7 @@ @Override public boolean canStoreConstant(Constant c) { // there is no immediate move of 64-bit constants on Intel - switch (c.kind) { + switch (c.getKind()) { case Long: return Util.isInt(c.asLong()); case Double: return false; case Object: return c.isNull(); @@ -125,7 +125,7 @@ @Override public boolean canInlineConstant(Constant c) { - switch (c.kind) { + switch (c.getKind()) { case Long: return NumUtil.isInt(c.asLong()); case Object: return c.isNull(); default: return true; @@ -142,7 +142,7 @@ if (isConstant(base)) { if (asConstant(base).isNull()) { base = Value.IllegalValue; - } else if (asConstant(base).kind != Kind.Object) { + } else if (asConstant(base).getKind() != Kind.Object) { long newDisplacement = displacement + asConstant(base).asLong(); if (NumUtil.isInt(newDisplacement)) { displacement = (int) newDisplacement; @@ -178,7 +178,7 @@ @Override public Variable emitMove(Value input) { - Variable result = newVariable(input.kind); + Variable result = newVariable(input.getKind()); emitMove(input, result); return result; } @@ -194,14 +194,14 @@ @Override public Variable emitLoad(Value loadAddress, boolean canTrap) { - Variable result = newVariable(loadAddress.kind); + Variable result = newVariable(loadAddress.getKind()); append(new LoadOp(result, loadAddress, canTrap ? state() : null)); return result; } @Override public void emitStore(Value storeAddress, Value inputVal, boolean canTrap) { - Value input = loadForStore(inputVal, storeAddress.kind); + Value input = loadForStore(inputVal, storeAddress.getKind()); append(new StoreOp(storeAddress, input, canTrap ? state() : null)); } @@ -226,13 +226,13 @@ public void emitBranch(Value left, Value right, Condition cond, boolean unorderedIsTrue, LabelRef label, LIRFrameState info) { boolean mirrored = emitCompare(left, right); Condition finalCondition = mirrored ? cond.mirror() : cond; - switch (left.kind.stackKind()) { + switch (left.getKind().stackKind()) { case Int: case Long: case Object: append(new BranchOp(finalCondition, label, info)); break; case Float: case Double: append(new FloatBranchOp(finalCondition, unorderedIsTrue, label, info)); break; - default: throw GraalInternalError.shouldNotReachHere("" + left.kind); + default: throw GraalInternalError.shouldNotReachHere("" + left.getKind()); } } @@ -241,8 +241,8 @@ boolean mirrored = emitCompare(left, right); Condition finalCondition = mirrored ? cond.mirror() : cond; - Variable result = newVariable(trueValue.kind); - switch (left.kind.stackKind()) { + Variable result = newVariable(trueValue.getKind()); + switch (left.getKind().stackKind()) { case Int: case Long: case Object: append(new CondMoveOp(result, finalCondition, load(trueValue), loadNonConst(falseValue))); break; @@ -273,7 +273,7 @@ right = loadNonConst(b); mirrored = false; } - switch (left.kind.stackKind()) { + switch (left.getKind().stackKind()) { case Jsr: case Int: append(new CompareOp(ICMP, left, right)); break; case Long: append(new CompareOp(LCMP, left, right)); break; @@ -287,8 +287,8 @@ @Override public Variable emitNegate(Value input) { - Variable result = newVariable(input.kind); - switch (input.kind) { + Variable result = newVariable(input.getKind()); + switch (input.getKind()) { case Int: append(new Op1Stack(INEG, result, input)); break; case Long: append(new Op1Stack(LNEG, result, input)); break; case Float: append(new Op2Reg(FXOR, result, input, Constant.forFloat(Float.intBitsToFloat(0x80000000)))); break; @@ -300,8 +300,8 @@ @Override public Variable emitAdd(Value a, Value b) { - Variable result = newVariable(a.kind); - switch(a.kind) { + Variable result = newVariable(a.getKind()); + switch(a.getKind()) { case Int: append(new Op2Stack(IADD, result, a, loadNonConst(b))); break; case Long: append(new Op2Stack(LADD, result, a, loadNonConst(b))); break; case Float: append(new Op2Stack(FADD, result, a, loadNonConst(b))); break; @@ -313,8 +313,8 @@ @Override public Variable emitSub(Value a, Value b) { - Variable result = newVariable(a.kind); - switch(a.kind) { + Variable result = newVariable(a.getKind()); + switch(a.getKind()) { case Int: append(new Op2Stack(ISUB, result, a, loadNonConst(b))); break; case Long: append(new Op2Stack(LSUB, result, a, loadNonConst(b))); break; case Float: append(new Op2Stack(FSUB, result, a, loadNonConst(b))); break; @@ -326,8 +326,8 @@ @Override public Variable emitMul(Value a, Value b) { - Variable result = newVariable(a.kind); - switch(a.kind) { + Variable result = newVariable(a.getKind()); + switch(a.getKind()) { case Int: append(new Op2Reg(IMUL, result, a, loadNonConst(b))); break; case Long: append(new Op2Reg(LMUL, result, a, loadNonConst(b))); break; case Float: append(new Op2Stack(FMUL, result, a, loadNonConst(b))); break; @@ -339,7 +339,7 @@ @Override public Variable emitDiv(Value a, Value b) { - switch(a.kind) { + switch(a.getKind()) { case Int: emitMove(a, RAX_I); append(new DivOp(IDIV, RAX_I, RAX_I, load(b), state())); @@ -349,12 +349,12 @@ append(new DivOp(LDIV, RAX_L, RAX_L, load(b), state())); return emitMove(RAX_L); case Float: { - Variable result = newVariable(a.kind); + Variable result = newVariable(a.getKind()); append(new Op2Stack(FDIV, result, a, loadNonConst(b))); return result; } case Double: { - Variable result = newVariable(a.kind); + Variable result = newVariable(a.getKind()); append(new Op2Stack(DDIV, result, a, loadNonConst(b))); return result; } @@ -365,7 +365,7 @@ @Override public Value emitRem(Value a, Value b) { - switch(a.kind) { + switch(a.getKind()) { case Int: emitMove(a, RAX_I); append(new DivOp(IREM, RDX_I, RAX_I, load(b), state())); @@ -385,7 +385,7 @@ @Override public Variable emitUDiv(Value a, Value b) { - switch(a.kind) { + switch(a.getKind()) { case Int: emitMove(a, RAX_I); append(new DivOp(IUDIV, RAX_I, RAX_I, load(b), state())); @@ -401,7 +401,7 @@ @Override public Variable emitURem(Value a, Value b) { - switch(a.kind) { + switch(a.getKind()) { case Int: emitMove(a, RAX_I); append(new DivOp(IUREM, RDX_I, RAX_I, load(b), state())); @@ -418,8 +418,8 @@ @Override public Variable emitAnd(Value a, Value b) { - Variable result = newVariable(a.kind); - switch(a.kind) { + Variable result = newVariable(a.getKind()); + switch(a.getKind()) { case Int: append(new Op2Stack(IAND, result, a, loadNonConst(b))); break; case Long: append(new Op2Stack(LAND, result, a, loadNonConst(b))); break; default: throw GraalInternalError.shouldNotReachHere(); @@ -429,8 +429,8 @@ @Override public Variable emitOr(Value a, Value b) { - Variable result = newVariable(a.kind); - switch(a.kind) { + Variable result = newVariable(a.getKind()); + switch(a.getKind()) { case Int: append(new Op2Stack(IOR, result, a, loadNonConst(b))); break; case Long: append(new Op2Stack(LOR, result, a, loadNonConst(b))); break; default: throw GraalInternalError.shouldNotReachHere(); @@ -440,8 +440,8 @@ @Override public Variable emitXor(Value a, Value b) { - Variable result = newVariable(a.kind); - switch(a.kind) { + Variable result = newVariable(a.getKind()); + switch(a.getKind()) { case Int: append(new Op2Stack(IXOR, result, a, loadNonConst(b))); break; case Long: append(new Op2Stack(LXOR, result, a, loadNonConst(b))); break; default: throw GraalInternalError.shouldNotReachHere(); @@ -452,8 +452,8 @@ @Override public Variable emitShl(Value a, Value b) { - Variable result = newVariable(a.kind); - switch (a.kind) { + Variable result = newVariable(a.getKind()); + switch (a.getKind()) { case Int: append(new ShiftOp(ISHL, result, a, loadShiftCount(b))); break; case Long: append(new ShiftOp(LSHL, result, a, loadShiftCount(b))); break; default: GraalInternalError.shouldNotReachHere(); @@ -463,8 +463,8 @@ @Override public Variable emitShr(Value a, Value b) { - Variable result = newVariable(a.kind); - switch (a.kind) { + Variable result = newVariable(a.getKind()); + switch (a.getKind()) { case Int: append(new ShiftOp(ISHR, result, a, loadShiftCount(b))); break; case Long: append(new ShiftOp(LSHR, result, a, loadShiftCount(b))); break; default: GraalInternalError.shouldNotReachHere(); @@ -474,8 +474,8 @@ @Override public Variable emitUShr(Value a, Value b) { - Variable result = newVariable(a.kind); - switch (a.kind) { + Variable result = newVariable(a.getKind()); + switch (a.getKind()) { case Int: append(new ShiftOp(IUSHR, result, a, loadShiftCount(b))); break; case Long: append(new ShiftOp(LUSHR, result, a, loadShiftCount(b))); break; default: GraalInternalError.shouldNotReachHere(); @@ -569,10 +569,10 @@ @Override protected void emitSequentialSwitch(Constant[] keyConstants, LabelRef[] keyTargets, LabelRef defaultTarget, Value key) { // Making a copy of the switch value is necessary because jump table destroys the input value - if (key.kind == Kind.Int) { + if (key.getKind() == Kind.Int) { append(new SequentialSwitchOp(keyConstants, keyTargets, defaultTarget, key, Value.IllegalValue)); } else { - assert key.kind == Kind.Object; + assert key.getKind() == Kind.Object; append(new SequentialSwitchOp(keyConstants, keyTargets, defaultTarget, key, newVariable(Kind.Object))); } } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java Fri Sep 07 13:40:53 2012 +0200 @@ -194,7 +194,7 @@ Address src; if (isConstant(index)) { - assert index.kind == Kind.Int; + assert index.getKind() == Kind.Int; Constant constantIndex = (Constant) index; src = new Address(inst.kind, pointer, constantIndex.asInt() * scale.value + displacement); } else { @@ -238,7 +238,7 @@ Address dst; if (isConstant(index)) { - assert index.kind == Kind.Int; + assert index.getKind() == Kind.Int; Constant constantIndex = (Constant) index; dst = new Address(inst.kind, pointer, IllegalValue, scale, constantIndex.asInt() * scale.value + displacement); } else { @@ -315,10 +315,10 @@ case DecAndJumpNotZero: { Label label = labels[((XirLabel) inst.extra).index]; Value value = operands[inst.x().index]; - if (value.kind == Kind.Long) { + if (value.getKind() == Kind.Long) { masm.decq(asRegister(value)); } else { - assert value.kind == Kind.Int; + assert value.getKind() == Kind.Int; masm.decl(asRegister(value)); } masm.jcc(ConditionFlag.notZero, label); @@ -442,7 +442,7 @@ private static void emitXirViaLir(TargetMethodAssembler tasm, AMD64MacroAssembler masm, AMD64Arithmetic intOp, AMD64Arithmetic longOp, AMD64Arithmetic floatOp, AMD64Arithmetic doubleOp, Value left, Value right, Value result) { AMD64Arithmetic code; - switch (result.kind) { + switch (result.getKind()) { case Int: code = intOp; break; case Long: code = longOp; break; case Float: code = floatOp; break; @@ -450,9 +450,9 @@ default: throw GraalInternalError.shouldNotReachHere(); } assert left == result; - if (isRegister(right) && right.kind != result.kind) { + if (isRegister(right) && right.getKind() != result.getKind()) { // XIR is not strongly typed, so we can have a type mismatch that we have to fix here. - AMD64Arithmetic.emit(tasm, masm, code, result, asRegister(right).asValue(result.kind), null); + AMD64Arithmetic.emit(tasm, masm, code, result, asRegister(right).asValue(result.getKind()), null); } else { AMD64Arithmetic.emit(tasm, masm, code, result, right, null); } @@ -462,7 +462,7 @@ Value x = ops[inst.x().index]; Value y = ops[inst.y().index]; AMD64Compare code; - switch (x.kind) { + switch (x.getKind()) { case Int: code = AMD64Compare.ICMP; break; case Long: code = AMD64Compare.LCMP; break; case Object: code = AMD64Compare.ACMP; break; @@ -475,8 +475,8 @@ } private static Value assureNot64BitConstant(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value value) { - if (isConstant(value) && (value.kind == Kind.Long || value.kind == Kind.Object)) { - RegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(value.kind); + if (isConstant(value) && (value.getKind() == Kind.Long || value.getKind() == Kind.Object)) { + RegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(value.getKind()); AMD64Move.move(tasm, masm, register, value); return register; } @@ -485,7 +485,7 @@ private static RegisterValue assureInRegister(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value pointer) { if (isConstant(pointer)) { - RegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(pointer.kind); + RegisterValue register = tasm.frameMap.registerConfig.getScratchRegister().asValue(pointer.getKind()); AMD64Move.move(tasm, masm, register, pointer); return register; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java --- a/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java Fri Sep 07 13:40:53 2012 +0200 @@ -166,7 +166,7 @@ // is the object a constant of object type? if (obj.getClass() == Constant.class) { Constant constant = (Constant) obj; - if (constant.kind != Kind.Object) { + if (constant.getKind() != Kind.Object) { return obj; } Object contents = constant.asObject(); diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Fri Sep 07 13:40:53 2012 +0200 @@ -554,7 +554,6 @@ return graalRuntime.getCompilerToVM().installMethod(new HotSpotCompilationResult((HotSpotResolvedJavaMethod) method, compResult), false, hsInfo); } - @Override public RegisterConfig getGlobalStubRegisterConfig() { return globalStubRegConfig; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/DirectStoreNode.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/DirectStoreNode.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/DirectStoreNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -58,6 +58,6 @@ @Override public void generate(LIRGeneratorTool gen) { Value v = gen.operand(value); - gen.emitStore(new Address(v.kind, gen.operand(address)), v, false); + gen.emitStore(new Address(v.getKind(), gen.operand(address)), v, false); } } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java --- a/graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.interpreter/src/com/oracle/graal/interpreter/BytecodeInterpreter.java Fri Sep 07 13:40:53 2012 +0200 @@ -1216,7 +1216,7 @@ if (constant instanceof Constant) { Constant c = ((Constant) constant); - switch (c.kind) { + switch (c.getKind()) { case Int: frame.pushInt(c.asInt()); break; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BytecodeDisassembler.java Fri Sep 07 13:40:53 2012 +0200 @@ -109,7 +109,7 @@ String desc = null; if (constant instanceof Constant) { Constant c = ((Constant) constant); - switch (c.kind) { + switch (c.getKind()) { case Int : desc = String.valueOf(c.asInt()); break; diff -r 6e66d97a16ae -r 92bc58dc5b5e 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 Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Fri Sep 07 13:40:53 2012 +0200 @@ -292,7 +292,7 @@ } } else if (con instanceof Constant) { Constant constant = (Constant) con; - frameState.push(constant.kind.stackKind(), appendConstant(constant)); + frameState.push(constant.getKind().stackKind(), appendConstant(constant)); } else { throw new Error("lookupConstant returned an object of incorrect type"); } @@ -827,7 +827,7 @@ constantValue = ((ResolvedJavaField) field).constantValue(null); } if (constantValue != null) { - frameState.push(constantValue.kind.stackKind(), appendConstant(constantValue)); + frameState.push(constantValue.getKind().stackKind(), appendConstant(constantValue)); } else { ValueNode container = genTypeOrDeopt(JavaType.Representation.StaticFields, holder, isInitialized); Kind kind = field.kind(); diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java Fri Sep 07 13:40:53 2012 +0200 @@ -190,7 +190,7 @@ assert isConstant(y) || asRegister(y) == AMD64.rcx; assert differentRegisters(result, y) || sameRegister(x, y); verifyKind(opcode, result, x, x); - assert y.kind.stackKind() == Kind.Int; + assert y.getKind().stackKind() == Kind.Int; } } @@ -207,7 +207,7 @@ this.result = result; this.x = x; this.y = y; - this.temp = asRegister(result) == AMD64.rax ? AMD64.rdx.asValue(result.kind) : AMD64.rax.asValue(result.kind); + this.temp = asRegister(result) == AMD64.rax ? AMD64.rdx.asValue(result.getKind()) : AMD64.rax.asValue(result.getKind()); this.state = state; } @@ -429,7 +429,7 @@ private static void emitConvertFixup(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, Value x) { ConvertSlowPath slowPath = new ConvertSlowPath(result, x); tasm.stubs.add(slowPath); - switch (result.kind) { + switch (result.getKind()) { case Int: masm.cmpl(asIntReg(result), Integer.MIN_VALUE); break; case Long: masm.cmpq(asLongReg(result), tasm.asLongConstRef(Constant.forLong(java.lang.Long.MIN_VALUE))); break; default: throw GraalInternalError.shouldNotReachHere(); @@ -452,7 +452,7 @@ @Override public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) { masm.bind(start); - switch (x.kind) { + switch (x.getKind()) { case Float: masm.ucomiss(asFloatReg(x), tasm.asFloatConstRef(Constant.FLOAT_0)); break; case Double: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(Constant.DOUBLE_0)); break; default: throw GraalInternalError.shouldNotReachHere(); @@ -463,7 +463,7 @@ // input is > 0 -> return maxInt // result register already contains 0x80000000, so subtracting 1 gives 0x7fffffff - switch (result.kind) { + switch (result.getKind()) { case Int: masm.decrementl(asIntReg(result), 1); break; case Long: masm.decrementq(asLongReg(result), 1); break; default: throw GraalInternalError.shouldNotReachHere(); @@ -484,9 +484,9 @@ private static void verifyKind(AMD64Arithmetic opcode, Value result, Value x, Value y) { - assert (opcode.name().startsWith("I") && result.kind == Kind.Int && x.kind.stackKind() == Kind.Int && y.kind.stackKind() == Kind.Int) - || (opcode.name().startsWith("L") && result.kind == Kind.Long && x.kind == Kind.Long && y.kind == Kind.Long) - || (opcode.name().startsWith("F") && result.kind == Kind.Float && x.kind == Kind.Float && y.kind == Kind.Float) - || (opcode.name().startsWith("D") && result.kind == Kind.Double && x.kind == Kind.Double && y.kind == Kind.Double); + assert (opcode.name().startsWith("I") && result.getKind() == Kind.Int && x.getKind().stackKind() == Kind.Int && y.getKind().stackKind() == Kind.Int) + || (opcode.name().startsWith("L") && result.getKind() == Kind.Long && x.getKind() == Kind.Long && y.getKind() == Kind.Long) + || (opcode.name().startsWith("F") && result.getKind() == Kind.Float && x.getKind() == Kind.Float && y.getKind() == Kind.Float) + || (opcode.name().startsWith("D") && result.getKind() == Kind.Double && x.getKind() == Kind.Double && y.getKind() == Kind.Double); } } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java Fri Sep 07 13:40:53 2012 +0200 @@ -52,12 +52,12 @@ @Override protected void verify() { super.verify(); - assert (name().startsWith("I") && x.kind == Kind.Int && y.kind.stackKind() == Kind.Int) - || (name().startsWith("I") && x.kind == Kind.Jsr && y.kind == Kind.Jsr) - || (name().startsWith("L") && x.kind == Kind.Long && y.kind == Kind.Long) - || (name().startsWith("A") && x.kind == Kind.Object && y.kind == Kind.Object) - || (name().startsWith("F") && x.kind == Kind.Float && y.kind == Kind.Float) - || (name().startsWith("D") && x.kind == Kind.Double && y.kind == Kind.Double); + assert (name().startsWith("I") && x.getKind() == Kind.Int && y.getKind().stackKind() == Kind.Int) + || (name().startsWith("I") && x.getKind() == Kind.Jsr && y.getKind() == Kind.Jsr) + || (name().startsWith("L") && x.getKind() == Kind.Long && y.getKind() == Kind.Long) + || (name().startsWith("A") && x.getKind() == Kind.Object && y.getKind() == Kind.Object) + || (name().startsWith("F") && x.getKind() == Kind.Float && y.getKind() == Kind.Float) + || (name().startsWith("D") && x.getKind() == Kind.Double && y.getKind() == Kind.Double); } } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64ControlFlow.java Fri Sep 07 13:40:53 2012 +0200 @@ -151,13 +151,13 @@ @Override public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) { - if (key.kind == Kind.Int) { + if (key.getKind() == Kind.Int) { Register intKey = asIntReg(key); for (int i = 0; i < keyConstants.length; i++) { masm.cmpl(intKey, tasm.asIntConst(keyConstants[i])); masm.jcc(ConditionFlag.equal, keyTargets[i].label()); } - } else if (key.kind == Kind.Object) { + } else if (key.getKind() == Kind.Object) { Register intKey = asObjectReg(key); Register temp = asObjectReg(scratch); for (int i = 0; i < keyConstants.length; i++) { @@ -235,7 +235,7 @@ super.verify(); assert lowKeys.length == keyTargets.length; assert highKeys.length == keyTargets.length; - assert key.kind == Kind.Int; + assert key.getKind() == Kind.Int; } @Override @@ -381,13 +381,13 @@ private static void cmove(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, ConditionFlag cond, Value other) { if (isRegister(other)) { assert asRegister(other) != asRegister(result) : "other already overwritten by previous move"; - switch (other.kind) { + switch (other.getKind()) { case Int: masm.cmovl(cond, asRegister(result), asRegister(other)); break; case Long: masm.cmovq(cond, asRegister(result), asRegister(other)); break; default: throw GraalInternalError.shouldNotReachHere(); } } else { - switch (other.kind) { + switch (other.getKind()) { case Int: masm.cmovl(cond, asRegister(result), tasm.asAddress(other)); break; case Long: masm.cmovq(cond, asRegister(result), tasm.asAddress(other)); break; default: throw GraalInternalError.shouldNotReachHere(); diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java --- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java Fri Sep 07 13:40:53 2012 +0200 @@ -253,19 +253,19 @@ if (input.equals(result)) { return; } - switch (input.kind) { + switch (input.getKind()) { case Jsr: case Int: masm.movl(asRegister(result), asRegister(input)); break; case Long: masm.movq(asRegister(result), asRegister(input)); break; case Float: masm.movflt(asFloatReg(result), asFloatReg(input)); break; case Double: masm.movdbl(asDoubleReg(result), asDoubleReg(input)); break; case Object: masm.movq(asRegister(result), asRegister(input)); break; - default: throw GraalInternalError.shouldNotReachHere("kind=" + result.kind); + default: throw GraalInternalError.shouldNotReachHere("kind=" + result.getKind()); } } private static void reg2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, Value input) { - switch (input.kind) { + switch (input.getKind()) { case Jsr: case Int: masm.movl(tasm.asAddress(result), asRegister(input)); break; case Long: masm.movq(tasm.asAddress(result), asRegister(input)); break; @@ -277,7 +277,7 @@ } private static void stack2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, Value input) { - switch (input.kind) { + switch (input.getKind()) { case Jsr: case Int: masm.movl(asRegister(result), tasm.asAddress(input)); break; case Long: masm.movq(asRegister(result), tasm.asAddress(input)); break; @@ -292,7 +292,7 @@ // Note: we use the kind of the input operand (and not the kind of the result operand) because they don't match // in all cases. For example, an object constant can be loaded to a long register when unsafe casts occurred (e.g., // for a write barrier where arithmetic operations are then performed on the pointer). - switch (input.kind.stackKind()) { + switch (input.getKind().stackKind()) { case Jsr: case Int: // Do not optimize with an XOR as this instruction may be between @@ -341,7 +341,7 @@ } private static void const2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, Value result, Constant input) { - switch (input.kind.stackKind()) { + switch (input.getKind().stackKind()) { case Jsr: case Int: masm.movl(tasm.asAddress(result), input.asInt()); break; case Long: masm.movlong(tasm.asAddress(result), input.asLong()); break; @@ -364,7 +364,7 @@ if (info != null) { tasm.recordImplicitException(masm.codeBuffer.position(), info); } - switch (loadAddr.kind) { + switch (loadAddr.getKind()) { case Boolean: case Byte: masm.movsxb(asRegister(result), loadAddr); break; case Char: masm.movzxl(asRegister(result), loadAddr); break; @@ -384,7 +384,7 @@ } if (isRegister(input)) { - switch (storeAddr.kind) { + switch (storeAddr.getKind()) { case Boolean: case Byte: masm.movb(storeAddr, asRegister(input)); break; case Char: @@ -398,7 +398,7 @@ } } else if (isConstant(input)) { Constant c = (Constant) input; - switch (storeAddr.kind) { + switch (storeAddr.getKind()) { case Boolean: case Byte: masm.movb(storeAddr, c.asInt() & 0xFF); break; case Char: @@ -436,7 +436,7 @@ if (tasm.target.isMP) { masm.lock(); } - switch (cmpValue.kind) { + switch (cmpValue.getKind()) { case Int: masm.cmpxchgl(asRegister(newValue), address); break; case Long: case Object: masm.cmpxchgq(asRegister(newValue), address); break; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java Fri Sep 07 13:40:53 2012 +0200 @@ -324,7 +324,7 @@ * @param frameRefMap A frame reference map, as created by {@link #initFrameRefMap()}. */ public void setReference(Value location, BitSet registerRefMap, BitSet frameRefMap) { - if (location.kind == Kind.Object) { + if (location.getKind() == Kind.Object) { if (isRegister(location)) { registerRefMap.set(asRegister(location).number); } else if (isStackSlot(location)) { @@ -346,7 +346,7 @@ * @param frameRefMap A frame reference map, as created by {@link #initFrameRefMap()}. */ public void clearReference(Value location, BitSet registerRefMap, BitSet frameRefMap) { - if (location.kind == Kind.Object) { + if (location.getKind() == Kind.Object) { if (location instanceof RegisterValue) { registerRefMap.clear(asRegister(location).number); } else if (isStackSlot(location)) { diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/Variable.java Fri Sep 07 13:40:53 2012 +0200 @@ -57,7 +57,7 @@ @Override public int hashCode() { - return (index << 4) | kind.ordinal(); + return (index << 4) | getKind().ordinal(); } @Override diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java Fri Sep 07 13:40:53 2012 +0200 @@ -197,7 +197,7 @@ * including long constants that fit into the 32-bit range. */ public int asIntConst(Value value) { - assert (value.kind.stackKind() == Kind.Int || value.kind == Kind.Jsr || value.kind == Kind.Long) && isConstant(value); + assert (value.getKind().stackKind() == Kind.Int || value.getKind() == Kind.Jsr || value.getKind() == Kind.Long) && isConstant(value); long c = ((Constant) value).asLong(); if (!(NumUtil.isInt(c))) { throw GraalInternalError.shouldNotReachHere(); @@ -213,7 +213,7 @@ } public Address asFloatConstRef(Value value, int alignment) { - assert value.kind == Kind.Float && isConstant(value); + assert value.getKind() == Kind.Float && isConstant(value); return recordDataReferenceInCode((Constant) value, alignment); } @@ -225,7 +225,7 @@ } public Address asDoubleConstRef(Value value, int alignment) { - assert value.kind == Kind.Double && isConstant(value); + assert value.getKind() == Kind.Double && isConstant(value); return recordDataReferenceInCode((Constant) value, alignment); } @@ -233,39 +233,39 @@ * Returns the address of a long constant that is embedded as a data references into the code. */ public Address asLongConstRef(Value value) { - assert value.kind == Kind.Long && isConstant(value); + assert value.getKind() == Kind.Long && isConstant(value); return recordDataReferenceInCode((Constant) value, 8); } public Address asIntAddr(Value value) { - assert value.kind == Kind.Int; + assert value.getKind() == Kind.Int; return asAddress(value); } public Address asLongAddr(Value value) { - assert value.kind == Kind.Long; + assert value.getKind() == Kind.Long; return asAddress(value); } public Address asObjectAddr(Value value) { - assert value.kind == Kind.Object; + assert value.getKind() == Kind.Object; return asAddress(value); } public Address asFloatAddr(Value value) { - assert value.kind == Kind.Float; + assert value.getKind() == Kind.Float; return asAddress(value); } public Address asDoubleAddr(Value value) { - assert value.kind == Kind.Double; + assert value.getKind() == Kind.Double; return asAddress(value); } public Address asAddress(Value value) { if (isStackSlot(value)) { StackSlot slot = (StackSlot) value; - return new Address(slot.kind, frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot)); + return new Address(slot.getKind(), frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot)); } return (Address) value; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -67,7 +67,7 @@ } public static ConstantNode forConstant(Constant constant, MetaAccessProvider runtime, Graph graph) { - if (constant.kind == Kind.Object) { + if (constant.getKind() == Kind.Object) { return graph.unique(new ConstantNode(constant, runtime)); } else { return graph.unique(new ConstantNode(constant)); @@ -223,14 +223,14 @@ @Override public Map getDebugProperties(Map map) { Map properties = super.getDebugProperties(map); - properties.put("rawvalue", value.kind.isObject() ? value.kind.format(value.boxedValue()) : value.boxedValue()); + properties.put("rawvalue", value.getKind().isObject() ? value.getKind().format(value.boxedValue()) : value.boxedValue()); return properties; } @Override public String toString(Verbosity verbosity) { if (verbosity == Verbosity.Name) { - return super.toString(Verbosity.Name) + "(" + value.kind.format(value.boxedValue()) + ")"; + return super.toString(Verbosity.Name) + "(" + value.getKind().format(value.boxedValue()) + ")"; } else { return super.toString(verbosity); } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java Fri Sep 07 13:40:53 2012 +0200 @@ -248,7 +248,7 @@ * {@link Boolean#FALSE} if the comparison is known to be false */ public boolean foldCondition(Constant lt, Constant rt, CodeCacheProvider runtime) { - assert !lt.kind.isFloatOrDouble() && !rt.kind.isFloatOrDouble(); + assert !lt.getKind().isFloatOrDouble() && !rt.getKind().isFloatOrDouble(); return foldCondition(lt, rt, runtime, false); } @@ -262,7 +262,7 @@ * @return true if the comparison is known to be true, false if the comparison is known to be false */ public boolean foldCondition(Constant lt, Constant rt, MetaAccessProvider runtime, boolean unorderedIsTrue) { - switch (lt.kind) { + switch (lt.getKind()) { case Boolean: case Byte: case Char: @@ -341,7 +341,7 @@ default: throw new GraalInternalError("expected condition: %s", this); } } - default: throw new GraalInternalError("expected value kind %s while folding condition: %s", lt.kind, this); + default: throw new GraalInternalError("expected value kind %s while folding condition: %s", lt.getKind(), this); } } diff -r 6e66d97a16ae -r 92bc58dc5b5e 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 Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -54,7 +54,7 @@ @Override protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) { - if (constant.kind == Kind.Int && constant.asInt() == 0) { + if (constant.getKind() == Kind.Int && constant.asInt() == 0) { ValueNode a = mirrored ? normalizeNode.y() : normalizeNode.x(); ValueNode b = mirrored ? normalizeNode.x() : normalizeNode.y(); diff -r 6e66d97a16ae -r 92bc58dc5b5e 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 Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -56,7 +56,7 @@ @Override protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) { assert condition() == Condition.LT; - if (constant.kind == Kind.Int && constant.asInt() == 0) { + if (constant.getKind() == Kind.Int && constant.asInt() == 0) { ValueNode a = mirrored ? normalizeNode.y() : normalizeNode.x(); ValueNode b = mirrored ? normalizeNode.x() : normalizeNode.y(); diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -65,7 +65,7 @@ public ValueNode canonical(CanonicalizerTool tool) { Constant constant = object().asConstant(); if (constant != null) { - assert constant.kind == Kind.Object; + assert constant.getKind() == Kind.Object; return ConstantNode.forBoolean(constant.isNull(), graph()); } if (object.objectStamp().nonNull()) { diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -71,7 +71,7 @@ ArithmeticNode arithmeticNode = (ArithmeticNode) node; if (arithmeticNode.y().isConstant()) { Constant constant = arithmeticNode.y().asConstant(); - assert constant.kind == arithmeticNode.kind() : constant.kind + " != " + arithmeticNode.kind(); + assert constant.getKind() == arithmeticNode.kind() : constant.getKind() + " != " + arithmeticNode.kind(); if (constant.asLong() != 0) { continue; } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -65,7 +65,7 @@ if (objectClass().isConstant()) { Constant constant = objectClass().asConstant(); Constant typeHub = type.getEncoding(Representation.ObjectHub); - assert constant.kind == typeHub.kind; + assert constant.getKind() == typeHub.getKind(); return ConstantNode.forBoolean(tool.runtime().areConstantObjectsEqual(constant, typeHub), graph()); } // TODO(ls) since a ReadHubNode with an exactType should canonicalize itself to a constant this should actually never happen, maybe turn into an assertion? diff -r 6e66d97a16ae -r 92bc58dc5b5e 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 Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/TypeSwitchNode.java Fri Sep 07 13:40:53 2012 +0200 @@ -80,7 +80,7 @@ int survivingEdge = keySuccessorIndex(keyCount()); for (int i = 0; i < keyCount(); i++) { Constant typeHub = keyAt(i); - assert constant.kind == typeHub.kind; + assert constant.getKind() == typeHub.getKind(); if (tool.runtime().areConstantObjectsEqual(value().asConstant(), typeHub)) { survivingEdge = keySuccessorIndex(i); } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java Fri Sep 07 13:40:53 2012 +0200 @@ -117,26 +117,26 @@ } public static Stamp forConstant(Constant value) { - assert value.kind != Kind.Object; - if (value.kind == Kind.Object) { - throw new GraalInternalError("unexpected kind: %s", value.kind); + assert value.getKind() != Kind.Object; + if (value.getKind() == Kind.Object) { + throw new GraalInternalError("unexpected kind: %s", value.getKind()); } else { - if (value.kind == Kind.Int || value.kind == Kind.Long) { - return forInteger(value.kind, value.asLong(), value.asLong(), value.asLong() & IntegerStamp.defaultMask(value.kind)); - } else if (value.kind == Kind.Float || value.kind == Kind.Double) { - return forFloat(value.kind, value.asDouble(), value.asDouble(), !Double.isNaN(value.asDouble())); + if (value.getKind() == Kind.Int || value.getKind() == Kind.Long) { + return forInteger(value.getKind(), value.asLong(), value.asLong(), value.asLong() & IntegerStamp.defaultMask(value.getKind())); + } else if (value.getKind() == Kind.Float || value.getKind() == Kind.Double) { + return forFloat(value.getKind(), value.asDouble(), value.asDouble(), !Double.isNaN(value.asDouble())); } - return forKind(value.kind.stackKind()); + return forKind(value.getKind().stackKind()); } } public static Stamp forConstant(Constant value, MetaAccessProvider runtime) { - assert value.kind == Kind.Object; - if (value.kind == Kind.Object) { + assert value.getKind() == Kind.Object; + if (value.getKind() == Kind.Object) { ResolvedJavaType type = value.isNull() ? null : runtime.getTypeOf(value); return new ObjectStamp(type, value.isNonNull(), value.isNonNull(), value.isNull()); } else { - throw new GraalInternalError(Kind.Object + " expected, actual kind: %s", value.kind); + throw new GraalInternalError(Kind.Object + " expected, actual kind: %s", value.getKind()); } } diff -r 6e66d97a16ae -r 92bc58dc5b5e 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 Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinter.java Fri Sep 07 13:40:53 2012 +0200 @@ -503,10 +503,10 @@ private void printInterval(Interval interval) { out.printf("%s %s ", interval.operand, (isRegister(interval.operand) ? "fixed" : interval.kind().name())); if (isRegister(interval.operand)) { - out.printf("\"[%s|%c]\"", interval.operand, interval.operand.kind.typeChar); + out.printf("\"[%s|%c]\"", interval.operand, interval.operand.getKind().typeChar); } else { if (interval.location() != null) { - out.printf("\"[%s|%c]\"", interval.location(), interval.location().kind.typeChar); + out.printf("\"[%s|%c]\"", interval.location(), interval.location().getKind().typeChar); } } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64ByteSwapOp.java --- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64ByteSwapOp.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/target/amd64/AMD64ByteSwapOp.java Fri Sep 07 13:40:53 2012 +0200 @@ -42,7 +42,7 @@ @Override public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) { AMD64Move.move(tasm, masm, result, input); - switch(input.kind) { + switch(input.getKind()) { case Int: masm.bswapl(ValueUtil.asIntReg(result)); break; diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalCompilerTest.java --- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalCompilerTest.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraalCompilerTest.java Fri Sep 07 13:40:53 2012 +0200 @@ -92,7 +92,7 @@ Assert.assertEquals("unexpected number of ReturnNodes: " + graphString, graph.getNodes(ReturnNode.class).count(), 1); ValueNode result = graph.getNodes(ReturnNode.class).first().result(); Assert.assertTrue("unexpected ReturnNode result node: " + graphString, result.isConstant()); - Assert.assertEquals("unexpected ReturnNode result kind: " + graphString, result.asConstant().kind, Kind.Int); + Assert.assertEquals("unexpected ReturnNode result kind: " + graphString, result.asConstant().getKind(), Kind.Int); Assert.assertEquals("unexpected ReturnNode result: " + graphString, result.asConstant().asInt(), value); } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java --- a/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.max.asm/src/com/oracle/max/asm/target/amd64/AMD64MacroAssembler.java Fri Sep 07 13:40:53 2012 +0200 @@ -305,7 +305,7 @@ * if the address might be a volatile field! */ public void movlong(Address dst, long src) { - Address high = new Address(dst.kind, dst.getBase(), dst.getIndex(), dst.getScale(), dst.getDisplacement() + 4); + Address high = new Address(dst.getKind(), dst.getBase(), dst.getIndex(), dst.getScale(), dst.getDisplacement() + 4); movl(dst, (int) (src & 0xFFFFFFFF)); movl(high, (int) (src >> 32)); } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirAssembler.java --- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirAssembler.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirAssembler.java Fri Sep 07 13:40:53 2012 +0200 @@ -227,7 +227,7 @@ public final Constant value; XirConstant(XirAssembler asm, Constant value) { - super(asm, value, value.kind); + super(asm, value, value.getKind()); this.value = value; } @@ -249,7 +249,7 @@ public final Value register; XirRegister(XirAssembler asm, String name, RegisterValue register, boolean reserve) { - super(asm, name, register.kind, reserve); + super(asm, name, register.getKind(), reserve); this.register = register; } } diff -r 6e66d97a16ae -r 92bc58dc5b5e graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSnippet.java --- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSnippet.java Fri Sep 07 12:12:47 2012 +0200 +++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirSnippet.java Fri Sep 07 13:40:53 2012 +0200 @@ -67,7 +67,7 @@ return false; } if (arg.constant != null) { - if (arg.constant.kind != param.kind) { + if (arg.constant.getKind() != param.kind) { return false; } }