# HG changeset patch # User Doug Simon # Date 1413328227 -7200 # Node ID 9a804ec7f7076164e5148a52272bc9faeb7894de # Parent 8cc283ce4bd1adf713e128148c98c6a8ace1ad8d converted Constant and Value to be interfaces (GRAAL-874) diff -r 8cc283ce4bd1 -r 9a804ec7f707 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 Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/VirtualObject.java Wed Oct 15 01:10:27 2014 +0200 @@ -31,7 +31,7 @@ * The information stored in the {@link VirtualObject} is used during deoptimization to recreate the * object. */ -public final class VirtualObject extends Value { +public final class VirtualObject extends AbstractValue { private static final long serialVersionUID = -2907197776426346021L; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractConstant.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractConstant.java Wed Oct 15 01:10:27 2014 +0200 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2009, 2014, 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.api.meta; + +public abstract class AbstractConstant extends AbstractValue implements Constant { + + private static final long serialVersionUID = -6355452536852663986L; + + protected AbstractConstant(LIRKind kind) { + super(kind); + } + + @Override + public String toString() { + if (getKind() == Kind.Illegal) { + return "illegal"; + } else { + return getKind().getJavaName() + "[" + toValueString() + "]"; + } + } +} diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AbstractValue.java Wed Oct 15 01:10:27 2014 +0200 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2009, 2014, 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.api.meta; + +import java.io.*; + +/** + * Abstract base class for values manipulated by the compiler. All values have a {@linkplain Kind + * kind} and are immutable. + */ +public abstract class AbstractValue implements Serializable, Value { + + private static final long serialVersionUID = -6909397188697766469L; + + @SuppressWarnings("serial") public static final AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) { + + @Override + public String toString() { + return "-"; + } + }; + + private final Kind kind; + private final LIRKind lirKind; + + /** + * Initializes a new value of the specified kind. + * + * @param lirKind the kind + */ + protected AbstractValue(LIRKind lirKind) { + this.lirKind = lirKind; + if (getPlatformKind() instanceof Kind) { + this.kind = (Kind) getPlatformKind(); + } else { + this.kind = Kind.Illegal; + } + } + + /** + * Returns the kind of this value. + */ + public final Kind getKind() { + return kind; + } + + public final LIRKind getLIRKind() { + return lirKind; + } + + /** + * Returns the platform specific kind used to store this value. + */ + public final PlatformKind getPlatformKind() { + return lirKind.getPlatformKind(); + } + + @Override + public int hashCode() { + return 41 + lirKind.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj instanceof AbstractValue) { + AbstractValue that = (AbstractValue) obj; + return kind.equals(that.kind) && lirKind.equals(that.lirKind); + } + return false; + } +} diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AllocatableValue.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AllocatableValue.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/AllocatableValue.java Wed Oct 15 01:10:27 2014 +0200 @@ -26,7 +26,7 @@ * Common base class for values that are stored in some location that's managed by the register * allocator (e.g. register, stack slot). */ -public abstract class AllocatableValue extends Value { +public abstract class AllocatableValue extends AbstractValue { private static final long serialVersionUID = 153019506717492133L; diff -r 8cc283ce4bd1 -r 9a804ec7f707 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 Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java Wed Oct 15 01:10:27 2014 +0200 @@ -28,9 +28,7 @@ * {@code Constant} instances that represent frequently used constant values, such as * {@link #NULL_OBJECT}. */ -public abstract class Constant extends Value { - - private static final long serialVersionUID = -6355452536852663986L; +public interface Constant extends Value { /* * Using a larger cache for integers leads to only a slight increase in cache hit ratio which is @@ -50,23 +48,19 @@ public static final Constant TRUE = new PrimitiveConstant(Kind.Boolean, 1L); public static final Constant FALSE = new PrimitiveConstant(Kind.Boolean, 0L); - protected Constant(LIRKind kind) { - super(kind); - } - /** * Checks whether this constant is null. * * @return {@code true} if this constant is the null constant */ - public abstract boolean isNull(); + boolean isNull(); /** * Checks whether this constant is non-null. * * @return {@code true} if this constant is a primitive, or an object constant that is not null */ - public final boolean isNonNull() { + default boolean isNonNull() { return !isNull(); } @@ -75,14 +69,16 @@ * * @return {@code true} if this constant is the default value for its kind */ - public abstract boolean isDefaultForKind(); + boolean isDefaultForKind(); /** * Returns the value of this constant as a boxed Java value. * * @return the value of this constant */ - public abstract Object asBoxedPrimitive(); + default Object asBoxedPrimitive() { + throw new IllegalArgumentException(); + } /** * Returns the primitive int value this constant represents. The constant must have a @@ -90,7 +86,9 @@ * * @return the constant value */ - public abstract int asInt(); + default int asInt() { + throw new IllegalArgumentException(); + } /** * Returns the primitive boolean value this constant represents. The constant must have kind @@ -98,7 +96,9 @@ * * @return the constant value */ - public abstract boolean asBoolean(); + default boolean asBoolean() { + throw new IllegalArgumentException(); + } /** * Returns the primitive long value this constant represents. The constant must have kind @@ -106,7 +106,9 @@ * * @return the constant value */ - public abstract long asLong(); + default long asLong() { + throw new IllegalArgumentException(); + } /** * Returns the primitive float value this constant represents. The constant must have kind @@ -114,7 +116,9 @@ * * @return the constant value */ - public abstract float asFloat(); + default float asFloat() { + throw new IllegalArgumentException(); + } /** * Returns the primitive double value this constant represents. The constant must have kind @@ -122,9 +126,11 @@ * * @return the constant value */ - public abstract double asDouble(); + default double asDouble() { + throw new IllegalArgumentException(); + } - public String toValueString() { + default String toValueString() { if (getKind() == Kind.Illegal) { return "illegal"; } else { @@ -132,15 +138,6 @@ } } - @Override - public String toString() { - if (getKind() == Kind.Illegal) { - return "illegal"; - } else { - return getKind().getJavaName() + "[" + toValueString() + "]"; - } - } - /** * Creates a boxed double constant. * diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/NullConstant.java Wed Oct 15 01:10:27 2014 +0200 @@ -25,7 +25,7 @@ /** * The implementation type of the {@link Constant#NULL_OBJECT null constant}. */ -final class NullConstant extends Constant { +final class NullConstant extends AbstractConstant { private static final long serialVersionUID = 8906209595800783961L; @@ -44,36 +44,6 @@ } @Override - public Object asBoxedPrimitive() { - throw new IllegalArgumentException(); - } - - @Override - public int asInt() { - throw new IllegalArgumentException(); - } - - @Override - public boolean asBoolean() { - throw new IllegalArgumentException(); - } - - @Override - public long asLong() { - throw new IllegalArgumentException(); - } - - @Override - public float asFloat() { - throw new IllegalArgumentException(); - } - - @Override - public double asDouble() { - throw new IllegalArgumentException(); - } - - @Override public String toValueString() { return "null"; } @@ -88,4 +58,9 @@ assert o == this || !(o instanceof NullConstant) : "null constant is a singleton"; return o == this; } + + public Object asBoxedPrimitive() { + // TODO Auto-generated method stub + return null; + } } diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java --- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/PrimitiveConstant.java Wed Oct 15 01:10:27 2014 +0200 @@ -26,7 +26,7 @@ * Represents a primitive constant value, such as an integer or floating point number, within the * compiler and across the compiler/runtime interface. */ -public class PrimitiveConstant extends Constant { +public class PrimitiveConstant extends AbstractConstant { private static final long serialVersionUID = 8787949721295655376L; diff -r 8cc283ce4bd1 -r 9a804ec7f707 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 Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java Wed Oct 15 01:10:27 2014 +0200 @@ -22,15 +22,11 @@ */ package com.oracle.graal.api.meta; -import java.io.*; - /** * Abstract base class for values manipulated by the compiler. All values have a {@linkplain Kind * kind} and are immutable. */ -public abstract class Value implements Serializable, KindProvider { - - private static final long serialVersionUID = -6909397188697766469L; +public interface Value extends KindProvider { @SuppressWarnings("serial") public static final AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) { @@ -40,62 +36,25 @@ } }; - private final Kind kind; - private final LIRKind lirKind; - - /** - * Initializes a new value of the specified kind. - * - * @param lirKind the kind - */ - protected Value(LIRKind lirKind) { - this.lirKind = lirKind; - if (getPlatformKind() instanceof Kind) { - this.kind = (Kind) getPlatformKind(); - } else { - this.kind = Kind.Illegal; - } - } - /** * Returns a String representation of the kind, which should be the end of all * {@link #toString()} implementation of subclasses. */ - protected final String getKindSuffix() { + default String getKindSuffix() { return "|" + getKind().getTypeChar(); } /** * Returns the kind of this value. */ - public final Kind getKind() { - return kind; - } + Kind getKind(); - public final LIRKind getLIRKind() { - return lirKind; - } + LIRKind getLIRKind(); /** * Returns the platform specific kind used to store this value. */ - public final PlatformKind getPlatformKind() { - return lirKind.getPlatformKind(); - } - - @Override - public int hashCode() { - return 41 + lirKind.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof Value) { - Value that = (Value) obj; - return kind.equals(that.kind) && lirKind.equals(that.lirKind); - } - return false; - } + PlatformKind getPlatformKind(); /** * Checks if this value is identical to {@code other}. @@ -104,7 +63,7 @@ * should be used. */ @ExcludeFromIdentityComparisonVerification - public final boolean identityEquals(Value other) { + default boolean identityEquals(Value other) { return this == other; } } diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchValue.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchValue.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/match/ComplexMatchValue.java Wed Oct 15 01:10:27 2014 +0200 @@ -30,14 +30,14 @@ * closure because Value is serializable which is a hassle for the little inner classes which * usually occur here. */ -public class ComplexMatchValue extends Value { +public class ComplexMatchValue extends AbstractValue { private static final long serialVersionUID = -4734670273590368770L; /** * This is the Value of a node which was matched as part of a complex match. The value isn't * actually useable but this marks it as having been evaluated. */ - @SuppressWarnings("serial") public static final Value INTERIOR_MATCH = new Value(LIRKind.Illegal) { + @SuppressWarnings("serial") public static final Value INTERIOR_MATCH = new AbstractValue(LIRKind.Illegal) { @Override public String toString() { diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCompressedNullConstant.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCompressedNullConstant.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotCompressedNullConstant.java Wed Oct 15 01:10:27 2014 +0200 @@ -27,7 +27,7 @@ /** * The compressed representation of the {@link Constant#NULL_OBJECT null constant}. */ -public final class HotSpotCompressedNullConstant extends Constant implements HotSpotConstant { +public final class HotSpotCompressedNullConstant extends AbstractConstant implements HotSpotConstant { private static final long serialVersionUID = 8906209595800783961L; @@ -48,36 +48,6 @@ } @Override - public Object asBoxedPrimitive() { - throw new IllegalArgumentException(); - } - - @Override - public int asInt() { - throw new IllegalArgumentException(); - } - - @Override - public boolean asBoolean() { - throw new IllegalArgumentException(); - } - - @Override - public long asLong() { - throw new IllegalArgumentException(); - } - - @Override - public float asFloat() { - throw new IllegalArgumentException(); - } - - @Override - public double asDouble() { - throw new IllegalArgumentException(); - } - - @Override public String toValueString() { return "null"; } diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstant.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstant.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstant.java Wed Oct 15 01:10:27 2014 +0200 @@ -22,8 +22,10 @@ */ package com.oracle.graal.hotspot.meta; +import com.oracle.graal.api.meta.*; + /** * Marker interface for hotspot specific constants. */ -public interface HotSpotConstant { +public interface HotSpotConstant extends Constant { } diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMonitorValue.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMonitorValue.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMonitorValue.java Wed Oct 15 01:10:27 2014 +0200 @@ -28,7 +28,7 @@ /** * Represents lock information in the debug information. */ -public final class HotSpotMonitorValue extends Value { +public final class HotSpotMonitorValue extends AbstractValue { private static final long serialVersionUID = 8241681800464483691L; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotObjectConstant.java Wed Oct 15 01:10:27 2014 +0200 @@ -28,7 +28,7 @@ * Represents a constant non-{@code null} object reference, within the compiler and across the * compiler/runtime interface. */ -public final class HotSpotObjectConstant extends Constant implements HotSpotConstant { +public final class HotSpotObjectConstant extends AbstractConstant implements HotSpotConstant { private static final long serialVersionUID = 3592151693708093496L; @@ -105,36 +105,6 @@ } @Override - public Object asBoxedPrimitive() { - throw new IllegalArgumentException(); - } - - @Override - public int asInt() { - throw new IllegalArgumentException(); - } - - @Override - public boolean asBoolean() { - throw new IllegalArgumentException(); - } - - @Override - public long asLong() { - throw new IllegalArgumentException(); - } - - @Override - public float asFloat() { - throw new IllegalArgumentException(); - } - - @Override - public double asDouble() { - throw new IllegalArgumentException(); - } - - @Override public int hashCode() { return System.identityHashCode(object); } diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java --- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java Wed Oct 15 01:10:27 2014 +0200 @@ -50,7 +50,7 @@ } - private static class DummyValue extends Value { + private static class DummyValue extends AbstractValue { private static final long serialVersionUID = -645435039553382737L; private final int id; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest2.java --- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest2.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest2.java Wed Oct 15 01:10:27 2014 +0200 @@ -51,7 +51,7 @@ } - private static class DummyValue extends Value { + private static class DummyValue extends AbstractValue { private static final long serialVersionUID = -645435039553382737L; private final int id; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest3.java --- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest3.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest3.java Wed Oct 15 01:10:27 2014 +0200 @@ -51,7 +51,7 @@ } - private static class DummyValue extends Value { + private static class DummyValue extends AbstractValue { private static final long serialVersionUID = -645435039553382737L; private final int id; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest4.java --- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest4.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest4.java Wed Oct 15 01:10:27 2014 +0200 @@ -51,7 +51,7 @@ } - private static class DummyValue extends Value { + private static class DummyValue extends AbstractValue { private static final long serialVersionUID = -645435039553382737L; private final int id; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest1.java --- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest1.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest1.java Wed Oct 15 01:10:27 2014 +0200 @@ -48,7 +48,7 @@ } - private static class DummyValue extends Value { + private static class DummyValue extends AbstractValue { private static final long serialVersionUID = -645435039553382737L; private final int id; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest2.java --- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest2.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/ValuePositionTest2.java Wed Oct 15 01:10:27 2014 +0200 @@ -50,7 +50,7 @@ } - private static class DummyValue extends Value { + private static class DummyValue extends AbstractValue { private static final long serialVersionUID = 3620305384660607012L; private final int id; diff -r 8cc283ce4bd1 -r 9a804ec7f707 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java Tue Oct 14 20:02:44 2014 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/CompositeValue.java Wed Oct 15 01:10:27 2014 +0200 @@ -33,7 +33,7 @@ /** * Base class to represent values that need to be stored in more than one register. */ -public abstract class CompositeValue extends Value implements Cloneable { +public abstract class CompositeValue extends AbstractValue implements Cloneable { private static final long serialVersionUID = -169180052684126180L; diff -r 8cc283ce4bd1 -r 9a804ec7f707 src/share/vm/classfile/systemDictionary.hpp --- a/src/share/vm/classfile/systemDictionary.hpp Tue Oct 14 20:02:44 2014 +0200 +++ b/src/share/vm/classfile/systemDictionary.hpp Wed Oct 15 01:10:27 2014 +0200 @@ -235,7 +235,7 @@ GRAAL_ONLY(do_klass(StackSlot_klass, com_oracle_graal_api_code_StackSlot, Graal)) \ GRAAL_ONLY(do_klass(VirtualObject_klass, com_oracle_graal_api_code_VirtualObject, Graal)) \ GRAAL_ONLY(do_klass(SpeculationLog_klass, com_oracle_graal_api_code_SpeculationLog, Graal)) \ - GRAAL_ONLY(do_klass(Constant_klass, com_oracle_graal_api_meta_Constant, Graal)) \ + GRAAL_ONLY(do_klass(AbstractConstant_klass, com_oracle_graal_api_meta_AbstractConstant, Graal)) \ GRAAL_ONLY(do_klass(PrimitiveConstant_klass, com_oracle_graal_api_meta_PrimitiveConstant, Graal)) \ GRAAL_ONLY(do_klass(RawConstant_klass, com_oracle_graal_api_meta_RawConstant, Graal)) \ GRAAL_ONLY(do_klass(NullConstant_klass, com_oracle_graal_api_meta_NullConstant, Graal)) \ @@ -244,6 +244,7 @@ GRAAL_ONLY(do_klass(LIRKind_klass, com_oracle_graal_api_meta_LIRKind, Graal)) \ GRAAL_ONLY(do_klass(JavaMethod_klass, com_oracle_graal_api_meta_JavaMethod, Graal)) \ GRAAL_ONLY(do_klass(JavaType_klass, com_oracle_graal_api_meta_JavaType, Graal)) \ + GRAAL_ONLY(do_klass(AbstractValue_klass, com_oracle_graal_api_meta_AbstractValue, Graal)) \ GRAAL_ONLY(do_klass(Value_klass, com_oracle_graal_api_meta_Value, Graal)) \ /*end*/ diff -r 8cc283ce4bd1 -r 9a804ec7f707 src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Tue Oct 14 20:02:44 2014 +0200 +++ b/src/share/vm/classfile/vmSymbols.hpp Wed Oct 15 01:10:27 2014 +0200 @@ -316,7 +316,7 @@ GRAAL_ONLY(template(com_oracle_graal_hotspot_meta_HotSpotMetaspaceConstant, "com/oracle/graal/hotspot/meta/HotSpotMetaspaceConstant")) \ GRAAL_ONLY(template(com_oracle_graal_hotspot_HotSpotStackFrameReference, "com/oracle/graal/hotspot/HotSpotStackFrameReference")) \ GRAAL_ONLY(template(com_oracle_graal_hotspot_CompilationTask, "com/oracle/graal/hotspot/CompilationTask")) \ - GRAAL_ONLY(template(com_oracle_graal_api_meta_Constant, "com/oracle/graal/api/meta/Constant")) \ + GRAAL_ONLY(template(com_oracle_graal_api_meta_AbstractConstant, "com/oracle/graal/api/meta/AbstractConstant")) \ GRAAL_ONLY(template(com_oracle_graal_api_meta_PrimitiveConstant, "com/oracle/graal/api/meta/PrimitiveConstant")) \ GRAAL_ONLY(template(com_oracle_graal_api_meta_RawConstant, "com/oracle/graal/api/meta/RawConstant")) \ GRAAL_ONLY(template(com_oracle_graal_api_meta_NullConstant, "com/oracle/graal/api/meta/NullConstant")) \ @@ -326,6 +326,7 @@ GRAAL_ONLY(template(com_oracle_graal_api_meta_Kind, "com/oracle/graal/api/meta/Kind")) \ GRAAL_ONLY(template(com_oracle_graal_api_meta_LIRKind, "com/oracle/graal/api/meta/LIRKind")) \ GRAAL_ONLY(template(com_oracle_graal_api_meta_Value, "com/oracle/graal/api/meta/Value")) \ + GRAAL_ONLY(template(com_oracle_graal_api_meta_AbstractValue, "com/oracle/graal/api/meta/AbstractValue")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_Assumptions, "com/oracle/graal/api/code/Assumptions")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_Assumptions_MethodContents, "com/oracle/graal/api/code/Assumptions$MethodContents")) \ GRAAL_ONLY(template(com_oracle_graal_api_code_Assumptions_ConcreteSubtype, "com/oracle/graal/api/code/Assumptions$ConcreteSubtype")) \ diff -r 8cc283ce4bd1 -r 9a804ec7f707 src/share/vm/graal/graalCodeInstaller.cpp --- a/src/share/vm/graal/graalCodeInstaller.cpp Tue Oct 14 20:02:44 2014 +0200 +++ b/src/share/vm/graal/graalCodeInstaller.cpp Wed Oct 15 01:10:27 2014 +0200 @@ -177,7 +177,7 @@ if (constant->is_a(HotSpotMetaspaceConstant::klass())) { oop obj = HotSpotMetaspaceConstant::metaspaceObject(constant); jlong prim = HotSpotMetaspaceConstant::primitive(constant); - assert(Kind::typeChar(Constant::kind(constant)) == 'j', "must have word kind"); + assert(Kind::typeChar(AbstractConstant::kind(constant)) == 'j', "must have word kind"); assert(obj != NULL, "must have an object"); assert(prim != 0, "must have a primitive value"); @@ -195,7 +195,7 @@ return new LocationValue(Location::new_stk_loc(Location::invalid, 0)); } - oop lirKind = Value::lirKind(value); + oop lirKind = AbstractValue::lirKind(value); oop platformKind = LIRKind::platformKind(lirKind); jint referenceMask = LIRKind::referenceMask(lirKind); assert(referenceMask == 0 || referenceMask == 1, "unexpected referenceMask"); @@ -274,7 +274,7 @@ second = value; } return value; - } else if (value->is_a(Constant::klass())){ + } else if (value->is_a(AbstractConstant::klass())){ record_metadata_in_constant(value, oop_recorder); if (value->is_a(PrimitiveConstant::klass())) { assert(!reference, "unexpected primitive constant type"); diff -r 8cc283ce4bd1 -r 9a804ec7f707 src/share/vm/graal/graalJavaAccess.hpp --- a/src/share/vm/graal/graalJavaAccess.hpp Tue Oct 14 20:02:44 2014 +0200 +++ b/src/share/vm/graal/graalJavaAccess.hpp Wed Oct 15 01:10:27 2014 +0200 @@ -199,8 +199,8 @@ oop_field(BytecodePosition, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ int_field(BytecodePosition, bci) \ end_class \ - start_class(Constant) \ - oop_field(Constant, kind, "Lcom/oracle/graal/api/meta/Kind;") \ + start_class(AbstractConstant) \ + oop_field(AbstractConstant, kind, "Lcom/oracle/graal/api/meta/Kind;") \ end_class \ start_class(PrimitiveConstant) \ long_field(PrimitiveConstant, primitive) \ @@ -233,10 +233,12 @@ int_field(LIRKind, referenceMask) \ end_class \ start_class(Value) \ - oop_field(Value, kind, "Lcom/oracle/graal/api/meta/Kind;") \ - oop_field(Value, lirKind, "Lcom/oracle/graal/api/meta/LIRKind;") \ static_oop_field(Value, ILLEGAL, "Lcom/oracle/graal/api/meta/AllocatableValue;"); \ end_class \ + start_class(AbstractValue) \ + oop_field(AbstractValue, kind, "Lcom/oracle/graal/api/meta/Kind;") \ + oop_field(AbstractValue, lirKind, "Lcom/oracle/graal/api/meta/LIRKind;") \ + end_class \ start_class(RegisterValue) \ oop_field(RegisterValue, reg, "Lcom/oracle/graal/api/code/Register;") \ end_class \