changeset 5535:e624cded7986

Moving methods from RiRuntime to MetaAccessProvider.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 08 Jun 2012 23:16:25 +0200
parents e0f7a49129f2
children 1c4af0e7517f
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java
diffstat 2 files changed, 35 insertions(+), 35 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java	Fri Jun 08 23:10:02 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java	Fri Jun 08 23:16:25 2012 +0200
@@ -22,15 +22,13 @@
  */
 package com.oracle.graal.api.code;
 
-import java.lang.reflect.*;
-
 import com.oracle.graal.api.meta.*;
 
 /**
  * Encapsulates the main functionality of the runtime for the compiler, including access
  * to constant pools, OSR frames, inlining requirements, and runtime calls such as checkcast.
 s */
-public interface RiRuntime {
+public interface RiRuntime extends MetaAccessProvider {
 
     /**
      * Get the size in bytes for locking information on the stack.
@@ -54,28 +52,6 @@
     String disassemble(RiResolvedMethod method);
 
     /**
-     * Returns the RiType object representing the base type for the given kind.
-     */
-    RiResolvedType asRiType(RiKind kind);
-
-    /**
-     * Returns the type of the given constant object.
-     *
-     * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()}
-     */
-    RiResolvedType getTypeOf(RiConstant constant);
-
-
-    RiResolvedType getType(Class<?> clazz);
-
-    /**
-     * 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
-     */
-    boolean areConstantObjectsEqual(RiConstant x, RiConstant y);
-
-    /**
      * Gets the register configuration to use when compiling a given method.
      *
      * @param method the top level method of a compilation
@@ -98,11 +74,6 @@
     int getMinimumOutgoingSize();
 
     /**
-     * Gets the length of the array that is wrapped in a CiConstant object.
-     */
-    int getArrayLength(RiConstant array);
-
-    /**
      * Performs any runtime-specific conversion on the object used to describe the target of a call.
      */
     Object asCallTarget(Object target);
@@ -114,11 +85,6 @@
     long getMaxCallTargetOffset(CiRuntimeCall rtcall);
 
     /**
-     * Provides the {@link RiMethod} for a {@link Method} obtained via reflection.
-     */
-    RiResolvedMethod getRiMethod(Method reflectionMethod);
-
-    /**
      * Adds the given machine code 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 code the code to be added
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Fri Jun 08 23:10:02 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Fri Jun 08 23:16:25 2012 +0200
@@ -22,7 +22,41 @@
  */
 package com.oracle.graal.api.meta;
 
+import java.lang.reflect.*;
+
 
 public interface MetaAccessProvider {
 
+
+    /**
+     * Returns the RiType object representing the base type for the given kind.
+     */
+    RiResolvedType asRiType(RiKind kind);
+
+    /**
+     * Returns the type of the given constant object.
+     *
+     * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()}
+     */
+    RiResolvedType getTypeOf(RiConstant constant);
+
+
+    RiResolvedType getType(Class<?> clazz);
+
+    /**
+     * 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
+     */
+    boolean areConstantObjectsEqual(RiConstant x, RiConstant y);
+
+    /**
+     * Provides the {@link RiMethod} for a {@link Method} obtained via reflection.
+     */
+    RiResolvedMethod getRiMethod(Method reflectionMethod);
+
+    /**
+     * Gets the length of the array that is wrapped in a CiConstant object.
+     */
+    int getArrayLength(RiConstant array);
 }