changeset 18587:d6555d937ae2

Merge
author Stefan Anzinger <stefan.a.anzinger@oracle.com>
date Mon, 01 Dec 2014 17:03:48 +0100
parents 51d05f258309 (current diff) bf7db79a6e45 (diff)
children 3f63ea587d2b
files
diffstat 6 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java	Mon Dec 01 15:19:59 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java	Mon Dec 01 17:03:48 2014 +0100
@@ -28,7 +28,7 @@
  * Represents a reference to a Java field, either resolved or unresolved fields. Fields, like
  * methods and types, are resolved through {@link ConstantPool constant pools}.
  */
-public interface JavaField {
+public interface JavaField extends TrustedInterface {
 
     /**
      * Returns the name of this field.
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java	Mon Dec 01 15:19:59 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java	Mon Dec 01 17:03:48 2014 +0100
@@ -28,7 +28,7 @@
  * Represents a reference to a Java method, either resolved or unresolved. Methods, like fields and
  * types, are resolved through {@link ConstantPool constant pools}.
  */
-public interface JavaMethod {
+public interface JavaMethod extends TrustedInterface {
 
     /**
      * Returns the name of this method.
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java	Mon Dec 01 15:19:59 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java	Mon Dec 01 17:03:48 2014 +0100
@@ -28,7 +28,7 @@
  * Represents a resolved or unresolved type. Types include primitives, objects, {@code void}, and
  * arrays thereof.
  */
-public interface JavaType {
+public interface JavaType extends TrustedInterface {
 
     /**
      * Returns the name of this type in internal form. The following are examples of strings
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java	Mon Dec 01 15:19:59 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/LocationIdentity.java	Mon Dec 01 17:03:48 2014 +0100
@@ -33,7 +33,7 @@
  * comparing two {@link LocationIdentity} values for equality. Likewise, they must not use
  * {@link IdentityHashMap}s with {@link LocationIdentity} values as keys.
  */
-public interface LocationIdentity {
+public interface LocationIdentity extends TrustedInterface {
 
     /**
      * Denotes any location. A write to such a location kills all values in a memory map during an
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java	Mon Dec 01 15:19:59 2014 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Value.java	Mon Dec 01 17:03:48 2014 +0100
@@ -26,7 +26,7 @@
  * Interface for values manipulated by the compiler. All values have a {@linkplain Kind kind} and
  * are immutable.
  */
-public interface Value extends KindProvider {
+public interface Value extends KindProvider, TrustedInterface {
 
     @SuppressWarnings("serial") AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) {
 
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java	Mon Dec 01 15:19:59 2014 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java	Mon Dec 01 17:03:48 2014 +0100
@@ -34,6 +34,8 @@
  * For certain types, object identity should not be used for object equality check. This phase
  * checks the correct usage of the given type. Equality checks with == or != (except null checks)
  * results in an {@link AssertionError}.
+ *
+ * Note that only {@link TrustedInterface}s can be verified.
  */
 public class VerifyUsageWithEquals extends VerifyPhase<PhaseContext> {
 
@@ -42,8 +44,9 @@
      */
     private final Class<?> restrictedClass;
 
-    public VerifyUsageWithEquals(Class<?> klass) {
-        this.restrictedClass = klass;
+    public VerifyUsageWithEquals(Class<?> restrictedClass) {
+        this.restrictedClass = restrictedClass;
+        assert !restrictedClass.isInterface() || TrustedInterface.class.isAssignableFrom(restrictedClass);
     }
 
     /**