changeset 5541:b4c406861c33

More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 09 Jun 2012 16:52:12 +0200
parents a891c53a295b
children e318468952f5
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiAssumptions.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCodePos.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCompilationStatistics.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiExceptionHandler.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiFrame.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTargetMethod.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiUtil.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationQueue.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java graal/com.oracle.graal.api.interpreter/src/com/oracle/graal/api/interpreter/Interpreter.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/CodeInfo.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExceptionHandler.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExceptionSeen.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/InstalledCode.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiConstantPool.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiDeoptReason.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiExceptionHandler.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiExceptionSeen.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiField.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiProfilingInfo.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedField.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedType.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiSignature.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiType.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiTypeProfile.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiUtil.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/OptimisticOptimizations.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/ComputeLinearScanOrder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BoxingEliminationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CheckCastEliminationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IdentifyBoxingPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/SchedulePhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateObjectTypeFeedback.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypeCachePhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/TypeFeedbackCache.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/BitMap2D.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/BitMap.java graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeBitMap.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/MethodFilter.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotConstantPool.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotExceptionHandler.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotGraphCache.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodData.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodDataAccessor.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodUnresolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotSignature.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeUnresolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/ExtendedRiRuntime.java graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/RiGraphCache.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxingMethodPool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadHubNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewObjectArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewTypeArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeField.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackStore.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeQuery.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/TypeFeedbackTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/BoxedVirtualObjectNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CheckCastTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InstanceOfTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeCheckTest.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/RiXirGenerator.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseProfilingInfo.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/JniMangle.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/SnapshotProfilingInfo.java graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TypeCheckHints.java src/share/vm/classfile/vmSymbols.hpp src/share/vm/graal/graalCompilerToVM.cpp src/share/vm/graal/graalJavaAccess.hpp
diffstat 178 files changed, 2398 insertions(+), 3181 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiAssumptions.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiAssumptions.java	Sat Jun 09 16:52:12 2012 +0200
@@ -51,14 +51,14 @@
         /**
          * Type the assumption is made about.
          */
-        public final RiResolvedType context;
+        public final ResolvedJavaType context;
 
         /**
          * Assumed unique concrete sub-type of the context type.
          */
-        public final RiResolvedType subtype;
+        public final ResolvedJavaType subtype;
 
-        public ConcreteSubtype(RiResolvedType context, RiResolvedType subtype) {
+        public ConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) {
             this.context = context;
             this.subtype = subtype;
         }
@@ -93,19 +93,19 @@
          * A virtual (or interface) method whose unique implementation for the receiver type
          * in {@link #context} is {@link #impl}.
          */
-        public final RiResolvedMethod method;
+        public final ResolvedJavaMethod method;
 
         /**
          * A receiver type.
          */
-        public final RiResolvedType context;
+        public final ResolvedJavaType context;
 
         /**
          * The unique implementation of {@link #method} for {@link #context}.
          */
-        public final RiResolvedMethod impl;
+        public final ResolvedJavaMethod impl;
 
-        public ConcreteMethod(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl) {
+        public ConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) {
             this.method = method;
             this.context = context;
             this.impl = impl;
@@ -138,9 +138,9 @@
 
         private static final long serialVersionUID = -4821594103928571659L;
 
-        public final RiResolvedMethod method;
+        public final ResolvedJavaMethod method;
 
-        public MethodContents(RiResolvedMethod method) {
+        public MethodContents(ResolvedJavaMethod method) {
             this.method = method;
         }
 
@@ -203,7 +203,7 @@
      * @return {@code true} if the assumption was recorded and can be assumed; {@code false} otherwise
      */
     @SuppressWarnings("static-method")
-    public boolean recordNoFinalizableSubclassAssumption(RiResolvedType receiverType) {
+    public boolean recordNoFinalizableSubclassAssumption(ResolvedJavaType receiverType) {
         // TODO (thomaswue): Record that assumption correctly.
         return false;
     }
@@ -213,7 +213,7 @@
      * @param context the root of the subtree of the class hierarchy that this assumptions is about
      * @param subtype the one concrete subtype
      */
-    public void recordConcreteSubtype(RiResolvedType context, RiResolvedType subtype) {
+    public void recordConcreteSubtype(ResolvedJavaType context, ResolvedJavaType subtype) {
         record(new ConcreteSubtype(context, subtype));
     }
 
@@ -225,7 +225,7 @@
      * @param context the receiver type of a call to {@code method}
      * @param impl the concrete method that is the only possible target for the virtual call
      */
-    public void recordConcreteMethod(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl) {
+    public void recordConcreteMethod(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) {
         record(new ConcreteMethod(method, context, impl));
     }
 
@@ -234,7 +234,7 @@
      *
      * @param method a method whose contents were used
      */
-    public void recordMethodContents(RiResolvedMethod method) {
+    public void recordMethodContents(ResolvedJavaMethod method) {
         record(new MethodContents(method));
     }
 
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCodePos.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCodePos.java	Sat Jun 09 16:52:12 2012 +0200
@@ -44,7 +44,7 @@
     /**
      * The runtime interface method for this position.
      */
-    public final RiResolvedMethod method;
+    public final ResolvedJavaMethod method;
 
     /**
      * The location within the method, as a bytecode index. The constant
@@ -60,7 +60,7 @@
      * @param method the method
      * @param bci a BCI within the method
      */
-    public CiCodePos(CiCodePos caller, RiResolvedMethod method, int bci) {
+    public CiCodePos(CiCodePos caller, ResolvedJavaMethod method, int bci) {
         assert method != null;
         this.caller = caller;
         this.method = method;
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCompilationStatistics.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiCompilationStatistics.java	Sat Jun 09 16:52:12 2012 +0200
@@ -75,7 +75,7 @@
     private int codeSize;
     private int deoptCount;
 
-    private CiCompilationStatistics(RiResolvedMethod method) {
+    private CiCompilationStatistics(ResolvedJavaMethod method) {
         if (method != null) {
             holder = CiUtil.format("%H", method);
             name = method.name();
@@ -91,7 +91,7 @@
         }
     }
 
-    public void finish(RiResolvedMethod method) {
+    public void finish(ResolvedJavaMethod method) {
         if (ENABLED) {
             duration = System.nanoTime() - startTime;
             endInvCount = method.invocationCount();
@@ -107,7 +107,7 @@
         return current.get().isEmpty() ? null : current.get().getLast();
     }
 
-    public static CiCompilationStatistics create(RiResolvedMethod method) {
+    public static CiCompilationStatistics create(ResolvedJavaMethod method) {
         if (ENABLED) {
             CiCompilationStatistics stats = new CiCompilationStatistics(method);
             list.add(stats);
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiExceptionHandler.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiExceptionHandler.java	Sat Jun 09 16:52:12 2012 +0200
@@ -25,9 +25,9 @@
 import com.oracle.graal.api.meta.*;
 
 /**
- * An implementation of the {@link RiExceptionHandler} interface.
+ * An implementation of the {@link ExceptionHandler} interface.
  */
-public class CiExceptionHandler implements RiExceptionHandler {
+public class CiExceptionHandler implements ExceptionHandler {
 
     public static final CiExceptionHandler[] NONE = {};
 
@@ -35,7 +35,7 @@
     public final int endBCI;
     public final int handlerBCI;
     public final int catchTypeCPI;
-    public final RiType catchType;
+    public final JavaType catchType;
 
     /**
      * Creates a new exception handler with the specified ranges.
@@ -45,7 +45,7 @@
      * @param catchTypeCPI the index of the throwable class in the constant pool
      * @param catchType the type caught by this exception handler
      */
-    public CiExceptionHandler(int startBCI, int endBCI, int catchBCI, int catchTypeCPI, RiType catchType) {
+    public CiExceptionHandler(int startBCI, int endBCI, int catchBCI, int catchTypeCPI, JavaType catchType) {
         this.startBCI = startBCI;
         this.endBCI = endBCI;
         this.handlerBCI = catchBCI;
@@ -73,7 +73,7 @@
         return catchTypeCPI == 0;
     }
 
-    public RiType catchType() {
+    public JavaType catchType() {
         return catchType;
     }
 
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiFrame.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiFrame.java	Sat Jun 09 16:52:12 2012 +0200
@@ -87,7 +87,7 @@
      * @param numStack the depth of the stack
      * @param numLocks the number of locked objects
      */
-    public CiFrame(CiFrame caller, RiResolvedMethod method, int bci, boolean rethrowException, boolean duringCall, Value[] values, int numLocals, int numStack, int numLocks, long leafGraphId) {
+    public CiFrame(CiFrame caller, ResolvedJavaMethod method, int bci, boolean rethrowException, boolean duringCall, Value[] values, int numLocals, int numStack, int numLocks, long leafGraphId) {
         super(caller, method, bci);
         assert values != null;
         this.rethrowException = rethrowException;
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTargetMethod.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTargetMethod.java	Sat Jun 09 16:52:12 2012 +0200
@@ -404,7 +404,7 @@
      *
      * @param codePos the position of the call in the code array
      * @param size the size of the call instruction
-     * @param target the {@link RiRuntime#asCallTarget(Object) target} being called
+     * @param target the {@link CodeCacheProvider#asCallTarget(Object) target} being called
      * @param debugInfo the debug info for the call
      * @param direct specifies if this is a {@linkplain Call#direct direct} call
      */
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiUtil.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiUtil.java	Sat Jun 09 16:52:12 2012 +0200
@@ -28,7 +28,7 @@
 import java.util.*;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiTypeProfile.*;
+import com.oracle.graal.api.meta.JavaTypeProfile.*;
 
 /**
  * Miscellaneous collection of utility methods used in the {@code CRI} project.
@@ -46,7 +46,7 @@
      * @return the annotation of type {@code annotationClass} for the formal parameter present, else null
      * @throws IndexOutOfBoundsException if {@code parameterIndex} does not denote a formal parameter
      */
-    public static <T extends Annotation> T getParameterAnnotation(Class<T> annotationClass, int parameterIndex, RiResolvedMethod method) {
+    public static <T extends Annotation> T getParameterAnnotation(Class<T> annotationClass, int parameterIndex, ResolvedJavaMethod method) {
         if (parameterIndex >= 0) {
             Annotation[][] parameterAnnotations = method.getParameterAnnotations();
             for (Annotation a : parameterAnnotations[parameterIndex]) {
@@ -164,10 +164,10 @@
      * @return the result of formatting this method according to {@code format}
      * @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
      */
-    public static String format(String format, RiMethod method) throws IllegalFormatException {
+    public static String format(String format, JavaMethod method) throws IllegalFormatException {
         final StringBuilder sb = new StringBuilder();
         int index = 0;
-        RiSignature sig = null;
+        Signature sig = null;
         while (index < format.length()) {
             final char ch = format.charAt(index++);
             if (ch == '%') {
@@ -184,14 +184,14 @@
                         if (sig == null) {
                             sig = method.signature();
                         }
-                        sb.append(RiUtil.toJavaName(sig.returnType(null), qualified));
+                        sb.append(MetaUtil.toJavaName(sig.returnType(null), qualified));
                         break;
                     }
                     case 'H':
                         qualified = true;
                         // fall through
                     case 'h': {
-                        sb.append(RiUtil.toJavaName(method.holder(), qualified));
+                        sb.append(MetaUtil.toJavaName(method.holder(), qualified));
                         break;
                     }
                     case 'n': {
@@ -209,12 +209,12 @@
                             if (i != 0) {
                                 sb.append(", ");
                             }
-                            sb.append(RiUtil.toJavaName(sig.argumentTypeAt(i, null), qualified));
+                            sb.append(MetaUtil.toJavaName(sig.argumentTypeAt(i, null), qualified));
                         }
                         break;
                     }
                     case 'f': {
-                        sb.append(!(method instanceof RiResolvedMethod) ? "unresolved" : isStatic(((RiResolvedMethod) method).accessFlags()) ? "static" : "virtual");
+                        sb.append(!(method instanceof ResolvedJavaMethod) ? "unresolved" : isStatic(((ResolvedJavaMethod) method).accessFlags()) ? "static" : "virtual");
                         break;
                     }
                     case '%': {
@@ -257,10 +257,10 @@
      * @return the result of formatting this field according to {@code format}
      * @throws IllegalFormatException if an illegal specifier is encountered in {@code format}
      */
-    public static String format(String format, RiField field) throws IllegalFormatException {
+    public static String format(String format, JavaField field) throws IllegalFormatException {
         final StringBuilder sb = new StringBuilder();
         int index = 0;
-        RiType type = field.type();
+        JavaType type = field.type();
         while (index < format.length()) {
             final char ch = format.charAt(index++);
             if (ch == '%') {
@@ -274,14 +274,14 @@
                         qualified = true;
                         // fall through
                     case 't': {
-                        sb.append(RiUtil.toJavaName(type, qualified));
+                        sb.append(MetaUtil.toJavaName(type, qualified));
                         break;
                     }
                     case 'H':
                         qualified = true;
                         // fall through
                     case 'h': {
-                        sb.append(RiUtil.toJavaName(field.holder(), qualified));
+                        sb.append(MetaUtil.toJavaName(field.holder(), qualified));
                         break;
                     }
                     case 'n': {
@@ -289,7 +289,7 @@
                         break;
                     }
                     case 'f': {
-                        sb.append(!(field instanceof RiResolvedField) ? "unresolved" : isStatic(((RiResolvedField) field).accessFlags()) ? "static" : "instance");
+                        sb.append(!(field instanceof ResolvedJavaField) ? "unresolved" : isStatic(((ResolvedJavaField) field).accessFlags()) ? "static" : "instance");
                         break;
                     }
                     case '%': {
@@ -430,17 +430,17 @@
     }
 
     /**
-     * Convenient shortcut for calling {@link #appendLocation(StringBuilder, RiMethod, int)} without having to supply a
+     * Convenient shortcut for calling {@link #appendLocation(StringBuilder, JavaMethod, int)} without having to supply a
      * a {@link StringBuilder} instance and convert the result to a string.
      */
-    public static String toLocation(RiResolvedMethod method, int bci) {
+    public static String toLocation(ResolvedJavaMethod method, int bci) {
         return appendLocation(new StringBuilder(), method, bci).toString();
     }
 
     /**
      * Appends a string representation of a location specified by a given method and bci to a given
      * {@link StringBuilder}. If a stack trace element with a non-null file name and non-negative line number is
-     * {@linkplain RiMethod#toStackTraceElement(int) available} for the given method, then the string returned is the
+     * {@linkplain JavaMethod#toStackTraceElement(int) available} for the given method, then the string returned is the
      * {@link StackTraceElement#toString()} value of the stack trace element, suffixed by the bci location. For example:
      *
      * <pre>
@@ -459,7 +459,7 @@
      * @param bci
      * @return
      */
-    public static StringBuilder appendLocation(StringBuilder sb, RiResolvedMethod method, int bci) {
+    public static StringBuilder appendLocation(StringBuilder sb, ResolvedJavaMethod method, int bci) {
         if (method != null) {
             StackTraceElement ste = method.toStackTraceElement(bci);
             if (ste.getFileName() != null && ste.getLineNumber() > 0) {
@@ -604,12 +604,12 @@
         return sb;
     }
 
-    public static Kind[] signatureToKinds(RiResolvedMethod method) {
+    public static Kind[] signatureToKinds(ResolvedJavaMethod method) {
         Kind receiver = isStatic(method.accessFlags()) ? null : method.holder().kind();
         return signatureToKinds(method.signature(), receiver);
     }
 
-    public static Kind[] signatureToKinds(RiSignature signature, Kind receiverKind) {
+    public static Kind[] signatureToKinds(Signature signature, Kind receiverKind) {
         int args = signature.argumentCount(false);
         Kind[] result;
         int i = 0;
@@ -626,7 +626,7 @@
         return result;
     }
 
-    public static Class< ? >[] signatureToTypes(RiSignature signature, RiResolvedType accessingClass) {
+    public static Class< ? >[] signatureToTypes(Signature signature, ResolvedJavaType accessingClass) {
         int count = signature.argumentCount(false);
         Class< ? >[] result = new Class< ? >[count];
         for (int i = 0; i < result.length; ++i) {
@@ -642,7 +642,7 @@
      * @param method an optional method that augments the profile string returned
      * @param sep the separator to use for each separate profile record
      */
-    public static String profileToString(RiProfilingInfo info, RiResolvedMethod method, String sep) {
+    public static String profileToString(ProfilingInfo info, ResolvedJavaMethod method, String sep) {
         StringBuilder buf = new StringBuilder(100);
         if (method != null) {
             buf.append(String.format("canBeStaticallyBound: %b%s", method.canBeStaticallyBound(), sep)).
@@ -666,11 +666,11 @@
                 buf.append(sep);
             }
 
-            if (info.getExceptionSeen(i) != RiExceptionSeen.FALSE) {
+            if (info.getExceptionSeen(i) != ExceptionSeen.FALSE) {
                 buf.append(String.format("exceptionSeen@%d: %s%s", i, info.getExceptionSeen(i).name(), sep));
             }
 
-            RiTypeProfile typeProfile = info.getTypeProfile(i);
+            JavaTypeProfile typeProfile = info.getTypeProfile(i);
             if (typeProfile != null) {
                 ProfiledType[] ptypes = typeProfile.getTypes();
                 if (ptypes != null) {
@@ -685,7 +685,7 @@
         }
 
         boolean firstDeoptReason = true;
-        for (RiDeoptReason reason: RiDeoptReason.values()) {
+        for (DeoptimizationReason reason: DeoptimizationReason.values()) {
             int count = info.getDeoptimizationCount(reason);
             if (count > 0) {
                 if (firstDeoptReason) {
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java	Sat Jun 09 16:52:12 2012 +0200
@@ -31,23 +31,23 @@
 public final class CiVirtualObject extends Value {
     private static final long serialVersionUID = -2907197776426346021L;
 
-    private final RiType type;
+    private final JavaType type;
     private Value[] values;
     private final int id;
 
     /**
      * Creates a new CiVirtualObject for the given type, with the given fields. If the type is an instance class then the values array needs to have one entry for each field, ordered in
-     * like the fields returned by {@link RiResolvedType#declaredFields()}. If the type is an array then the length of the values array determines the reallocated array length.
+     * like the fields returned by {@link ResolvedJavaType#declaredFields()}. If the type is an array then the length of the values array determines the reallocated array length.
      * @param type the type of the object whose allocation was removed during compilation. This can be either an instance of an array type.
      * @param values an array containing all the values to be stored into the object when it is recreated.
      * @param id a unique id that identifies the object within the debug information for one position in the compiled code.
      * @return a new CiVirtualObject instance.
      */
-    public static CiVirtualObject get(RiType type, Value[] values, int id) {
+    public static CiVirtualObject get(JavaType type, Value[] values, int id) {
         return new CiVirtualObject(type, values, id);
     }
 
-    private CiVirtualObject(RiType type, Value[] values, int id) {
+    private CiVirtualObject(JavaType type, Value[] values, int id) {
         super(Kind.Object);
         this.type = type;
         this.values = values;
@@ -62,7 +62,7 @@
     /**
      * @return the type of the object whose allocation was removed during compilation. This can be either an instance of an array type.
      */
-    public RiType type() {
+    public JavaType type() {
         return type;
     }
 
@@ -118,45 +118,45 @@
      */
     public static class CiVirtualObjectFactory {
         private int nextId = 0;
-        private final RiRuntime runtime;
+        private final CodeCacheProvider runtime;
 
-        public CiVirtualObjectFactory(RiRuntime runtime) {
+        public CiVirtualObjectFactory(CodeCacheProvider runtime) {
             this.runtime = runtime;
         }
 
         public CiVirtualObject constantProxy(Kind kind, Value objectValue, Value primitiveValue) {
             Constant cKind = Constant.forObject(kind);
             // TODO: here the ordering is hard coded... we should query RiType.fields() and act accordingly
-            return new CiVirtualObject(runtime.getType(Constant.class), new Value[] {cKind, primitiveValue, Value.IllegalValue, objectValue}, nextId++);
+            return new CiVirtualObject(runtime.getResolvedJavaType(Constant.class), new Value[] {cKind, primitiveValue, Value.IllegalValue, objectValue}, nextId++);
         }
 
         public Value proxy(Value ciValue) {
             switch (ciValue.kind) {
                 case Boolean:
-                    return new CiVirtualObject(runtime.getType(Boolean.class), new Value[] {ciValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Boolean.class), new Value[] {ciValue}, nextId++);
                 case Byte:
-                    return new CiVirtualObject(runtime.getType(Byte.class), new Value[] {ciValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Byte.class), new Value[] {ciValue}, nextId++);
                 case Char:
-                    return new CiVirtualObject(runtime.getType(Character.class), new Value[] {ciValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Character.class), new Value[] {ciValue}, nextId++);
                 case Double:
-                    return new CiVirtualObject(runtime.getType(Double.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Double.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
                 case Float:
-                    return new CiVirtualObject(runtime.getType(Float.class), new Value[] {ciValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Float.class), new Value[] {ciValue}, nextId++);
                 case Int:
-                    return new CiVirtualObject(runtime.getType(Integer.class), new Value[] {ciValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Integer.class), new Value[] {ciValue}, nextId++);
                 case Long:
-                    return new CiVirtualObject(runtime.getType(Long.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Long.class), new Value[] {ciValue, Value.IllegalValue}, nextId++);
                 case Object:
                     return ciValue;
                 case Short:
-                    return new CiVirtualObject(runtime.getType(Short.class), new Value[] {ciValue}, nextId++);
+                    return new CiVirtualObject(runtime.getResolvedJavaType(Short.class), new Value[] {ciValue}, nextId++);
                 default:
                     assert false : ciValue.kind;
                     return null;
             }
         }
 
-        public CiVirtualObject arrayProxy(RiType arrayType, Value[] values) {
+        public CiVirtualObject arrayProxy(JavaType arrayType, Value[] values) {
             return new CiVirtualObject(arrayType, values, nextId++);
         }
 
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CodeCacheProvider.java	Sat Jun 09 16:52:12 2012 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,7 +22,93 @@
  */
 package com.oracle.graal.api.code;
 
+import com.oracle.graal.api.meta.*;
 
-public interface CodeCacheProvider {
+/**
+ * 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 CodeCacheProvider extends MetaAccessProvider {
+
+    /**
+     * Get the size in bytes for locking information on the stack.
+     */
+    int sizeOfLockData();
+
+    /**
+     * Returns a disassembly of the given installed code.
+     *
+     * @param code the code that should be disassembled
+     * @return a disassembly. This will be of length 0 if the runtime does not support disassembling.
+     */
+    String disassemble(CodeInfo code, CiTargetMethod tm);
+
+    /**
+     * Returns the disassembly of the given method in a {@code javap}-like format.
+     *
+     * @param method the method that should be disassembled
+     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
+     */
+    String disassemble(ResolvedJavaMethod method);
+
+    /**
+     * Gets the register configuration to use when compiling a given method.
+     *
+     * @param method the top level method of a compilation
+     */
+    CiRegisterConfig getRegisterConfig(JavaMethod method);
+
+    CiRegisterConfig 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
+     */
+    int getCustomStackAreaSize();
 
+    /**
+     * Minimum size of the stack area reserved for outgoing parameters. This area is reserved in all cases, even when
+     * the compiled method has no regular call instructions.
+     * @return the minimum size of the outgoing parameter area in bytes
+     */
+    int getMinimumOutgoingSize();
+
+    /**
+     * Performs any runtime-specific conversion on the object used to describe the target of a call.
+     */
+    Object asCallTarget(Object target);
+
+    /**
+     * Returns the maximum absolute offset of a runtime call target from any position in the code cache or -1
+     * when not known or not applicable. Intended for determining the required size of address/offset fields.
+     */
+    long getMaxCallTargetOffset(CiRuntimeCall rtcall);
+
+    /**
+     * 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
+     * @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, CiTargetMethod code, CodeInfo[] info);
+
+    /**
+     * Encodes a deoptimization action and a deoptimization reason in an integer value.
+     * @return the encoded value as an integer
+     */
+    int encodeDeoptActionAndReason(CiDeoptAction action, DeoptimizationReason reason);
+
+    /**
+     * Converts a RiDeoptReason into an integer value.
+     * @return An integer value representing the given RiDeoptReason.
+     */
+    int convertDeoptReason(DeoptimizationReason reason);
+
+    /**
+     * Converts a RiDeoptAction into an integer value.
+     * @return An integer value representing the given RiDeoptAction.
+     */
+    int convertDeoptAction(CiDeoptAction action);
 }
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationQueue.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CompilationQueue.java	Sat Jun 09 16:52:12 2012 +0200
@@ -26,5 +26,5 @@
 
 
 public interface CompilationQueue {
-    boolean enqueue(final RiResolvedMethod method, final int entryBCI, boolean blocking, int priority) throws Throwable;
+    boolean enqueue(final ResolvedJavaMethod method, final int entryBCI, boolean blocking, int priority) throws Throwable;
 }
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,114 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.code;
-
-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 extends MetaAccessProvider {
-
-    /**
-     * Get the size in bytes for locking information on the stack.
-     */
-    int sizeOfLockData();
-
-    /**
-     * Returns a disassembly of the given installed code.
-     *
-     * @param code the code that should be disassembled
-     * @return a disassembly. This will be of length 0 if the runtime does not support disassembling.
-     */
-    String disassemble(CodeInfo code, CiTargetMethod tm);
-
-    /**
-     * Returns the disassembly of the given method in a {@code javap}-like format.
-     *
-     * @param method the method that should be disassembled
-     * @return the disassembly. This will be of length 0 if the runtime does not support disassembling.
-     */
-    String disassemble(RiResolvedMethod method);
-
-    /**
-     * Gets the register configuration to use when compiling a given method.
-     *
-     * @param method the top level method of a compilation
-     */
-    CiRegisterConfig getRegisterConfig(RiMethod method);
-
-    CiRegisterConfig 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
-     */
-    int getCustomStackAreaSize();
-
-    /**
-     * Minimum size of the stack area reserved for outgoing parameters. This area is reserved in all cases, even when
-     * the compiled method has no regular call instructions.
-     * @return the minimum size of the outgoing parameter area in bytes
-     */
-    int getMinimumOutgoingSize();
-
-    /**
-     * Performs any runtime-specific conversion on the object used to describe the target of a call.
-     */
-    Object asCallTarget(Object target);
-
-    /**
-     * Returns the maximum absolute offset of a runtime call target from any position in the code cache or -1
-     * when not known or not applicable. Intended for determining the required size of address/offset fields.
-     */
-    long getMaxCallTargetOffset(CiRuntimeCall rtcall);
-
-    /**
-     * 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
-     * @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(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info);
-
-    /**
-     * Encodes a deoptimization action and a deoptimization reason in an integer value.
-     * @return the encoded value as an integer
-     */
-    int encodeDeoptActionAndReason(CiDeoptAction action, RiDeoptReason reason);
-
-    /**
-     * Converts a RiDeoptReason into an integer value.
-     * @return An integer value representing the given RiDeoptReason.
-     */
-    int convertDeoptReason(RiDeoptReason reason);
-
-    /**
-     * Converts a RiDeoptAction into an integer value.
-     * @return An integer value representing the given RiDeoptAction.
-     */
-    int convertDeoptAction(CiDeoptAction action);
-}
--- a/graal/com.oracle.graal.api.interpreter/src/com/oracle/graal/api/interpreter/Interpreter.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.interpreter/src/com/oracle/graal/api/interpreter/Interpreter.java	Sat Jun 09 16:52:12 2012 +0200
@@ -25,5 +25,5 @@
 import com.oracle.graal.api.meta.*;
 
 public interface Interpreter extends VirtualMachineComponent {
-    Object execute(RiResolvedMethod method, Object... arguments);
+    Object execute(ResolvedJavaMethod method, Object... arguments);
 }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/CodeInfo.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/CodeInfo.java	Sat Jun 09 16:52:12 2012 +0200
@@ -42,5 +42,5 @@
     /**
      * Gets the method (if any) from which this installed code was compiled.
      */
-    RiResolvedMethod method();
+    ResolvedJavaMethod method();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ConstantPool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2009, 2011, 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;
+
+/**
+ * Represents the runtime representation of the constant pool that is
+ * used by the compiler when parsing bytecode. The {@code lookupXXX} methods look up a constant
+ * pool entry without performing resolution, and are used during compilation.
+ */
+public interface ConstantPool {
+
+    /**
+     * Makes sure that the type referenced by the specified constant pool entry is loaded and
+     * initialized. This can be used to compile time resolve a type. It works for field, method,
+     * or type constant pool entries.
+     * @param cpi the index of the constant pool entry that references the type
+     * @param opcode the opcode of the instruction that references the type
+     */
+    void loadReferencedType(int cpi, int opcode);
+
+    /**
+     * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks
+     * specific to the JVM instruction it denotes are performed if the field is already resolved.
+     * Should any of these checks fail, an {@linkplain JavaField#isResolved() unresolved}
+     * field reference is returned.
+     *
+     * @param cpi the constant pool index
+     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
+     * @return a reference to the field at {@code cpi} in this pool
+     * @throws ClassFormatError if the entry at {@code cpi} is not a field
+     */
+    JavaField lookupField(int cpi, int opcode);
+
+    /**
+     * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks
+     * specific to the JVM instruction it denotes are performed if the method is already resolved.
+     * Should any of these checks fail, an {@linkplain JavaMethod#isResolved() unresolved}
+     * method reference is returned.
+     *
+     * @param cpi the constant pool index
+     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
+     * @return a reference to the method at {@code cpi} in this pool
+     * @throws ClassFormatError if the entry at {@code cpi} is not a method
+     */
+    JavaMethod lookupMethod(int cpi, int opcode);
+
+    /**
+     * Looks up a reference to a type. If {@code opcode} is non-negative, then resolution checks
+     * specific to the JVM instruction it denotes are performed if the type is already resolved.
+     * Should any of these checks fail, an {@linkplain JavaType#isResolved() unresolved}
+     * type reference is returned.
+     *
+     * @param cpi the constant pool index
+     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
+     * @return a reference to the compiler interface type
+     */
+    JavaType lookupType(int cpi, int opcode);
+
+    /**
+     * Looks up a method signature.
+     *
+     * @param cpi the constant pool index
+     * @return the method signature at index {@code cpi} in this constant pool
+     */
+    Signature lookupSignature(int cpi);
+
+    /**
+     * Looks up a constant at the specified index.
+     * @param cpi the constant pool index
+     * @return the {@code CiConstant} instance representing the constant
+     */
+    Object lookupConstant(int cpi);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/DeoptimizationReason.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.api.meta;
+
+
+public enum DeoptimizationReason {
+    None,
+    NullCheckException,
+    BoundsCheckException,
+    ClassCastException,
+    ArrayStoreException,
+    UnreachedCode,
+    TypeCheckedInliningViolated,
+    OptimizedTypeCheckViolated,
+    NotCompiledExceptionHandler,
+    Unresolved,
+    JavaSubroutineMismatch,
+    ArithmeticException,
+    RuntimeConstraint;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExceptionHandler.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2009, 2011, 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;
+
+/**
+ * Represents an exception handler within the bytecode.
+ */
+public interface ExceptionHandler {
+
+    /**
+     * Gets the start bytecode index of the protected range of this handler.
+     * @return the start bytecode index
+     */
+    int startBCI();
+
+    /**
+     * Gets the end bytecode index of the protected range of this handler.
+     * @return the end bytecode index
+     */
+    int endBCI();
+
+    /**
+     * Gets the bytecode index of the handler block of this handler.
+     * @return the handler block bytecode index
+     */
+    int handlerBCI();
+
+    /**
+     * Gets the index into the constant pool representing the type of exception
+     * caught by this handler.
+     * @return the constant pool index of the catch type
+     */
+    int catchTypeCPI();
+
+    /**
+     * Checks whether this handler catches all exceptions.
+     * @return {@code true} if this handler catches all exceptions
+     */
+    boolean isCatchAll();
+
+    /**
+     * The type of exception caught by this exception handler.
+     *
+     * @return the exception type
+     */
+    JavaType catchType();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ExceptionSeen.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.api.meta;
+
+
+/**
+ * Represents the three possibilities that an exception was seen at a specific BCI.
+ */
+public enum ExceptionSeen {
+    TRUE,
+    FALSE,
+    NOT_SUPPORTED;
+
+    public static ExceptionSeen get(boolean value) {
+        return value ? TRUE : FALSE;
+    }
+}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/InstalledCode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/InstalledCode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -36,7 +36,7 @@
      * Returns the method to which the compiled code belongs.
      * @return the method to which the compiled code belongs.
      */
-    RiResolvedMethod method();
+    ResolvedJavaMethod method();
 
     /**
      * @return true if the code represented by this object is still valid, false otherwise (may happen due to deopt, etc.)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaField.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,53 @@
+/*
+ * Copyright (c) 2009, 2011, 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;
+
+/**
+ * Represents a reference to a Java field, including both resolved and unresolved fields. Fields, like methods and types, are
+ * resolved through {@link ConstantPool constant pools}.
+ */
+public interface JavaField {
+    /**
+     * Gets the name of this field as a string.
+     * @return the name of this field
+     */
+    String name();
+
+    /**
+     * Gets the type of this field as a compiler-runtime interface type.
+     * @return the type of this field
+     */
+    JavaType type();
+
+    /**
+     * Gets the kind of this field.
+     * @return the kind
+     */
+    Kind kind();
+
+    /**
+     * Gets the holder of this field as a compiler-runtime interface type.
+     * @return the holder of this field
+     */
+    JavaType holder();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaMethod.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2009, 2011, 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;
+
+/**
+ * Represents resolved and unresolved Java methods. Methods, like fields and types, are resolved through
+ * {@link ConstantPool constant pools}.
+ */
+public interface JavaMethod {
+
+    /**
+     * Gets the name of the method as a string.
+     * @return the name of the method
+     */
+    String name();
+
+    /**
+     * Gets the type in which this method is declared.
+     * @return the type in which this method is declared
+     */
+    JavaType holder();
+
+    /**
+     * Gets the signature of the method.
+     * @return the signature of the method
+     */
+    Signature signature();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaType.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2009, 2011, 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;
+
+/**
+ * Represents a resolved or unresolved type in the compiler-runtime interface. Types include primitives, objects, {@code void},
+ * and arrays thereof.
+ */
+public interface JavaType {
+
+    /**
+     * Represents each of the several different parts of the runtime representation of
+     * a type which compiled code may need to reference individually. These may or may not be
+     * different objects or data structures, depending on the runtime system.
+     */
+    public enum Representation {
+        /**
+         * The runtime representation of the data structure containing the static fields of this type.
+         */
+        StaticFields,
+
+        /**
+         * The runtime representation of the Java class object of this type.
+         */
+        JavaClass,
+
+        /**
+         * The runtime representation of the "hub" of this type--that is, the closest part of the type
+         * representation which is typically stored in the object header.
+         */
+        ObjectHub
+    }
+
+    /**
+     * Gets the name of this type in internal form. The following are examples of strings returned by this method:
+     * <pre>
+     *     "Ljava/lang/Object;"
+     *     "I"
+     *     "[[B"
+     * </pre>
+     *
+     * @return the name of this type in internal form
+     */
+    String name();
+
+    /**
+     * For array types, gets the type of the components.
+     * @return the component type of this array type
+     */
+    JavaType componentType();
+
+    /**
+     * Gets the type representing an array with elements of this type.
+     * @return a new compiler interface type representing an array of this type
+     */
+    JavaType arrayOf();
+
+    /**
+     * Gets the kind of this compiler interface type.
+     * @return the kind
+     */
+    Kind kind();
+
+    /**
+     * Gets the kind used to represent the specified part of this type.
+     * @param r the part of the this type
+     * @return the kind of constants for the specified part of the type
+     */
+    Kind getRepresentationKind(Representation r);
+
+    ResolvedJavaType resolve(ResolvedJavaType accessingClass);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/JavaTypeProfile.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2011, 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.*;
+
+/**
+ * This profile object represents the type profile at a specific BCI. The precision of the supplied values may vary,
+ * but a runtime that provides this information should be aware that it will be used to guide performance-critical
+ * decisions like speculative inlining, etc.
+ */
+public final class JavaTypeProfile implements Serializable {
+
+    private static final long serialVersionUID = -6877016333706838441L;
+
+    /**
+     * A profiled type that has a probability. Profiled types are naturally sorted in
+     * descending order of their probabilities.
+     */
+    public static class ProfiledType implements Comparable<ProfiledType>, Serializable {
+        private static final long serialVersionUID = 7838575753661305744L;
+        public final ResolvedJavaType type;
+        public final double probability;
+
+        public ProfiledType(ResolvedJavaType type, double probability) {
+            assert type != null;
+            assert probability >= 0.0D && probability <= 1.0D;
+            this.type = type;
+            this.probability = probability;
+        }
+
+        @Override
+        public int compareTo(ProfiledType o) {
+            if (probability > o.probability) {
+                return -1;
+            } else if (probability < o.probability) {
+                return 1;
+            }
+            return 0;
+        }
+    }
+
+    private final double notRecordedProbability;
+    private final ProfiledType[] ptypes;
+
+    /**
+     * Determines if an array of profiled types are sorted in descending order of their probabilities.
+     */
+    public static boolean isSorted(ProfiledType[] ptypes) {
+        for (int i = 1; i < ptypes.length; i++) {
+            if (ptypes[i - 1].probability < ptypes[i].probability) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public JavaTypeProfile(double notRecordedProbability, ProfiledType... ptypes) {
+        this.ptypes = ptypes;
+        this.notRecordedProbability = notRecordedProbability;
+        assert isSorted(ptypes);
+    }
+
+    /**
+     * Returns the estimated probability of all types that could not be recorded due to profiling limitations.
+     * @return double value >= 0.0 and <= 1.0
+     */
+    public double getNotRecordedProbability() {
+        return notRecordedProbability;
+    }
+
+    /**
+     * A list of types for which the runtime has recorded probability information.
+     */
+    public ProfiledType[] getTypes() {
+        return ptypes;
+    }
+}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Kind.java	Sat Jun 09 16:52:12 2012 +0200
@@ -292,8 +292,8 @@
                     } else {
                         return " \"" + s + '"';
                     }
-                } else if (value instanceof RiType) {
-                    return "class " + RiUtil.toJavaName((RiType) value);
+                } else if (value instanceof JavaType) {
+                    return "class " + MetaUtil.toJavaName((JavaType) value);
                 } else if (value instanceof Enum || value instanceof FormatWithToString) {
                     return String.valueOf(value);
                 } else if (value instanceof Class< ? >) {
@@ -301,7 +301,7 @@
                 } else if (value.getClass().isArray()) {
                     return formatArray(value);
                 } else {
-                    return RiUtil.getSimpleName(value.getClass(), true) + "@" + System.identityHashCode(value);
+                    return MetaUtil.getSimpleName(value.getClass(), true) + "@" + System.identityHashCode(value);
                 }
             }
         } else {
@@ -315,7 +315,7 @@
         Class< ? > componentType = array.getClass().getComponentType();
         assert componentType != null;
         int arrayLength = Array.getLength(array);
-        StringBuilder buf = new StringBuilder(RiUtil.getSimpleName(componentType, true)).
+        StringBuilder buf = new StringBuilder(MetaUtil.getSimpleName(componentType, true)).
                         append('[').
                         append(arrayLength).
                         append("]{");
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Sat Jun 09 16:52:12 2012 +0200
@@ -29,19 +29,19 @@
 
 
     /**
-     * Returns the RiType object representing the base type for the given kind.
+     * Returns the JavaType object representing the base type for the given kind.
      */
-    RiResolvedType asRiType(Kind kind);
+    ResolvedJavaType getResolvedJavaType(Kind kind);
 
     /**
      * Returns the type of the given constant object.
      *
      * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()}
      */
-    RiResolvedType getTypeOf(Constant constant);
+    ResolvedJavaType getTypeOf(Constant constant);
 
 
-    RiResolvedType getType(Class<?> clazz);
+    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.
@@ -51,9 +51,9 @@
     boolean areConstantObjectsEqual(Constant x, Constant y);
 
     /**
-     * Provides the {@link RiMethod} for a {@link Method} obtained via reflection.
+     * Provides the {@link JavaMethod} for a {@link Method} obtained via reflection.
      */
-    RiResolvedMethod getRiMethod(Method reflectionMethod);
+    ResolvedJavaMethod getResolvedJavaMethod(Method reflectionMethod);
 
     /**
      * Gets the length of the array that is wrapped in a CiConstant object.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaUtil.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,133 @@
+/*
+ * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.api.meta;
+
+
+public class MetaUtil {
+
+
+
+    /**
+     * Extends the functionality of {@link Class#getSimpleName()} to include a non-empty string for anonymous and local
+     * classes.
+     *
+     * @param clazz the class for which the simple name is being requested
+     * @param withEnclosingClass specifies if the returned name should be qualified with the name(s) of the enclosing
+     *            class/classes of {@code clazz} (if any). This option is ignored if {@code clazz} denotes an anonymous
+     *            or local class.
+     * @return the simple name
+     */
+    public static String getSimpleName(Class< ? > clazz, boolean withEnclosingClass) {
+        final String simpleName = clazz.getSimpleName();
+        if (simpleName.length() != 0) {
+            if (withEnclosingClass) {
+                String prefix = "";
+                Class< ? > enclosingClass = clazz;
+                while ((enclosingClass = enclosingClass.getEnclosingClass()) != null) {
+                    prefix = prefix + enclosingClass.getSimpleName() + ".";
+                }
+                return prefix + simpleName;
+            }
+            return simpleName;
+        }
+        // Must be an anonymous or local class
+        final String name = clazz.getName();
+        int index = name.indexOf('$');
+        if (index == -1) {
+            return name;
+        }
+        index = name.lastIndexOf('.', index);
+        if (index == -1) {
+            return name;
+        }
+        return name.substring(index + 1);
+    }
+
+
+    /**
+     * Converts a given type to its Java programming language name. The following are examples of strings returned by
+     * this method:
+     *
+     * <pre>
+     *     qualified == true:
+     *         java.lang.Object
+     *         int
+     *         boolean[][]
+     *     qualified == false:
+     *         Object
+     *         int
+     *         boolean[][]
+     * </pre>
+     *
+     * @param riType the type to be converted to a Java name
+     * @param qualified specifies if the package prefix of the type should be included in the returned name
+     * @return the Java name corresponding to {@code riType}
+     */
+    public static String toJavaName(JavaType riType, boolean qualified) {
+        Kind kind = riType.kind();
+        if (kind.isPrimitive() || kind == Kind.Void) {
+            return kind.javaName;
+        }
+        return internalNameToJava(riType.name(), qualified);
+    }
+
+    /**
+     * Converts a given type to its Java programming language name. The following are examples of strings returned by
+     * this method:
+     *
+     * <pre>
+     *      java.lang.Object
+     *      int
+     *      boolean[][]
+     * </pre>
+     *
+     * @param riType the type to be converted to a Java name
+     * @return the Java name corresponding to {@code riType}
+     */
+    public static String toJavaName(JavaType riType) {
+        return (riType == null) ? null : internalNameToJava(riType.name(), true);
+    }
+
+    public static String internalNameToJava(String name, boolean qualified) {
+        switch (name.charAt(0)) {
+            case 'L': {
+                String result = name.substring(1, name.length() - 1).replace('/', '.');
+                if (!qualified) {
+                    final int lastDot = result.lastIndexOf('.');
+                    if (lastDot != -1) {
+                        result = result.substring(lastDot + 1);
+                    }
+                }
+                return result;
+
+            }
+            case '[':
+                return internalNameToJava(name.substring(1), qualified) + "[]";
+            default:
+                if (name.length() != 1) {
+                    throw new IllegalArgumentException("Illegal internal name: " + name);
+                }
+                return Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).javaName;
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ProfilingInfo.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.api.meta;
+
+/**
+ * Provides access to the profiling information of one specific method.
+ * Every accessor method returns the information that is available at the time of invocation.
+ * If a method is invoked multiple times, it may return significantly different results for every invocation
+ * as the profiling information may be changed by other Java threads at any time.
+ */
+public interface ProfilingInfo {
+
+    /**
+     * Gets the length of the code associated with this profile.
+     */
+    int codeSize();
+
+    /**
+     * Returns an estimate of how often the branch at the given byte code was taken.
+     * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or -1 if this information is not available.
+     */
+    double getBranchTakenProbability(int bci);
+
+    /**
+     * Returns an estimate of how often the switch cases are taken at the given BCI.
+     * The default case is stored as the last entry.
+     * @return A double value that contains the estimated probabilities, with 0.0 meaning never and 1.0 meaning always,
+     * or -1 if this information is not available.
+     */
+    double[] getSwitchProbabilities(int bci);
+
+    /**
+     * Returns the TypeProfile for the given BCI.
+     * @return Returns an JavaTypeProfile object, or null if not available.
+     */
+    JavaTypeProfile getTypeProfile(int bci);
+
+    /**
+     * Returns information if the given BCI did ever throw an exception.
+     * @return {@link ExceptionSeen#TRUE} if the instruction has thrown an exception at least once,
+     * {@link ExceptionSeen#FALSE} if it never threw an exception, and {@link ExceptionSeen#NOT_SUPPORTED}
+     * if this information was not recorded.
+     */
+    ExceptionSeen getExceptionSeen(int bci);
+
+    /**
+     * Returns an estimate how often the current BCI was executed. Avoid comparing execution counts to each other,
+     * as the returned value highly depends on the time of invocation.
+     * @return the estimated execution count or -1 if not available.
+     */
+    int getExecutionCount(int bci);
+
+    /**
+     * Returns how frequently a method was deoptimized for the given deoptimization reason. This only indicates how
+     * often the method did fall back to the interpreter for the execution and does not indicate how often it was recompiled.
+     * @param reason the reason for which the number of deoptimizations should be queried
+     * @return the number of times the compiled method deoptimized for the given reason.
+     */
+    int getDeoptimizationCount(DeoptimizationReason reason);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaField.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2009, 2011, 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.lang.annotation.*;
+import java.lang.reflect.*;
+
+/**
+ * Represents a reference to a resolved Java field. Fields, like methods and types, are
+ * resolved through {@link ConstantPool constant pools}.
+ */
+public interface ResolvedJavaField extends JavaField {
+
+    /**
+     * Gets the access flags for this field. Only the flags specified in the JVM specification
+     * will be included in the returned mask. The utility methods in the {@link Modifier} class
+     * should be used to query the returned mask for the presence/absence of individual flags.
+     * @return the mask of JVM defined field access flags defined for this field
+     */
+    int accessFlags();
+
+    /**
+     * Gets the constant value of this field if available.
+     * @param receiver object from which this field's value is to be read. This value is ignored if this field is static.
+     * @return the constant value of this field or {@code null} if the constant value is not available
+     */
+    Constant constantValue(Constant receiver);
+
+    /**
+     * Gets the holder of this field as a compiler-runtime interface type.
+     * @return the holder of this field
+     */
+    ResolvedJavaType holder();
+
+    /**
+     * Returns this field's annotation of a specified type.
+     *
+     * @param annotationClass the Class object corresponding to the annotation type
+     * @return the annotation of type {@code annotationClass} for this field if present, else null
+     */
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaMethod.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,215 @@
+/*
+ * Copyright (c) 2009, 2011, 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.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+/**
+ * Represents resolved Java methods. Methods, like fields and types, are resolved through
+ * {@link ConstantPool constant pools}.
+ */
+public interface ResolvedJavaMethod extends JavaMethod {
+
+    /**
+     * Gets the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
+     * The returned byte array does not contain breakpoints or non-Java bytecodes.
+     * @return the bytecode of the method or {@code null} if none is available
+     */
+    byte[] code();
+
+    /**
+     * Gets the size of the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
+     * @return the size of the bytecode in bytes, or 0 if no bytecode is available
+     */
+    int codeSize();
+
+    /**
+     * Gets the size of the compiled machine code.
+     * @return the size of the compiled machine code in bytes, or 0 if no compiled code exists.
+     */
+    int compiledCodeSize();
+
+    /**
+     * Gets an estimate how complex it is to compile this method.
+     * @return A value >= 0, where higher means more complex.
+     */
+    int compilationComplexity();
+
+    /**
+     * Gets the symbol used to link this method if it is native, otherwise {@code null}.
+     */
+    String jniSymbol();
+
+    /**
+     * Gets the type in which this method is declared.
+     * @return the type in which this method is declared
+     */
+    ResolvedJavaType holder();
+
+    /**
+     * Gets the maximum number of locals used in this method's bytecode.
+     * @return the maximum number of locals
+     */
+    int maxLocals();
+
+    /**
+     * Gets the maximum number of stack slots used in this method's bytecode.
+     * @return the maximum number of stack slots
+     */
+    int maxStackSize();
+
+    /**
+     * Checks whether this method has balanced monitor operations.
+     * @return {@code true} if the method has balanced monitor operations
+     */
+    boolean hasBalancedMonitors();
+
+    /**
+     * Gets the access flags for this method. Only the flags specified in the JVM specification
+     * will be included in the returned mask. The utility methods in the {@link Modifier} class
+     * should be used to query the returned mask for the presence/absence of individual flags.
+     * @return the mask of JVM defined method access flags defined for this method
+     */
+    int accessFlags();
+
+    /**
+     * Checks whether this method is a leaf method.
+     * @return {@code true} if the method is a leaf method (that is, is final or private)
+     */
+    boolean isLeafMethod();
+
+    /**
+     * Checks whether this method is a class initializer.
+     * @return {@code true} if the method is a class initializer
+     */
+    boolean isClassInitializer();
+
+    /**
+     * Checks whether this method is a constructor.
+     * @return {@code true} if the method is a constructor
+     */
+    boolean isConstructor();
+
+    /**
+     * Checks whether this method has been overridden. Decisions made based
+     * on a method being overridden must be registered as dependencies.
+     * @return {@code true} if the method has been overridden
+     */
+    boolean isOverridden();
+
+    /**
+     * Checks whether the compiler can insert safepoint polls in this method.
+     * @return {@code true} if the method cannot have safepoint polls inserted
+     */
+    boolean noSafepointPolls();
+
+    /**
+     * Checks whether this method can be statically bound (that is, it is final or private or static).
+     * @return {@code true} if this method can be statically bound
+     */
+    boolean canBeStaticallyBound();
+
+    /**
+     * Gets the list of exception handlers for this method.
+     * @return the list of exception handlers
+     */
+    ExceptionHandler[] exceptionHandlers();
+
+    /**
+     * Gets a stack trace element for this method and a given bytecode index.
+     */
+    StackTraceElement toStackTraceElement(int bci);
+
+    /**
+     * Temporary work-around to support the @ACCESSOR Maxine annotation.
+     * Non-Maxine VMs should just return {@code null}.
+     */
+    ResolvedJavaType accessor();
+
+    /**
+     * Gets the intrinsic id of this method.
+     */
+    String intrinsic();
+
+    /**
+     * Provides an estimate of how often this method has been executed.
+     * @return The number of invocations, or -1 if this information isn't available.
+     */
+    int invocationCount();
+
+    /**
+     * Returns an object that provides access to the method's profiling information.
+     * @return The profiling information recorded for this method.
+     */
+    ProfilingInfo profilingInfo();
+
+    /**
+     * Returns a map that the compiler can use to store objects that should survive the current compilation.
+     */
+    Map<Object, Object> compilerStorage();
+
+    /**
+     * Returns a pointer to the method's constant pool.
+     * @return the constant pool
+     */
+    ConstantPool getConstantPool();
+
+    /**
+     * Returns this method's annotation of a specified type.
+     *
+     * @param annotationClass the Class object corresponding to the annotation type
+     * @return the annotation of type {@code annotationClass} for this method if present, else null
+     */
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+
+    /**
+     * Returns an array of arrays that represent the annotations on the formal
+     * parameters, in declaration order, of this method.
+     *
+     * @see Method#getParameterAnnotations()
+     * @see CiUtil#getParameterAnnotation(int, JavaResolvedMethod)
+     */
+    Annotation[][] getParameterAnnotations();
+
+    /**
+     * Returns an array of {@link Type} objects that represent the formal
+     * parameter types, in declaration order, of this method.
+     *
+     * @see Method#getGenericParameterTypes()
+     */
+    Type[] getGenericParameterTypes();
+
+    /**
+     * Returns a {@link Type} object that represents the formal return type of this method.
+     *
+     * @see Method#getGenericReturnType()
+     */
+    Type getGenericReturnType();
+
+    /**
+     * @return {@code true} if this method can be inlined
+     */
+    boolean canBeInlined();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,187 @@
+/*
+ * Copyright (c) 2009, 2011, 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.lang.annotation.*;
+import java.lang.reflect.*;
+
+/**
+ * Represents a resolved Java types. Types include primitives, objects, {@code void},
+ * and arrays thereof. Types, like fields and methods, are resolved through {@link ConstantPool constant pools}.
+ */
+public interface ResolvedJavaType extends JavaType {
+
+    /**
+     * Gets the encoding of (that is, a constant representing the value of) the specified part of this type.
+     * @param r the part of the this type
+     * @return a constant representing a reference to the specified part of this type
+     */
+    Constant getEncoding(Representation r);
+
+    /**
+     * Checks whether this type has any subclasses so far. Any decisions
+     * based on this information require the registration of a dependency, since
+     * this information may change.
+     * @return {@code true} if this class has subclasses
+     */
+    boolean hasSubclass();
+
+    /**
+     * Checks whether this type has a finalizer method.
+     * @return {@code true} if this class has a finalizer
+     */
+    boolean hasFinalizer();
+
+    /**
+     * Checks whether this type has any finalizable subclasses so far. Any decisions
+     * based on this information require the registration of a dependency, since
+     * this information may change.
+     * @return {@code true} if this class has any subclasses with finalizers
+     */
+    boolean hasFinalizableSubclass();
+
+    /**
+     * Checks whether this type is an interface.
+     * @return {@code true} if this type is an interface
+     */
+    boolean isInterface();
+
+    /**
+     * Checks whether this type is an instance class.
+     * @return {@code true} if this type is an instance class
+     */
+    boolean isInstanceClass();
+
+    /**
+     * Checks whether this type is an array class.
+     * @return {@code true} if this type is an array class
+     */
+    boolean isArrayClass();
+
+    /**
+     * Gets the access flags for this type. Only the flags specified in the JVM specification
+     * will be included in the returned mask. The utility methods in the {@link Modifier} class
+     * should be used to query the returned mask for the presence/absence of individual flags.
+     * @return the mask of JVM defined class access flags defined for this type
+     */
+    int accessFlags();
+
+    /**
+     * Checks whether this type is initialized.
+     * @return {@code true} if this type is initialized
+     */
+    boolean isInitialized();
+
+    /**
+     * Checks whether this type is a subtype of another type.
+     * @param other the type to test
+     * @return {@code true} if this type a subtype of the specified type
+     */
+    boolean isSubtypeOf(ResolvedJavaType other);
+
+    /**
+     * Checks whether the specified object is an instance of this type.
+     * @param obj the object to test
+     * @return {@code true} if the object is an instance of this type
+     */
+    boolean isInstance(Constant obj);
+
+    /**
+     * Attempts to get an exact type for this type. Final classes,
+     * arrays of final classes, and primitive types all have exact types.
+     * @return the exact type of this type, if it exists; {@code null} otherwise
+     */
+    ResolvedJavaType exactType();
+
+    /**
+     * Gets the super type of this type or {@code null} if no such type exists.
+     */
+    ResolvedJavaType superType();
+
+    /**
+     * Walks the class hierarchy upwards and returns the least common type that is a super type of both
+     * the current and the given type.
+     * @return the least common type that is a super type of both the current and the given type, or null if primitive types are involved.
+     */
+    ResolvedJavaType leastCommonAncestor(ResolvedJavaType otherType);
+
+    /**
+     * Attempts to get the unique concrete subtype of this type.
+     * @return the exact type of this type, if it exists; {@code null} otherwise
+     */
+    ResolvedJavaType uniqueConcreteSubtype();
+
+    /**
+     * For array types, gets the type of the components.
+     * @return the component type of this array type
+     */
+    ResolvedJavaType componentType();
+
+    /**
+     * Gets the type representing an array with elements of this type.
+     * @return a new compiler interface type representing an array of this type
+     */
+    ResolvedJavaType arrayOf();
+
+    /**
+     * Resolves the method implementation for virtual dispatches on objects
+     * of this dynamic type.
+     * @param method the method to select the implementation of
+     * @return the method implementation that would be selected at runtime
+     */
+    ResolvedJavaMethod resolveMethodImpl(ResolvedJavaMethod method);
+
+    /**
+     * Given an JavaMethod a, returns a concrete JavaMethod b that is the only possible
+     * unique target for a virtual call on a(). Returns {@code null} if either no
+     * such concrete method or more than one such method exists. Returns the method a
+     * if a is a concrete method that is not overridden. If the compiler uses the
+     * result of this method for its compilation, it must register an assumption
+     * (see {@link CiAssumptions}), because dynamic class loading can invalidate
+     * the result of this method.
+     * @param method the method a for which a unique concrete target is searched
+     * @return the unique concrete target or {@code null} if no such target exists
+     *         or assumptions are not supported by this runtime
+     */
+    ResolvedJavaMethod uniqueConcreteMethod(ResolvedJavaMethod method);
+
+    /**
+     * Returns the instance fields declared in this class sorted by field offset.
+     * @return an array of instance fields
+     */
+    ResolvedJavaField[] declaredFields();
+
+    /**
+     * Returns this type's annotation of a specified type.
+     *
+     * @param annotationClass the Class object corresponding to the annotation type
+     * @return the annotation of type {@code annotationClass} for this type if present, else null
+     */
+    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
+
+    /**
+     * Returns the java.lang.Class object representing this JavaType instance or {@code null} if none exists.
+     * @return the java.lang.Class object
+     */
+    Class<?> toJava();
+}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiConstantPool.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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;
-
-/**
- * Represents the runtime representation of the constant pool that is
- * used by the compiler when parsing bytecode. The {@code lookupXXX} methods look up a constant
- * pool entry without performing resolution, and are used during compilation.
- */
-public interface RiConstantPool {
-
-    /**
-     * Makes sure that the type referenced by the specified constant pool entry is loaded and
-     * initialized. This can be used to compile time resolve a type. It works for field, method,
-     * or type constant pool entries.
-     * @param cpi the index of the constant pool entry that references the type
-     * @param opcode the opcode of the instruction that references the type
-     */
-    void loadReferencedType(int cpi, int opcode);
-
-    /**
-     * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks
-     * specific to the JVM instruction it denotes are performed if the field is already resolved.
-     * Should any of these checks fail, an {@linkplain RiField#isResolved() unresolved}
-     * field reference is returned.
-     *
-     * @param cpi the constant pool index
-     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
-     * @return a reference to the field at {@code cpi} in this pool
-     * @throws ClassFormatError if the entry at {@code cpi} is not a field
-     */
-    RiField lookupField(int cpi, int opcode);
-
-    /**
-     * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks
-     * specific to the JVM instruction it denotes are performed if the method is already resolved.
-     * Should any of these checks fail, an {@linkplain RiMethod#isResolved() unresolved}
-     * method reference is returned.
-     *
-     * @param cpi the constant pool index
-     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
-     * @return a reference to the method at {@code cpi} in this pool
-     * @throws ClassFormatError if the entry at {@code cpi} is not a method
-     */
-    RiMethod lookupMethod(int cpi, int opcode);
-
-    /**
-     * Looks up a reference to a type. If {@code opcode} is non-negative, then resolution checks
-     * specific to the JVM instruction it denotes are performed if the type is already resolved.
-     * Should any of these checks fail, an {@linkplain RiType#isResolved() unresolved}
-     * type reference is returned.
-     *
-     * @param cpi the constant pool index
-     * @param opcode the opcode of the instruction for which the lookup is being performed or {@code -1}
-     * @return a reference to the compiler interface type
-     */
-    RiType lookupType(int cpi, int opcode);
-
-    /**
-     * Looks up a method signature.
-     *
-     * @param cpi the constant pool index
-     * @return the method signature at index {@code cpi} in this constant pool
-     */
-    RiSignature lookupSignature(int cpi);
-
-    /**
-     * Looks up a constant at the specified index.
-     * @param cpi the constant pool index
-     * @return the {@code CiConstant} instance representing the constant
-     */
-    Object lookupConstant(int cpi);
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiDeoptReason.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.meta;
-
-
-public enum RiDeoptReason {
-    None,
-    NullCheckException,
-    BoundsCheckException,
-    ClassCastException,
-    ArrayStoreException,
-    UnreachedCode,
-    TypeCheckedInliningViolated,
-    OptimizedTypeCheckViolated,
-    NotCompiledExceptionHandler,
-    Unresolved,
-    JavaSubroutineMismatch,
-    ArithmeticException,
-    RuntimeConstraint;
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiExceptionHandler.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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;
-
-/**
- * Represents an exception handler within the bytecode.
- */
-public interface RiExceptionHandler {
-
-    /**
-     * Gets the start bytecode index of the protected range of this handler.
-     * @return the start bytecode index
-     */
-    int startBCI();
-
-    /**
-     * Gets the end bytecode index of the protected range of this handler.
-     * @return the end bytecode index
-     */
-    int endBCI();
-
-    /**
-     * Gets the bytecode index of the handler block of this handler.
-     * @return the handler block bytecode index
-     */
-    int handlerBCI();
-
-    /**
-     * Gets the index into the constant pool representing the type of exception
-     * caught by this handler.
-     * @return the constant pool index of the catch type
-     */
-    int catchTypeCPI();
-
-    /**
-     * Checks whether this handler catches all exceptions.
-     * @return {@code true} if this handler catches all exceptions
-     */
-    boolean isCatchAll();
-
-    /**
-     * The type of exception caught by this exception handler.
-     *
-     * @return the exception type
-     */
-    RiType catchType();
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiExceptionSeen.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.meta;
-
-
-/**
- * Represents the three possibilities that an exception was seen at a specific BCI.
- */
-public enum RiExceptionSeen {
-    TRUE,
-    FALSE,
-    NOT_SUPPORTED;
-
-    public static RiExceptionSeen get(boolean value) {
-        return value ? TRUE : FALSE;
-    }
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiField.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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;
-
-/**
- * Represents a reference to a field, including both resolved and unresolved fields. Fields, like methods and types, are
- * resolved through {@link RiConstantPool constant pools}, and their actual implementation is provided by the
- * {@link RiRuntime runtime} to the compiler.
- */
-public interface RiField {
-    /**
-     * Gets the name of this field as a string.
-     * @return the name of this field
-     */
-    String name();
-
-    /**
-     * Gets the type of this field as a compiler-runtime interface type.
-     * @return the type of this field
-     */
-    RiType type();
-
-    /**
-     * Gets the kind of this field.
-     * @return the kind
-     */
-    Kind kind();
-
-    /**
-     * Gets the holder of this field as a compiler-runtime interface type.
-     * @return the holder of this field
-     */
-    RiType holder();
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiMethod.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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;
-
-/**
- * Represents resolved and unresolved methods. Methods, like fields and types, are resolved through
- * {@link RiConstantPool constant pools}, and their actual implementation is provided by the {@link RiRuntime runtime}
- * to the compiler.
- */
-public interface RiMethod {
-
-    /**
-     * Gets the name of the method as a string.
-     * @return the name of the method
-     */
-    String name();
-
-    /**
-     * Gets the type in which this method is declared.
-     * @return the type in which this method is declared
-     */
-    RiType holder();
-
-    /**
-     * Gets the signature of the method.
-     * @return the signature of the method
-     */
-    RiSignature signature();
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiProfilingInfo.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.meta;
-
-/**
- * Provides access to the profiling information of one specific method.
- * Every accessor method returns the information that is available at the time of invocation.
- * If a method is invoked multiple times, it may return significantly different results for every invocation
- * as the profiling information may be changed by other Java threads at any time.
- */
-public interface RiProfilingInfo {
-
-    /**
-     * Gets the length of the code associated with this profile.
-     */
-    int codeSize();
-
-    /**
-     * Returns an estimate of how often the branch at the given byte code was taken.
-     * @return The estimated probability, with 0.0 meaning never and 1.0 meaning always, or -1 if this information is not available.
-     */
-    double getBranchTakenProbability(int bci);
-
-    /**
-     * Returns an estimate of how often the switch cases are taken at the given BCI.
-     * The default case is stored as the last entry.
-     * @return A double value that contains the estimated probabilities, with 0.0 meaning never and 1.0 meaning always,
-     * or -1 if this information is not available.
-     */
-    double[] getSwitchProbabilities(int bci);
-
-    /**
-     * Returns the TypeProfile for the given BCI.
-     * @return Returns an RiTypeProfile object, or null if not available.
-     */
-    RiTypeProfile getTypeProfile(int bci);
-
-    /**
-     * Returns information if the given BCI did ever throw an exception.
-     * @return {@link RiExceptionSeen#TRUE} if the instruction has thrown an exception at least once,
-     * {@link RiExceptionSeen#FALSE} if it never threw an exception, and {@link RiExceptionSeen#NOT_SUPPORTED}
-     * if this information was not recorded.
-     */
-    RiExceptionSeen getExceptionSeen(int bci);
-
-    /**
-     * Returns an estimate how often the current BCI was executed. Avoid comparing execution counts to each other,
-     * as the returned value highly depends on the time of invocation.
-     * @return the estimated execution count or -1 if not available.
-     */
-    int getExecutionCount(int bci);
-
-    /**
-     * Returns how frequently a method was deoptimized for the given deoptimization reason. This only indicates how
-     * often the method did fall back to the interpreter for the execution and does not indicate how often it was recompiled.
-     * @param reason the reason for which the number of deoptimizations should be queried
-     * @return the number of times the compiled method deoptimized for the given reason.
-     */
-    int getDeoptimizationCount(RiDeoptReason reason);
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedField.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,63 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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.lang.annotation.*;
-import java.lang.reflect.*;
-
-/**
- * Represents a reference to a resolved field. Fields, like methods and types, are
- * resolved through {@link RiConstantPool constant pools}, and their actual implementation is provided by the
- * {@link RiRuntime runtime} to the compiler.
- */
-public interface RiResolvedField extends RiField {
-
-    /**
-     * Gets the access flags for this field. Only the flags specified in the JVM specification
-     * will be included in the returned mask. The utility methods in the {@link Modifier} class
-     * should be used to query the returned mask for the presence/absence of individual flags.
-     * @return the mask of JVM defined field access flags defined for this field
-     */
-    int accessFlags();
-
-    /**
-     * Gets the constant value of this field if available.
-     * @param receiver object from which this field's value is to be read. This value is ignored if this field is static.
-     * @return the constant value of this field or {@code null} if the constant value is not available
-     */
-    Constant constantValue(Constant receiver);
-
-    /**
-     * Gets the holder of this field as a compiler-runtime interface type.
-     * @return the holder of this field
-     */
-    RiResolvedType holder();
-
-    /**
-     * Returns this field's annotation of a specified type.
-     *
-     * @param annotationClass the Class object corresponding to the annotation type
-     * @return the annotation of type {@code annotationClass} for this field if present, else null
-     */
-    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedMethod.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-
-/**
- * Represents resolved methods. Methods, like fields and types, are resolved through
- * {@link RiConstantPool constant pools}, and their actual implementation is provided by the {@link RiRuntime runtime}
- * to the compiler.
- */
-public interface RiResolvedMethod extends RiMethod {
-
-    /**
-     * Gets the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
-     * The returned byte array does not contain breakpoints or non-Java bytecodes.
-     * @return the bytecode of the method or {@code null} if none is available
-     */
-    byte[] code();
-
-    /**
-     * Gets the size of the bytecode of the method, if the method {@linkplain #isResolved()} and has code.
-     * @return the size of the bytecode in bytes, or 0 if no bytecode is available
-     */
-    int codeSize();
-
-    /**
-     * Gets the size of the compiled machine code.
-     * @return the size of the compiled machine code in bytes, or 0 if no compiled code exists.
-     */
-    int compiledCodeSize();
-
-    /**
-     * Gets an estimate how complex it is to compile this method.
-     * @return A value >= 0, where higher means more complex.
-     */
-    int compilationComplexity();
-
-    /**
-     * Gets the symbol used to link this method if it is native, otherwise {@code null}.
-     */
-    String jniSymbol();
-
-    /**
-     * Gets the type in which this method is declared.
-     * @return the type in which this method is declared
-     */
-    RiResolvedType holder();
-
-    /**
-     * Gets the maximum number of locals used in this method's bytecode.
-     * @return the maximum number of locals
-     */
-    int maxLocals();
-
-    /**
-     * Gets the maximum number of stack slots used in this method's bytecode.
-     * @return the maximum number of stack slots
-     */
-    int maxStackSize();
-
-    /**
-     * Checks whether this method has balanced monitor operations.
-     * @return {@code true} if the method has balanced monitor operations
-     */
-    boolean hasBalancedMonitors();
-
-    /**
-     * Gets the access flags for this method. Only the flags specified in the JVM specification
-     * will be included in the returned mask. The utility methods in the {@link Modifier} class
-     * should be used to query the returned mask for the presence/absence of individual flags.
-     * @return the mask of JVM defined method access flags defined for this method
-     */
-    int accessFlags();
-
-    /**
-     * Checks whether this method is a leaf method.
-     * @return {@code true} if the method is a leaf method (that is, is final or private)
-     */
-    boolean isLeafMethod();
-
-    /**
-     * Checks whether this method is a class initializer.
-     * @return {@code true} if the method is a class initializer
-     */
-    boolean isClassInitializer();
-
-    /**
-     * Checks whether this method is a constructor.
-     * @return {@code true} if the method is a constructor
-     */
-    boolean isConstructor();
-
-    /**
-     * Checks whether this method has been overridden. Decisions made based
-     * on a method being overridden must be registered as dependencies.
-     * @return {@code true} if the method has been overridden
-     */
-    boolean isOverridden();
-
-    /**
-     * Checks whether the compiler can insert safepoint polls in this method.
-     * @return {@code true} if the method cannot have safepoint polls inserted
-     */
-    boolean noSafepointPolls();
-
-    /**
-     * Checks whether this method can be statically bound (that is, it is final or private or static).
-     * @return {@code true} if this method can be statically bound
-     */
-    boolean canBeStaticallyBound();
-
-    /**
-     * Gets the list of exception handlers for this method.
-     * @return the list of exception handlers
-     */
-    RiExceptionHandler[] exceptionHandlers();
-
-    /**
-     * Gets a stack trace element for this method and a given bytecode index.
-     */
-    StackTraceElement toStackTraceElement(int bci);
-
-    /**
-     * Temporary work-around to support the @ACCESSOR Maxine annotation.
-     * Non-Maxine VMs should just return {@code null}.
-     */
-    RiResolvedType accessor();
-
-    /**
-     * Gets the intrinsic id of this method.
-     */
-    String intrinsic();
-
-    /**
-     * Provides an estimate of how often this method has been executed.
-     * @return The number of invocations, or -1 if this information isn't available.
-     */
-    int invocationCount();
-
-    /**
-     * Returns an object that provides access to the method's profiling information.
-     * @return The profiling information recorded for this method.
-     */
-    RiProfilingInfo profilingInfo();
-
-    /**
-     * Returns a map that the compiler can use to store objects that should survive the current compilation.
-     */
-    Map<Object, Object> compilerStorage();
-
-    /**
-     * Returns a pointer to the method's constant pool.
-     * @return the constant pool
-     */
-    RiConstantPool getConstantPool();
-
-    /**
-     * Returns this method's annotation of a specified type.
-     *
-     * @param annotationClass the Class object corresponding to the annotation type
-     * @return the annotation of type {@code annotationClass} for this method if present, else null
-     */
-    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
-
-    /**
-     * Returns an array of arrays that represent the annotations on the formal
-     * parameters, in declaration order, of this method.
-     *
-     * @see Method#getParameterAnnotations()
-     * @see CiUtil#getParameterAnnotation(int, RiResolvedMethod)
-     */
-    Annotation[][] getParameterAnnotations();
-
-    /**
-     * Returns an array of {@link Type} objects that represent the formal
-     * parameter types, in declaration order, of this method.
-     *
-     * @see Method#getGenericParameterTypes()
-     */
-    Type[] getGenericParameterTypes();
-
-    /**
-     * Returns a {@link Type} object that represents the formal return type of this method.
-     *
-     * @see Method#getGenericReturnType()
-     */
-    Type getGenericReturnType();
-
-    /**
-     * @return {@code true} if this method can be inlined
-     */
-    boolean canBeInlined();
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedType.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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.lang.annotation.*;
-import java.lang.reflect.*;
-
-/**
- * Represents a resolved in the compiler-runtime interface. Types include primitives, objects, {@code void},
- * and arrays thereof. Types, like fields and methods, are resolved through {@link RiConstantPool constant pools}, and
- * their actual implementation is provided by the {@link RiRuntime runtime} to the compiler.
- */
-public interface RiResolvedType extends RiType {
-
-    /**
-     * Gets the encoding of (that is, a constant representing the value of) the specified part of this type.
-     * @param r the part of the this type
-     * @return a constant representing a reference to the specified part of this type
-     */
-    Constant getEncoding(Representation r);
-
-    /**
-     * Checks whether this type has any subclasses so far. Any decisions
-     * based on this information require the registration of a dependency, since
-     * this information may change.
-     * @return {@code true} if this class has subclasses
-     */
-    boolean hasSubclass();
-
-    /**
-     * Checks whether this type has a finalizer method.
-     * @return {@code true} if this class has a finalizer
-     */
-    boolean hasFinalizer();
-
-    /**
-     * Checks whether this type has any finalizable subclasses so far. Any decisions
-     * based on this information require the registration of a dependency, since
-     * this information may change.
-     * @return {@code true} if this class has any subclasses with finalizers
-     */
-    boolean hasFinalizableSubclass();
-
-    /**
-     * Checks whether this type is an interface.
-     * @return {@code true} if this type is an interface
-     */
-    boolean isInterface();
-
-    /**
-     * Checks whether this type is an instance class.
-     * @return {@code true} if this type is an instance class
-     */
-    boolean isInstanceClass();
-
-    /**
-     * Checks whether this type is an array class.
-     * @return {@code true} if this type is an array class
-     */
-    boolean isArrayClass();
-
-    /**
-     * Gets the access flags for this type. Only the flags specified in the JVM specification
-     * will be included in the returned mask. The utility methods in the {@link Modifier} class
-     * should be used to query the returned mask for the presence/absence of individual flags.
-     * @return the mask of JVM defined class access flags defined for this type
-     */
-    int accessFlags();
-
-    /**
-     * Checks whether this type is initialized.
-     * @return {@code true} if this type is initialized
-     */
-    boolean isInitialized();
-
-    /**
-     * Checks whether this type is a subtype of another type.
-     * @param other the type to test
-     * @return {@code true} if this type a subtype of the specified type
-     */
-    boolean isSubtypeOf(RiResolvedType other);
-
-    /**
-     * Checks whether the specified object is an instance of this type.
-     * @param obj the object to test
-     * @return {@code true} if the object is an instance of this type
-     */
-    boolean isInstance(Constant obj);
-
-    /**
-     * Attempts to get an exact type for this type. Final classes,
-     * arrays of final classes, and primitive types all have exact types.
-     * @return the exact type of this type, if it exists; {@code null} otherwise
-     */
-    RiResolvedType exactType();
-
-    /**
-     * Gets the super type of this type or {@code null} if no such type exists.
-     */
-    RiResolvedType superType();
-
-    /**
-     * Walks the class hierarchy upwards and returns the least common type that is a super type of both
-     * the current and the given type.
-     * @return the least common type that is a super type of both the current and the given type, or null if primitive types are involved.
-     */
-    RiResolvedType leastCommonAncestor(RiResolvedType otherType);
-
-    /**
-     * Attempts to get the unique concrete subtype of this type.
-     * @return the exact type of this type, if it exists; {@code null} otherwise
-     */
-    RiResolvedType uniqueConcreteSubtype();
-
-    /**
-     * For array types, gets the type of the components.
-     * @return the component type of this array type
-     */
-    RiResolvedType componentType();
-
-    /**
-     * Gets the type representing an array with elements of this type.
-     * @return a new compiler interface type representing an array of this type
-     */
-    RiResolvedType arrayOf();
-
-    /**
-     * Resolves the method implementation for virtual dispatches on objects
-     * of this dynamic type.
-     * @param method the method to select the implementation of
-     * @return the method implementation that would be selected at runtime
-     */
-    RiResolvedMethod resolveMethodImpl(RiResolvedMethod method);
-
-    /**
-     * Given an RiMethod a, returns a concrete RiMethod b that is the only possible
-     * unique target for a virtual call on a(). Returns {@code null} if either no
-     * such concrete method or more than one such method exists. Returns the method a
-     * if a is a concrete method that is not overridden. If the compiler uses the
-     * result of this method for its compilation, it must register an assumption
-     * (see {@link CiAssumptions}), because dynamic class loading can invalidate
-     * the result of this method.
-     * @param method the method a for which a unique concrete target is searched
-     * @return the unique concrete target or {@code null} if no such target exists
-     *         or assumptions are not supported by this runtime
-     */
-    RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method);
-
-    /**
-     * Returns the instance fields declared in this class sorted by field offset.
-     * @return an array of instance fields
-     */
-    RiResolvedField[] declaredFields();
-
-    /**
-     * Returns this type's annotation of a specified type.
-     *
-     * @param annotationClass the Class object corresponding to the annotation type
-     * @return the annotation of type {@code annotationClass} for this type if present, else null
-     */
-    <T extends Annotation> T getAnnotation(Class<T> annotationClass);
-
-    /**
-     * Returns the java.lang.Class object representing this RiType instance or {@code null} if none exists.
-     * @return the java.lang.Class object
-     */
-    Class<?> toJava();
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiSignature.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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;
-
-/**
- * Represents a method signature provided by the runtime.
- *
- * @see <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#7035">Method Descriptors</a>
- */
-public interface RiSignature {
-    /**
-     * Gets the number of arguments in this signature, adding 1 for a receiver if requested.
-     *
-     * @param receiver true if 1 is to be added to the result for a receiver
-     * @return the number of arguments + 1 iff {@code receiver == true}
-     */
-    int argumentCount(boolean receiver);
-
-    /**
-     * Gets the argument type at the specified position. This method will return a
-     * {@linkplain RiType#isResolved() resolved} type if possible but without
-     * triggering any class loading or resolution.
-     *
-     * @param index the index into the parameters, with {@code 0} indicating the first parameter
-     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
-     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
-     *        not care for a resolved type.
-     * @return the {@code index}'th argument type
-     */
-    RiType argumentTypeAt(int index, RiResolvedType accessingClass);
-
-    /**
-     * Gets the argument kind at the specified position.
-     * @param index the index into the parameters, with {@code 0} indicating the first parameter
-     * @return the kind of the argument at the specified position
-     */
-    Kind argumentKindAt(int index);
-
-    /**
-     * Gets the return type of this signature. This method will return a
-     * {@linkplain RiResolvedType resolved} type if possible but without
-     * triggering any class loading or resolution.
-     *
-     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
-     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
-     *        not care for a resolved type.
-     * @return the compiler interface type representing the return type
-     */
-    RiType returnType(RiType accessingClass);
-
-    /**
-     * Gets the return kind of this signature.
-     * @return the return kind
-     */
-    Kind returnKind();
-
-    /**
-     * Converts this signature to a string.
-     * @return the signature as a string
-     */
-    String asString();
-
-    /**
-     * Gets the size, in Java slots, of the arguments to this signature.
-     * @param withReceiver {@code true} if to add a slot for a receiver object; {@code false} not to include the receiver
-     * @return the size of the arguments in slots
-     */
-    int argumentSlots(boolean withReceiver);
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiType.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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;
-
-/**
- * Represents a resolved or unresolved type in the compiler-runtime interface. Types include primitives, objects, {@code void},
- * and arrays thereof.
- */
-public interface RiType {
-
-    /**
-     * Represents each of the several different parts of the runtime representation of
-     * a type which compiled code may need to reference individually. These may or may not be
-     * different objects or data structures, depending on the runtime system.
-     */
-    public enum Representation {
-        /**
-         * The runtime representation of the data structure containing the static fields of this type.
-         */
-        StaticFields,
-
-        /**
-         * The runtime representation of the Java class object of this type.
-         */
-        JavaClass,
-
-        /**
-         * The runtime representation of the "hub" of this type--that is, the closest part of the type
-         * representation which is typically stored in the object header.
-         */
-        ObjectHub
-    }
-
-    /**
-     * Gets the name of this type in internal form. The following are examples of strings returned by this method:
-     * <pre>
-     *     "Ljava/lang/Object;"
-     *     "I"
-     *     "[[B"
-     * </pre>
-     *
-     * @return the name of this type in internal form
-     */
-    String name();
-
-    /**
-     * For array types, gets the type of the components.
-     * @return the component type of this array type
-     */
-    RiType componentType();
-
-    /**
-     * Gets the type representing an array with elements of this type.
-     * @return a new compiler interface type representing an array of this type
-     */
-    RiType arrayOf();
-
-    /**
-     * Gets the kind of this compiler interface type.
-     * @return the kind
-     */
-    Kind kind();
-
-    /**
-     * Gets the kind used to represent the specified part of this type.
-     * @param r the part of the this type
-     * @return the kind of constants for the specified part of the type
-     */
-    Kind getRepresentationKind(Representation r);
-
-    RiResolvedType resolve(RiResolvedType accessingClass);
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiTypeProfile.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2011, 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.*;
-
-/**
- * This profile object represents the type profile at a specific BCI. The precision of the supplied values may vary,
- * but a runtime that provides this information should be aware that it will be used to guide performance-critical
- * decisions like speculative inlining, etc.
- */
-public final class RiTypeProfile implements Serializable {
-
-    private static final long serialVersionUID = -6877016333706838441L;
-
-    /**
-     * A profiled type that has a probability. Profiled types are naturally sorted in
-     * descending order of their probabilities.
-     */
-    public static class ProfiledType implements Comparable<ProfiledType>, Serializable {
-        private static final long serialVersionUID = 7838575753661305744L;
-        public final RiResolvedType type;
-        public final double probability;
-
-        public ProfiledType(RiResolvedType type, double probability) {
-            assert type != null;
-            assert probability >= 0.0D && probability <= 1.0D;
-            this.type = type;
-            this.probability = probability;
-        }
-
-        @Override
-        public int compareTo(ProfiledType o) {
-            if (probability > o.probability) {
-                return -1;
-            } else if (probability < o.probability) {
-                return 1;
-            }
-            return 0;
-        }
-    }
-
-    private final double notRecordedProbability;
-    private final ProfiledType[] ptypes;
-
-    /**
-     * Determines if an array of profiled types are sorted in descending order of their probabilities.
-     */
-    public static boolean isSorted(ProfiledType[] ptypes) {
-        for (int i = 1; i < ptypes.length; i++) {
-            if (ptypes[i - 1].probability < ptypes[i].probability) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    public RiTypeProfile(double notRecordedProbability, ProfiledType... ptypes) {
-        this.ptypes = ptypes;
-        this.notRecordedProbability = notRecordedProbability;
-        assert isSorted(ptypes);
-    }
-
-    /**
-     * Returns the estimated probability of all types that could not be recorded due to profiling limitations.
-     * @return double value >= 0.0 and <= 1.0
-     */
-    public double getNotRecordedProbability() {
-        return notRecordedProbability;
-    }
-
-    /**
-     * A list of types for which the runtime has recorded probability information.
-     */
-    public ProfiledType[] getTypes() {
-        return ptypes;
-    }
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiUtil.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2012, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.meta;
-
-
-public class RiUtil {
-
-
-
-    /**
-     * Extends the functionality of {@link Class#getSimpleName()} to include a non-empty string for anonymous and local
-     * classes.
-     *
-     * @param clazz the class for which the simple name is being requested
-     * @param withEnclosingClass specifies if the returned name should be qualified with the name(s) of the enclosing
-     *            class/classes of {@code clazz} (if any). This option is ignored if {@code clazz} denotes an anonymous
-     *            or local class.
-     * @return the simple name
-     */
-    public static String getSimpleName(Class< ? > clazz, boolean withEnclosingClass) {
-        final String simpleName = clazz.getSimpleName();
-        if (simpleName.length() != 0) {
-            if (withEnclosingClass) {
-                String prefix = "";
-                Class< ? > enclosingClass = clazz;
-                while ((enclosingClass = enclosingClass.getEnclosingClass()) != null) {
-                    prefix = prefix + enclosingClass.getSimpleName() + ".";
-                }
-                return prefix + simpleName;
-            }
-            return simpleName;
-        }
-        // Must be an anonymous or local class
-        final String name = clazz.getName();
-        int index = name.indexOf('$');
-        if (index == -1) {
-            return name;
-        }
-        index = name.lastIndexOf('.', index);
-        if (index == -1) {
-            return name;
-        }
-        return name.substring(index + 1);
-    }
-
-
-    /**
-     * Converts a given type to its Java programming language name. The following are examples of strings returned by
-     * this method:
-     *
-     * <pre>
-     *     qualified == true:
-     *         java.lang.Object
-     *         int
-     *         boolean[][]
-     *     qualified == false:
-     *         Object
-     *         int
-     *         boolean[][]
-     * </pre>
-     *
-     * @param riType the type to be converted to a Java name
-     * @param qualified specifies if the package prefix of the type should be included in the returned name
-     * @return the Java name corresponding to {@code riType}
-     */
-    public static String toJavaName(RiType riType, boolean qualified) {
-        Kind kind = riType.kind();
-        if (kind.isPrimitive() || kind == Kind.Void) {
-            return kind.javaName;
-        }
-        return internalNameToJava(riType.name(), qualified);
-    }
-
-    /**
-     * Converts a given type to its Java programming language name. The following are examples of strings returned by
-     * this method:
-     *
-     * <pre>
-     *      java.lang.Object
-     *      int
-     *      boolean[][]
-     * </pre>
-     *
-     * @param riType the type to be converted to a Java name
-     * @return the Java name corresponding to {@code riType}
-     */
-    public static String toJavaName(RiType riType) {
-        return (riType == null) ? null : internalNameToJava(riType.name(), true);
-    }
-
-    public static String internalNameToJava(String name, boolean qualified) {
-        switch (name.charAt(0)) {
-            case 'L': {
-                String result = name.substring(1, name.length() - 1).replace('/', '.');
-                if (!qualified) {
-                    final int lastDot = result.lastIndexOf('.');
-                    if (lastDot != -1) {
-                        result = result.substring(lastDot + 1);
-                    }
-                }
-                return result;
-
-            }
-            case '[':
-                return internalNameToJava(name.substring(1), qualified) + "[]";
-            default:
-                if (name.length() != 1) {
-                    throw new IllegalArgumentException("Illegal internal name: " + name);
-                }
-                return Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0)).javaName;
-        }
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Signature.java	Sat Jun 09 16:52:12 2012 +0200
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2009, 2011, 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;
+
+/**
+ * Represents a method signature provided by the runtime.
+ *
+ * @see <a href="http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#7035">Method Descriptors</a>
+ */
+public interface Signature {
+    /**
+     * Gets the number of arguments in this signature, adding 1 for a receiver if requested.
+     *
+     * @param receiver true if 1 is to be added to the result for a receiver
+     * @return the number of arguments + 1 iff {@code receiver == true}
+     */
+    int argumentCount(boolean receiver);
+
+    /**
+     * Gets the argument type at the specified position. This method will return a
+     * {@linkplain JavaType#isResolved() resolved} type if possible but without
+     * triggering any class loading or resolution.
+     *
+     * @param index the index into the parameters, with {@code 0} indicating the first parameter
+     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
+     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
+     *        not care for a resolved type.
+     * @return the {@code index}'th argument type
+     */
+    JavaType argumentTypeAt(int index, ResolvedJavaType accessingClass);
+
+    /**
+     * Gets the argument kind at the specified position.
+     * @param index the index into the parameters, with {@code 0} indicating the first parameter
+     * @return the kind of the argument at the specified position
+     */
+    Kind argumentKindAt(int index);
+
+    /**
+     * Gets the return type of this signature. This method will return a
+     * {@linkplain ResolvedJavaType resolved} type if possible but without
+     * triggering any class loading or resolution.
+     *
+     * @param accessingClass the context of the type lookup. If accessing class is resolved, its class loader
+     *        is used to retrieve an existing resolved type. This value can be {@code null} if the caller does
+     *        not care for a resolved type.
+     * @return the compiler interface type representing the return type
+     */
+    JavaType returnType(JavaType accessingClass);
+
+    /**
+     * Gets the return kind of this signature.
+     * @return the return kind
+     */
+    Kind returnKind();
+
+    /**
+     * Converts this signature to a string.
+     * @return the signature as a string
+     */
+    String asString();
+
+    /**
+     * Gets the size, in Java slots, of the arguments to this signature.
+     * @param withReceiver {@code true} if to add a slot for a receiver object; {@code false} not to include the receiver
+     * @return the size of the arguments in slots
+     */
+    int argumentSlots(boolean withReceiver);
+}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/package-info.java	Sat Jun 09 16:52:12 2012 +0200
@@ -21,17 +21,6 @@
  * questions.
  */
 /**
- * The runtime-provided part of the bi-directional interface between the compiler and the runtime system of a virtual machine for the
- * instruction set defined in {@link com.oracle.graal.compiler.graphbuilder.Bytecodes}.
- * <p>
- * Unlike the {@link com.oracle.max.cri.ci compiler-provided interface}, the runtime-provided interface is specified largely
- * using interfaces, that must be implemented by classes provided by a specific runtime implementation.
- * <p>
- * {@link com.oracle.max.cri.ri.RiRuntime} encapsulates the main functionality of the runtime for the compiler.
- * <p>
- * Types (i.e., primitives, classes and interfaces}, fields and methods are represented by {@link com.oracle.graal.api.meta.RiType},
- * {@link com.oracle.graal.api.meta.RiField} and {@link com.oracle.graal.api.meta.RiMethod}, respectively, with additional support from
- * {@link com.oracle.graal.api.meta.RiSignature} and {@link com.oracle.graal.api.meta.RiExceptionHandler}. Access to the runtime constant pool
- * is through {@link com.oracle.graal.api.meta.RiConstantPool}.
+ * Package for interfaces that allow access to the meta data of the virtual machine.
  */
 package com.oracle.graal.api.meta;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java	Sat Jun 09 16:52:12 2012 +0200
@@ -74,7 +74,7 @@
     }
 
 
-    public CiTargetMethod compileMethod(final RiResolvedMethod method, final StructuredGraph graph, int osrBCI, final RiGraphCache cache, final PhasePlan plan, final OptimisticOptimizations optimisticOpts) {
+    public CiTargetMethod compileMethod(final ResolvedJavaMethod method, final StructuredGraph graph, int osrBCI, final RiGraphCache cache, final PhasePlan plan, final OptimisticOptimizations optimisticOpts) {
         assert (method.accessFlags() & Modifier.NATIVE) == 0 : "compiling native methods is not supported";
         if (osrBCI != -1) {
             throw new CiBailout("No OSR supported");
@@ -235,7 +235,7 @@
         });
     }
 
-    public FrameMap emitLIR(final LIR lir, StructuredGraph graph, final RiResolvedMethod method, CiAssumptions assumptions) {
+    public FrameMap emitLIR(final LIR lir, StructuredGraph graph, final ResolvedJavaMethod method, CiAssumptions assumptions) {
         final FrameMap frameMap = backend.newFrameMap(runtime.getRegisterConfig(method));
         final LIRGenerator lirGenerator = backend.newLIRGenerator(graph, frameMap, method, lir, xir, assumptions);
 
@@ -262,7 +262,7 @@
         return frameMap;
     }
 
-    public CiTargetMethod emitCode(CiAssumptions assumptions, RiResolvedMethod method, LIR lir, FrameMap frameMap) {
+    public CiTargetMethod emitCode(CiAssumptions assumptions, ResolvedJavaMethod method, LIR lir, FrameMap frameMap) {
         TargetMethodAssembler tasm = backend.newAssembler(frameMap, lir);
         backend.emitCode(tasm, method, lir);
         CiTargetMethod targetMethod = tasm.finishTargetMethod(method, false);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/OptimisticOptimizations.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/OptimisticOptimizations.java	Sat Jun 09 16:52:12 2012 +0200
@@ -45,20 +45,20 @@
 
     private final Set<Optimization> enabledOpts;
 
-    public OptimisticOptimizations(RiResolvedMethod method) {
+    public OptimisticOptimizations(ResolvedJavaMethod method) {
         this.enabledOpts = EnumSet.noneOf(Optimization.class);
 
-        RiProfilingInfo profilingInfo = method.profilingInfo();
-        if (checkDeoptimizations(profilingInfo, RiDeoptReason.UnreachedCode)) {
+        ProfilingInfo profilingInfo = method.profilingInfo();
+        if (checkDeoptimizations(profilingInfo, DeoptimizationReason.UnreachedCode)) {
             enabledOpts.add(Optimization.RemoveNeverExecutedCode);
         }
-        if (checkDeoptimizations(profilingInfo, RiDeoptReason.TypeCheckedInliningViolated)) {
+        if (checkDeoptimizations(profilingInfo, DeoptimizationReason.TypeCheckedInliningViolated)) {
             enabledOpts.add(Optimization.UseTypeCheckedInlining);
         }
-        if (checkDeoptimizations(profilingInfo, RiDeoptReason.OptimizedTypeCheckViolated)) {
+        if (checkDeoptimizations(profilingInfo, DeoptimizationReason.OptimizedTypeCheckViolated)) {
             enabledOpts.add(Optimization.UseTypeCheckHints);
         }
-        if (checkDeoptimizations(profilingInfo, RiDeoptReason.NotCompiledExceptionHandler)) {
+        if (checkDeoptimizations(profilingInfo, DeoptimizationReason.NotCompiledExceptionHandler)) {
             enabledOpts.add(Optimization.UseExceptionProbability);
         }
     }
@@ -67,7 +67,7 @@
         this.enabledOpts = enabledOpts;
     }
 
-    public void log(RiMethod method) {
+    public void log(JavaMethod method) {
         for (Optimization opt: Optimization.values()) {
             if (!enabledOpts.contains(opt)) {
                 if (GraalOptions.PrintDisabledOptimisticOptimizations) {
@@ -111,7 +111,7 @@
         return false;
     }
 
-    private static boolean checkDeoptimizations(RiProfilingInfo profilingInfo, RiDeoptReason reason) {
+    private static boolean checkDeoptimizations(ProfilingInfo profilingInfo, DeoptimizationReason reason) {
         return profilingInfo.getDeoptimizationCount(reason) < GraalOptions.DeoptsToDisableOptimisticOptimization;
     }
 }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/ComputeLinearScanOrder.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/ComputeLinearScanOrder.java	Sat Jun 09 16:52:12 2012 +0200
@@ -38,17 +38,17 @@
     List<Block> linearScanOrder; // the resulting list of blocks in correct order
     List<Block> codeEmittingOrder;
 
-    final BitMap visitedBlocks; // used for recursive processing of blocks
-    final BitMap activeBlocks; // used for recursive processing of blocks
-    final BitMap dominatorBlocks; // temporary BitMap used for computation of dominator
+    final BitSet visitedBlocks; // used for recursive processing of blocks
+    final BitSet activeBlocks; // used for recursive processing of blocks
+    final BitSet dominatorBlocks; // temporary BitMap used for computation of dominator
     final int[] forwardBranches; // number of incoming forward branches for each block
     final List<Block> workList; // temporary list (used in markLoops and computeOrder)
     final Block[] loopHeaders;
 
     // accessors for visitedBlocks and activeBlocks
     void initVisited() {
-        activeBlocks.clearAll();
-        visitedBlocks.clearAll();
+        activeBlocks.clear();
+        visitedBlocks.clear();
     }
 
     boolean isVisited(Block b) {
@@ -91,9 +91,9 @@
     public ComputeLinearScanOrder(int maxBlockId, int loopCount, Block startBlock) {
         loopHeaders = new Block[loopCount];
 
-        visitedBlocks = new BitMap(maxBlockId);
-        activeBlocks = new BitMap(maxBlockId);
-        dominatorBlocks = new BitMap(maxBlockId);
+        visitedBlocks = new BitSet(maxBlockId);
+        activeBlocks = new BitSet(maxBlockId);
+        dominatorBlocks = new BitSet(maxBlockId);
         forwardBranches = new int[maxBlockId];
         workList = new ArrayList<>(8);
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Sat Jun 09 16:52:12 2012 +0200
@@ -50,7 +50,7 @@
 public final class LinearScan {
 
     final CiTarget target;
-    final RiMethod method;
+    final JavaMethod method;
     final LIR ir;
     final LIRGenerator gen;
     final FrameMap frameMap;
@@ -66,7 +66,7 @@
          * in this block.
          * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.oracle.max.cri.Value.RiValue.ci.CiValue) operand number}.
          */
-        public BitMap liveIn;
+        public BitSet liveIn;
 
         /**
          * Bit map specifying which {@linkplain OperandPool operands} are live upon exit from this block.
@@ -74,20 +74,20 @@
          * upon entry to this block.
          * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.oracle.max.cri.Value.RiValue.ci.CiValue) operand number}.
          */
-        public BitMap liveOut;
+        public BitSet liveOut;
 
         /**
          * Bit map specifying which {@linkplain OperandPool operands} are used (before being defined) in this block.
          * That is, these are the values that are live upon entry to the block.
          * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.oracle.max.cri.Value.RiValue.ci.CiValue) operand number}.
          */
-        public BitMap liveGen;
+        public BitSet liveGen;
 
         /**
          * Bit map specifying which {@linkplain OperandPool operands} are defined/overwritten in this block.
          * The bit index of an operand is its {@linkplain OperandPool#operandNumber(com.oracle.max.cri.Value.RiValue.ci.CiValue) operand number}.
          */
-        public BitMap liveKill;
+        public BitSet liveKill;
     }
 
     public final BlockMap<BlockData> blockData;
@@ -150,7 +150,7 @@
     private final int firstVariableNumber;
 
 
-    public LinearScan(CiTarget target, RiResolvedMethod method, LIR ir, LIRGenerator gen, FrameMap frameMap) {
+    public LinearScan(CiTarget target, ResolvedJavaMethod method, LIR ir, LIRGenerator gen, FrameMap frameMap) {
         this.target = target;
         this.method = method;
         this.ir = ir;
@@ -651,8 +651,8 @@
         // iterate all blocks
         for (int i = 0; i < numBlocks; i++) {
             final Block block = blockAt(i);
-            final BitMap liveGen = new BitMap(liveSize);
-            final BitMap liveKill = new BitMap(liveSize);
+            final BitSet liveGen = new BitSet(liveSize);
+            final BitSet liveKill = new BitSet(liveSize);
 
             List<LIRInstruction> instructions = block.lir;
             int numInst = instructions.size();
@@ -728,8 +728,8 @@
 
             blockData.get(block).liveGen = liveGen;
             blockData.get(block).liveKill = liveKill;
-            blockData.get(block).liveIn = new BitMap(liveSize);
-            blockData.get(block).liveOut = new BitMap(liveSize);
+            blockData.get(block).liveIn = new BitSet(liveSize);
+            blockData.get(block).liveOut = new BitSet(liveSize);
 
             if (GraalOptions.TraceLinearScanLevel >= 4) {
                 TTY.println("liveGen  B%d %s", block.getId(), blockData.get(block).liveGen);
@@ -738,7 +738,7 @@
         } // end of block iteration
     }
 
-    private void verifyTemp(BitMap liveKill, Value operand) {
+    private void verifyTemp(BitSet liveKill, Value operand) {
         // fixed intervals are never live at block boundaries, so
         // they need not be processed in live sets
         // process them only in debug mode so that this can be checked
@@ -749,7 +749,7 @@
         }
     }
 
-    private void verifyInput(Block block, BitMap liveKill, Value operand) {
+    private void verifyInput(Block block, BitSet liveKill, Value operand) {
         // fixed intervals are never live at block boundaries, so
         // they need not be processed in live sets.
         // this is checked by these assertions to be sure about it.
@@ -771,7 +771,7 @@
         boolean changeOccurred;
         boolean changeOccurredInBlock;
         int iterationCount = 0;
-        BitMap liveOut = new BitMap(liveSetSize()); // scratch set for calculations
+        BitSet liveOut = new BitSet(liveSetSize()); // scratch set for calculations
 
         // Perform a backward dataflow analysis to compute liveOut and liveIn for each block.
         // The loop is executed until a fixpoint is reached (no changes in an iteration)
@@ -789,17 +789,18 @@
                 if (n > 0) {
                     // block has successors
                     if (n > 0) {
-                        liveOut.setFrom(blockData.get(block.suxAt(0)).liveIn);
+                        liveOut.clear();
+                        liveOut.or(blockData.get(block.suxAt(0)).liveIn);
                         for (int j = 1; j < n; j++) {
-                            liveOut.setUnion(blockData.get(block.suxAt(j)).liveIn);
+                            liveOut.or(blockData.get(block.suxAt(j)).liveIn);
                         }
                     } else {
-                        liveOut.clearAll();
+                        liveOut.clear();
                     }
 
-                    if (!blockData.get(block).liveOut.isSame(liveOut)) {
+                    if (!blockData.get(block).liveOut.equals(liveOut)) {
                         // A change occurred. Swap the old and new live out sets to avoid copying.
-                        BitMap temp = blockData.get(block).liveOut;
+                        BitSet temp = blockData.get(block).liveOut;
                         blockData.get(block).liveOut = liveOut;
                         liveOut = temp;
 
@@ -811,10 +812,11 @@
                 if (iterationCount == 0 || changeOccurredInBlock) {
                     // liveIn(block) is the union of liveGen(block) with (liveOut(block) & !liveKill(block))
                     // note: liveIn has to be computed only in first iteration or if liveOut has changed!
-                    BitMap liveIn = blockData.get(block).liveIn;
-                    liveIn.setFrom(blockData.get(block).liveOut);
-                    liveIn.setDifference(blockData.get(block).liveKill);
-                    liveIn.setUnion(blockData.get(block).liveGen);
+                    BitSet liveIn = blockData.get(block).liveIn;
+                    liveIn.clear();
+                    liveIn.or(blockData.get(block).liveOut);
+                    liveIn.andNot(blockData.get(block).liveKill);
+                    liveIn.or(blockData.get(block).liveGen);
                 }
 
                 if (GraalOptions.TraceLinearScanLevel >= 4) {
@@ -834,8 +836,8 @@
 
         // check that the liveIn set of the first block is empty
         Block startBlock = ir.cfg.getStartBlock();
-        BitMap liveInArgs = new BitMap(blockData.get(startBlock).liveIn.size());
-        if (!blockData.get(startBlock).liveIn.isSame(liveInArgs)) {
+        BitSet liveInArgs = new BitSet(blockData.get(startBlock).liveIn.size());
+        if (!blockData.get(startBlock).liveIn.equals(liveInArgs)) {
             if (GraalOptions.DetailedAsserts) {
                 reportFailure(numBlocks);
             }
@@ -1107,7 +1109,7 @@
             assert blockTo == instructions.get(instructions.size() - 1).id();
 
             // Update intervals for operands live at the end of this block;
-            BitMap live = blockData.get(block).liveOut;
+            BitSet live = blockData.get(block).liveOut;
             for (int operandNum = live.nextSetBit(0); operandNum >= 0; operandNum = live.nextSetBit(operandNum + 1)) {
                 assert live.get(operandNum) : "should not stop here otherwise";
                 Value operand = operandFor(operandNum);
@@ -1421,7 +1423,7 @@
         assert moveResolver.checkEmpty();
 
         int numOperands = operandSize();
-        BitMap liveAtEdge = blockData.get(toBlock).liveIn;
+        BitSet liveAtEdge = blockData.get(toBlock).liveIn;
 
         // visit all variables for which the liveAtEdge bit is set
         for (int operandNum = liveAtEdge.nextSetBit(0); operandNum >= 0; operandNum = liveAtEdge.nextSetBit(operandNum + 1)) {
@@ -1482,8 +1484,8 @@
     void resolveDataFlow() {
         int numBlocks = blockCount();
         MoveResolver moveResolver = new MoveResolver(this);
-        BitMap blockCompleted = new BitMap(numBlocks);
-        BitMap alreadyResolved = new BitMap(numBlocks);
+        BitSet blockCompleted = new BitSet(numBlocks);
+        BitSet alreadyResolved = new BitSet(numBlocks);
 
         int i;
         for (i = 0; i < numBlocks; i++) {
@@ -1521,7 +1523,8 @@
         for (i = 0; i < numBlocks; i++) {
             if (!blockCompleted.get(i)) {
                 Block fromBlock = blockAt(i);
-                alreadyResolved.setFrom(blockCompleted);
+                alreadyResolved.clear();
+                alreadyResolved.or(blockCompleted);
 
                 int numSux = fromBlock.numberOfSux();
                 for (int s = 0; s < numSux; s++) {
@@ -2081,7 +2084,7 @@
 
         for (int i = 0; i < numBlocks; i++) {
             Block block = blockAt(i);
-            BitMap liveAtEdge = blockData.get(block).liveIn;
+            BitSet liveAtEdge = blockData.get(block).liveIn;
 
             // visit all operands where the liveAtEdge bit is set
             for (int operandNum = liveAtEdge.nextSetBit(0); operandNum >= 0; operandNum = liveAtEdge.nextSetBit(operandNum + 1)) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,7 +32,7 @@
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.code.CiTargetMethod.*;
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiType.*;
+import com.oracle.graal.api.meta.JavaType.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.util.*;
 import com.oracle.graal.debug.*;
@@ -68,9 +68,9 @@
  */
 public abstract class LIRGenerator extends LIRGeneratorTool {
     protected final Graph graph;
-    protected final RiRuntime runtime;
+    protected final CodeCacheProvider runtime;
     protected final CiTarget target;
-    protected final RiResolvedMethod method;
+    protected final ResolvedJavaMethod method;
     protected final FrameMap frameMap;
     public final NodeMap<Value> nodeOperands;
 
@@ -142,7 +142,7 @@
     private LockScope curLocks;
 
 
-    public LIRGenerator(Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
+    public LIRGenerator(Graph graph, CodeCacheProvider runtime, CiTarget target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
         this.graph = graph;
         this.runtime = runtime;
         this.target = target;
@@ -685,7 +685,7 @@
     }
 
     @Override
-    public void emitGuardCheck(BooleanNode comp, RiDeoptReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+    public void emitGuardCheck(BooleanNode comp, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
         if (comp instanceof IsNullNode && negated) {
             emitNullCheckGuard(((IsNullNode) comp).object(), leafGraphId);
         } else if (comp instanceof ConstantNode && (comp.asConstant().asBoolean() != negated)) {
@@ -817,7 +817,7 @@
         return stateAfter.duplicateModified(bci, stateAfter.rethrowException(), call.returnKind(), toJVMArgumentStack(call.targetMethod().signature(), call.isStatic(), call.arguments()));
     }
 
-    private static ValueNode[] toJVMArgumentStack(RiSignature signature, boolean isStatic, NodeInputList<ValueNode> arguments) {
+    private static ValueNode[] toJVMArgumentStack(Signature signature, boolean isStatic, NodeInputList<ValueNode> arguments) {
         int slotCount = signature.argumentSlots(!isStatic);
         ValueNode[] stack = new ValueNode[slotCount];
         int stackIndex = 0;
@@ -849,7 +849,7 @@
     @Override
     public void emitInvoke(Invoke x) {
         MethodCallTargetNode callTarget = x.callTarget();
-        RiMethod targetMethod = callTarget.targetMethod();
+        JavaMethod targetMethod = callTarget.targetMethod();
 
         XirSnippet snippet = null;
         XirArgument receiver;
@@ -937,7 +937,7 @@
     }
 
 
-    protected abstract LabelRef createDeoptStub(CiDeoptAction action, RiDeoptReason reason, LIRDebugInfo info, Object deoptInfo);
+    protected abstract LabelRef createDeoptStub(CiDeoptAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo);
 
     @Override
     public Variable emitCall(@SuppressWarnings("hiding") Object target, Kind result, Kind[] arguments, boolean canTrap, Value... args) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BoxingEliminationPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/BoxingEliminationPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -67,7 +67,7 @@
             PhiNode result = null;
             ObjectStamp stamp = phiNode.objectStamp();
             if (stamp.nonNull() && stamp.isExactType()) {
-                RiResolvedType type = stamp.type();
+                ResolvedJavaType type = stamp.type();
                 if (type != null && type.toJava() == kind.toBoxedJavaClass()) {
                     StructuredGraph graph = (StructuredGraph) phiNode.graph();
                     result = graph.add(new PhiNode(kind, phiNode.merge()));
@@ -122,7 +122,7 @@
         ((StructuredGraph) boxNode.graph()).removeFixed(boxNode);
     }
 
-    private static void virtualizeUsages(ValueNode boxNode, ValueNode replacement, RiResolvedType exactType) {
+    private static void virtualizeUsages(ValueNode boxNode, ValueNode replacement, ResolvedJavaType exactType) {
         ValueNode virtualValueNode = null;
         VirtualObjectNode virtualObjectNode = null;
         for (Node n : boxNode.usages().filter(NodePredicates.isA(FrameState.class).or(VirtualObjectFieldNode.class)).snapshot()) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -42,14 +42,14 @@
     private final int newNodesMark;
     private final CiTarget target;
     private final CiAssumptions assumptions;
-    private final RiRuntime runtime;
+    private final CodeCacheProvider runtime;
     private final IsImmutablePredicate immutabilityPredicate;
     private final Iterable<Node> initWorkingSet;
 
     private NodeWorkList workList;
     private Tool tool;
 
-    public CanonicalizerPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions) {
+    public CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions) {
         this(target, runtime, assumptions, null, 0, null);
     }
 
@@ -60,7 +60,7 @@
      * @param workingSet the initial working set of nodes on which the canonicalizer works, should be an auto-grow node bitmap
      * @param immutabilityPredicate
      */
-    public CanonicalizerPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions, Iterable<Node> workingSet, IsImmutablePredicate immutabilityPredicate) {
+    public CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions, Iterable<Node> workingSet, IsImmutablePredicate immutabilityPredicate) {
         this(target, runtime, assumptions, workingSet, 0, immutabilityPredicate);
     }
 
@@ -68,11 +68,11 @@
      * @param newNodesMark only the {@linkplain Graph#getNewNodes(int) new nodes} specified by
      *            this mark are processed otherwise all nodes in the graph are processed
      */
-    public CanonicalizerPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
+    public CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
         this(target, runtime, assumptions, null, newNodesMark, immutabilityPredicate);
     }
 
-    private CanonicalizerPhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions, Iterable<Node> workingSet, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
+    private CanonicalizerPhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions, Iterable<Node> workingSet, int newNodesMark, IsImmutablePredicate immutabilityPredicate) {
         this.newNodesMark = newNodesMark;
         this.target = target;
         this.assumptions = assumptions;
@@ -223,12 +223,12 @@
     private static final class Tool implements SimplifierTool {
 
         private final NodeWorkList nodeWorkSet;
-        private final RiRuntime runtime;
+        private final CodeCacheProvider runtime;
         private final CiTarget target;
         private final CiAssumptions assumptions;
         private final IsImmutablePredicate immutabilityPredicate;
 
-        public Tool(NodeWorkList nodeWorkSet, RiRuntime runtime, CiTarget target, CiAssumptions assumptions, IsImmutablePredicate immutabilityPredicate) {
+        public Tool(NodeWorkList nodeWorkSet, CodeCacheProvider runtime, CiTarget target, CiAssumptions assumptions, IsImmutablePredicate immutabilityPredicate) {
             this.nodeWorkSet = nodeWorkSet;
             this.runtime = runtime;
             this.target = target;
@@ -259,7 +259,7 @@
         }
 
         @Override
-        public RiRuntime runtime() {
+        public CodeCacheProvider runtime() {
             return runtime;
         }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CheckCastEliminationPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CheckCastEliminationPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -56,7 +56,7 @@
 
     public static class State implements MergeableState<State> {
 
-        private IdentityHashMap<ValueNode, RiResolvedType> knownTypes;
+        private IdentityHashMap<ValueNode, ResolvedJavaType> knownTypes;
         private HashSet<ValueNode> knownNotNull;
         private HashSet<ValueNode> knownNull;
         private IdentityHashMap<BooleanNode, ValueNode> trueConditions;
@@ -80,18 +80,18 @@
 
         @Override
         public boolean merge(MergeNode merge, List<State> withStates) {
-            IdentityHashMap<ValueNode, RiResolvedType> newKnownTypes = new IdentityHashMap<>();
+            IdentityHashMap<ValueNode, ResolvedJavaType> newKnownTypes = new IdentityHashMap<>();
             HashSet<ValueNode> newKnownNotNull = new HashSet<>();
             HashSet<ValueNode> newKnownNull = new HashSet<>();
             IdentityHashMap<BooleanNode, ValueNode> newTrueConditions = new IdentityHashMap<>();
             IdentityHashMap<BooleanNode, ValueNode> newFalseConditions = new IdentityHashMap<>();
 
-            for (Map.Entry<ValueNode, RiResolvedType> entry : knownTypes.entrySet()) {
+            for (Map.Entry<ValueNode, ResolvedJavaType> entry : knownTypes.entrySet()) {
                 ValueNode node = entry.getKey();
-                RiResolvedType type = entry.getValue();
+                ResolvedJavaType type = entry.getValue();
 
                 for (State other : withStates) {
-                    RiResolvedType otherType = other.getNodeType(node);
+                    ResolvedJavaType otherType = other.getNodeType(node);
                     type = widen(type, otherType);
                     if (type == null) {
                         break;
@@ -201,8 +201,8 @@
             return true;
         }
 
-        public RiResolvedType getNodeType(ValueNode node) {
-            RiResolvedType result = knownTypes.get(node);
+        public ResolvedJavaType getNodeType(ValueNode node) {
+            ResolvedJavaType result = knownTypes.get(node);
             return result == null ? node.objectStamp().type() : result;
         }
 
@@ -224,7 +224,7 @@
         }
     }
 
-    public static RiResolvedType widen(RiResolvedType a, RiResolvedType b) {
+    public static ResolvedJavaType widen(ResolvedJavaType a, ResolvedJavaType b) {
         if (a == null || b == null) {
             return null;
         } else if (a == b) {
@@ -234,7 +234,7 @@
         }
     }
 
-    public static RiResolvedType tighten(RiResolvedType a, RiResolvedType b) {
+    public static ResolvedJavaType tighten(ResolvedJavaType a, ResolvedJavaType b) {
         if (a == null) {
             return b;
         } else if (b == null) {
@@ -335,7 +335,7 @@
                 }
             } else if (node instanceof CheckCastNode) {
                 CheckCastNode checkCast = (CheckCastNode) node;
-                RiResolvedType type = state.getNodeType(checkCast.object());
+                ResolvedJavaType type = state.getNodeType(checkCast.object());
                 if (checkCast.targetClass() != null && type != null && type.isSubtypeOf(checkCast.targetClass())) {
                     PiNode piNode;
                     boolean nonNull = state.knownNotNull.contains(checkCast.object());
@@ -360,7 +360,7 @@
                         if (state.knownNull.contains(object)) {
                             replaceWith = ConstantNode.forBoolean(false, graph);
                         } else if (state.knownNotNull.contains(object)) {
-                            RiResolvedType type = state.getNodeType(object);
+                            ResolvedJavaType type = state.getNodeType(object);
                             if (type != null && type.isSubtypeOf(instanceOf.targetClass())) {
                                 replaceWith = ConstantNode.forBoolean(true, graph);
                             }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -58,7 +58,7 @@
 
         if (GraalOptions.LoopFrequencyPropagationPolicy < 0) {
             ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false);
-            BitMap visitedBlocks = new BitMap(cfg.getBlocks().length);
+            BitSet visitedBlocks = new BitSet(cfg.getBlocks().length);
             for (Loop loop : cfg.getLoops()) {
                 if (loop.parent == null) {
                     correctLoopFrequencies(loop, 1, visitedBlocks);
@@ -67,7 +67,7 @@
         }
     }
 
-    private void correctLoopFrequencies(Loop loop, double parentFrequency, BitMap visitedBlocks) {
+    private void correctLoopFrequencies(Loop loop, double parentFrequency, BitSet visitedBlocks) {
         LoopBeginNode loopBegin = ((LoopBeginNode) loop.header.getBeginNode());
         double frequency = parentFrequency * loopBegin.loopFrequency();
         for (Loop child : loop.children) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IdentifyBoxingPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IdentifyBoxingPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -47,7 +47,7 @@
 
     public void tryIntrinsify(Invoke invoke) {
         MethodCallTargetNode callTarget = invoke.callTarget();
-        RiResolvedMethod targetMethod = callTarget.targetMethod();
+        ResolvedJavaMethod targetMethod = callTarget.targetMethod();
         if (pool.isSpecialMethod(targetMethod)) {
             assert callTarget.arguments().size() == 1 : "boxing/unboxing method must have exactly one argument";
             Kind returnKind = callTarget.returnKind();
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/InliningPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -171,14 +171,14 @@
         }
     }
 
-    public static final Map<RiMethod, Integer> parsedMethods = new HashMap<>();
+    public static final Map<JavaMethod, Integer> parsedMethods = new HashMap<>();
 
 
 
     private static final DebugMetric metricInliningRuns = Debug.metric("Runs");
 
     @Override
-    public StructuredGraph buildGraph(final RiResolvedMethod method) {
+    public StructuredGraph buildGraph(final ResolvedJavaMethod method) {
         final StructuredGraph newGraph = new StructuredGraph(method);
 
         return Debug.scope("buildInlineGraph", this, new Callable<StructuredGraph>() {
@@ -220,7 +220,7 @@
     }
 
     @Override
-    public double inliningWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke) {
+    public double inliningWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke) {
         boolean preferred = hints != null && hints.contains(invoke);
         return weightComputationPolicy.computeWeight(caller, method, invoke, preferred);
     }
@@ -245,12 +245,12 @@
 
 
     @Override
-    public void recordConcreteMethodAssumption(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl) {
+    public void recordConcreteMethodAssumption(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl) {
         assumptions.recordConcreteMethod(method, context, impl);
     }
 
     @Override
-    public void recordMethodContentsAssumption(RiResolvedMethod method) {
+    public void recordMethodContentsAssumption(ResolvedJavaMethod method) {
         if (assumptions != null) {
             assumptions.recordMethodContents(method);
         }
@@ -363,7 +363,7 @@
 
             double maxSize = GraalOptions.MaximumGreedyInlineSize;
             if (GraalOptions.InliningBonusPerTransferredValue != 0) {
-                RiSignature signature = info.invoke.callTarget().targetMethod().signature();
+                Signature signature = info.invoke.callTarget().targetMethod().signature();
                 int transferredValues = signature.argumentCount(!Modifier.isStatic(info.invoke.callTarget().targetMethod().accessFlags()));
                 if (signature.returnKind() != Kind.Void) {
                     transferredValues++;
@@ -398,12 +398,12 @@
 
 
     private interface WeightComputationPolicy {
-        double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke);
+        double computeWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke, boolean preferredInvoke);
     }
 
     private static class BytecodeSizeBasedWeightComputationPolicy implements WeightComputationPolicy {
         @Override
-        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
+        public double computeWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke, boolean preferredInvoke) {
             double codeSize = method.codeSize();
             if (preferredInvoke) {
                 codeSize = codeSize / GraalOptions.BoostInliningForEscapeAnalysis;
@@ -414,7 +414,7 @@
 
     private static class ComplexityBasedWeightComputationPolicy implements WeightComputationPolicy {
         @Override
-        public double computeWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke, boolean preferredInvoke) {
+        public double computeWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke, boolean preferredInvoke) {
             double complexity = method.compilationComplexity();
             if (preferredInvoke) {
                 complexity = complexity / GraalOptions.BoostInliningForEscapeAnalysis;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/IntrinsificationPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -47,18 +47,18 @@
         }
     }
 
-    public static boolean canIntrinsify(Invoke invoke, RiResolvedMethod target, ExtendedRiRuntime runtime) {
+    public static boolean canIntrinsify(Invoke invoke, ResolvedJavaMethod target, ExtendedRiRuntime runtime) {
         return getIntrinsicGraph(invoke, target, runtime) != null;
     }
 
     private static void tryIntrinsify(Invoke invoke, ExtendedRiRuntime runtime) {
-        RiResolvedMethod target = invoke.callTarget().targetMethod();
+        ResolvedJavaMethod target = invoke.callTarget().targetMethod();
         if (target != null) {
             tryIntrinsify(invoke, target, runtime);
         }
     }
 
-    private static void tryIntrinsify(Invoke invoke, RiResolvedMethod target, ExtendedRiRuntime runtime) {
+    private static void tryIntrinsify(Invoke invoke, ResolvedJavaMethod target, ExtendedRiRuntime runtime) {
         StructuredGraph intrinsicGraph = getIntrinsicGraph(invoke, target, runtime);
         if (intrinsicGraph != null) {
             Debug.log(" > Intrinsify %s", target);
@@ -66,7 +66,7 @@
         }
     }
 
-    private static StructuredGraph getIntrinsicGraph(Invoke invoke, RiResolvedMethod target, ExtendedRiRuntime runtime) {
+    private static StructuredGraph getIntrinsicGraph(Invoke invoke, ResolvedJavaMethod target, ExtendedRiRuntime runtime) {
         StructuredGraph intrinsicGraph = (StructuredGraph) target.compilerStorage().get(Graph.class);
         if (intrinsicGraph == null) {
             // TODO remove once all intrinsics are available via compilerStorage
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/LoweringPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -52,16 +52,16 @@
 
         @Override
         public ValueNode createNullCheckGuard(ValueNode object, long leafGraphId) {
-            return createGuard(object.graph().unique(new IsNullNode(object)), RiDeoptReason.NullCheckException, CiDeoptAction.InvalidateReprofile, true, leafGraphId);
+            return createGuard(object.graph().unique(new IsNullNode(object)), DeoptimizationReason.NullCheckException, CiDeoptAction.InvalidateReprofile, true, leafGraphId);
         }
 
         @Override
-        public ValueNode createGuard(BooleanNode condition, RiDeoptReason deoptReason, CiDeoptAction action, long leafGraphId) {
+        public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, long leafGraphId) {
             return createGuard(condition, deoptReason, action, false, leafGraphId);
         }
 
         @Override
-        public ValueNode createGuard(BooleanNode condition, RiDeoptReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+        public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
             // TODO (thomaswue): Document why this must not be called on floating nodes.
             throw new UnsupportedOperationException();
         }
@@ -150,7 +150,7 @@
             }
 
             @Override
-            public ValueNode createGuard(BooleanNode condition, RiDeoptReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+            public ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
                 FixedNode guardAnchor = (FixedNode) getGuardAnchor();
                 if (GraalOptions.OptEliminateGuards) {
                     for (Node usage : condition.usages()) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -38,10 +38,10 @@
 
 public class SnippetIntrinsificationPhase extends Phase {
 
-    private final RiRuntime runtime;
+    private final CodeCacheProvider runtime;
     private final BoxingMethodPool pool;
 
-    public SnippetIntrinsificationPhase(RiRuntime runtime, BoxingMethodPool pool) {
+    public SnippetIntrinsificationPhase(CodeCacheProvider runtime, BoxingMethodPool pool) {
         this.runtime = runtime;
         this.pool = pool;
     }
@@ -54,7 +54,7 @@
     }
 
     private void tryIntrinsify(Invoke invoke) {
-        RiResolvedMethod target = invoke.callTarget().targetMethod();
+        ResolvedJavaMethod target = invoke.callTarget().targetMethod();
         NodeIntrinsic intrinsic = target.getAnnotation(Node.NodeIntrinsic.class);
         if (intrinsic != null) {
             assert target.getAnnotation(Node.Fold.class) == null;
@@ -108,7 +108,7 @@
      *
      * @param folding specifies if the invocation is for handling a {@link Fold} annotation
      */
-    private Object[] prepareArguments(Invoke invoke, Class< ? >[] parameterTypes, RiResolvedMethod target, boolean folding) {
+    private Object[] prepareArguments(Invoke invoke, Class< ? >[] parameterTypes, ResolvedJavaMethod target, boolean folding) {
         NodeInputList<ValueNode> arguments = invoke.callTarget().arguments();
         Object[] reflectionCallArguments = new Object[arguments.size()];
         for (int i = 0; i < reflectionCallArguments.length; ++i) {
@@ -123,8 +123,8 @@
                 Constant constant = constantNode.asConstant();
                 Object o = constant.boxedValue();
                 if (o instanceof Class< ? >) {
-                    reflectionCallArguments[i] = runtime.getType((Class< ? >) o);
-                    parameterTypes[i] = RiResolvedType.class;
+                    reflectionCallArguments[i] = runtime.getResolvedJavaType((Class< ? >) o);
+                    parameterTypes[i] = ResolvedJavaType.class;
                 } else {
                     if (parameterTypes[i] == boolean.class) {
                         reflectionCallArguments[i] = Boolean.valueOf(constant.asInt() != 0);
@@ -146,7 +146,7 @@
         return reflectionCallArguments;
     }
 
-    private static Class< ? > getNodeClass(RiResolvedMethod target, NodeIntrinsic intrinsic) {
+    private static Class< ? > getNodeClass(ResolvedJavaMethod target, NodeIntrinsic intrinsic) {
         Class< ? > result = intrinsic.value();
         if (result == NodeIntrinsic.class) {
             result = target.holder().toJava();
@@ -155,7 +155,7 @@
         return result;
     }
 
-    private ValueNode tryBoxingElimination(int parameterIndex, RiResolvedMethod target, ValueNode node) {
+    private ValueNode tryBoxingElimination(int parameterIndex, ResolvedJavaMethod target, ValueNode node) {
         if (parameterIndex >= 0) {
             Type type = target.getGenericParameterTypes()[parameterIndex];
             if (type instanceof TypeVariable) {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/SchedulePhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/schedule/SchedulePhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -171,7 +171,7 @@
         if (earliest != null) {
             return earliest;
         }
-        BitMap bits = new BitMap(cfg.getBlocks().length);
+        BitSet bits = new BitSet(cfg.getBlocks().length);
         ArrayList<Node> before = new ArrayList<>();
         if (n.predecessor() != null) {
             before.add(n.predecessor());
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/Backend.java	Sat Jun 09 16:52:12 2012 +0200
@@ -40,14 +40,14 @@
 
     /**
      * The name of the system property whose value (if non-null) specifies the fully qualified
-     * name of the class to be instantiated by {@link #create(RiRuntime, CiTarget)}.
+     * name of the class to be instantiated by {@link #create(CodeCacheProvider, CiTarget)}.
      */
     public static final String BACKEND_CLASS_PROPERTY = "graal.compiler.backend.class";
 
-    public final RiRuntime runtime;
+    public final CodeCacheProvider runtime;
     public final CiTarget target;
 
-    protected Backend(RiRuntime runtime, CiTarget target) {
+    protected Backend(CodeCacheProvider runtime, CiTarget target) {
         this.runtime = runtime;
         this.target = target;
     }
@@ -56,12 +56,12 @@
      * Creates the architecture and runtime specific back-end object.
      * The class of the object instantiated must be in the {@link #BACKEND_CLASS_PROPERTY} system property.
      */
-    public static Backend create(RiRuntime runtime, CiTarget target) {
+    public static Backend create(CodeCacheProvider runtime, CiTarget target) {
         String className = System.getProperty(BACKEND_CLASS_PROPERTY);
         assert className != null : "System property must be defined: " + BACKEND_CLASS_PROPERTY;
         try {
             Class<?> c = Class.forName(className);
-            Constructor<?> cons = c.getDeclaredConstructor(RiRuntime.class, CiTarget.class);
+            Constructor<?> cons = c.getDeclaredConstructor(CodeCacheProvider.class, CiTarget.class);
             return (Backend) cons.newInstance(runtime, target);
         } catch (Exception e) {
             throw new Error("Could not instantiate " + className, e);
@@ -72,7 +72,7 @@
         return new FrameMap(runtime, target, registerConfig);
     }
 
-    public abstract LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions);
+    public abstract LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions);
 
     public abstract TargetMethodAssembler newAssembler(FrameMap frameMap, LIR lir);
 
@@ -110,5 +110,5 @@
      * @param the method associated with {@code lir}
      * @param lir the LIR of {@code method}
      */
-    public abstract void emitCode(TargetMethodAssembler tasm, RiResolvedMethod method, LIR lir);
+    public abstract void emitCode(TargetMethodAssembler tasm, ResolvedJavaMethod method, LIR lir);
 }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Sat Jun 09 16:52:12 2012 +0200
@@ -37,10 +37,10 @@
     public final Label label = new Label();
     public final LIRDebugInfo info;
     public final CiDeoptAction action;
-    public final RiDeoptReason reason;
+    public final DeoptimizationReason reason;
     public final Object deoptInfo;
 
-    public AMD64DeoptimizationStub(CiDeoptAction action, RiDeoptReason reason, LIRDebugInfo info, Object deoptInfo) {
+    public AMD64DeoptimizationStub(CiDeoptAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo) {
         this.action = action;
         this.reason = reason;
         this.info = info;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Sat Jun 09 16:52:12 2012 +0200
@@ -98,7 +98,7 @@
         }
     }
 
-    public AMD64LIRGenerator(Graph graph, RiRuntime runtime, CiTarget target, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
+    public AMD64LIRGenerator(Graph graph, CodeCacheProvider runtime, CiTarget target, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
         super(graph, runtime, target, frameMap, method, lir, xir, assumptions);
         lir.spillMoveFactory = new AMD64SpillMoveFactory();
     }
@@ -519,7 +519,7 @@
 
 
     @Override
-    public void emitDeoptimizeOnOverflow(CiDeoptAction action, RiDeoptReason reason, Object deoptInfo) {
+    public void emitDeoptimizeOnOverflow(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo) {
         LIRDebugInfo info = state();
         LabelRef stubEntry = createDeoptStub(action, reason, info, deoptInfo);
         append(new BranchOp(ConditionFlag.overflow, stubEntry, info));
@@ -527,7 +527,7 @@
 
 
     @Override
-    public void emitDeoptimize(CiDeoptAction action, RiDeoptReason reason, Object deoptInfo, long leafGraphId) {
+    public void emitDeoptimize(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo, long leafGraphId) {
         LIRDebugInfo info = state(leafGraphId);
         LabelRef stubEntry = createDeoptStub(action, reason, info, deoptInfo);
         append(new JumpOp(stubEntry, info));
@@ -570,7 +570,7 @@
     }
 
     @Override
-    protected LabelRef createDeoptStub(CiDeoptAction action, RiDeoptReason reason, LIRDebugInfo info, Object deoptInfo) {
+    protected LabelRef createDeoptStub(CiDeoptAction action, DeoptimizationReason reason, LIRDebugInfo info, Object deoptInfo) {
         assert info.topFrame.bci >= 0 : "invalid bci for deopt framestate";
         AMD64DeoptimizationStub stub = new AMD64DeoptimizationStub(action, reason, info, deoptInfo);
         lir.stubs.add(stub);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateObjectTypeFeedback.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateObjectTypeFeedback.java	Sat Jun 09 16:52:12 2012 +0200
@@ -47,22 +47,22 @@
     }
 
     @Override
-    public void declaredType(RiResolvedType type, boolean nonNull) {
+    public void declaredType(ResolvedJavaType type, boolean nonNull) {
         delegate.notDeclaredType(type, nonNull);
     }
 
     @Override
-    public void exactType(RiResolvedType type) {
+    public void exactType(ResolvedJavaType type) {
         delegate.notExactType(type);
     }
 
     @Override
-    public void notDeclaredType(RiResolvedType type, boolean includesNull) {
+    public void notDeclaredType(ResolvedJavaType type, boolean includesNull) {
         delegate.declaredType(type, includesNull);
     }
 
     @Override
-    public void notExactType(RiResolvedType type) {
+    public void notExactType(ResolvedJavaType type) {
         delegate.exactType(type);
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypeCachePhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/PropagateTypeCachePhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -42,7 +42,7 @@
     private static final boolean DUMP = false;
 
     private final CiTarget target;
-    private final RiRuntime runtime;
+    private final CodeCacheProvider runtime;
     private final CiAssumptions assumptions;
 
     private StructuredGraph currentGraph;
@@ -64,7 +64,7 @@
 //        });
 //    }
 
-    public PropagateTypeCachePhase(CiTarget target, RiRuntime runtime, CiAssumptions assumptions) {
+    public PropagateTypeCachePhase(CiTarget target, CodeCacheProvider runtime, CiAssumptions assumptions) {
         this.target = target;
         this.runtime = runtime;
         this.assumptions = assumptions;
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/TypeFeedbackCache.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/TypeFeedbackCache.java	Sat Jun 09 16:52:12 2012 +0200
@@ -35,14 +35,14 @@
     public static final boolean NO_OBJECT_TYPES = false;
     public static final boolean NO_SCALAR_TYPES = false;
 
-    private final RiRuntime runtime;
+    private final CodeCacheProvider runtime;
     private final StructuredGraph graph;
     private final HashMap<ValueNode, ScalarTypeFeedbackStore> scalarTypeFeedback;
     private final HashMap<ValueNode, ObjectTypeFeedbackStore> objectTypeFeedback;
     private final TypeFeedbackChanged changed;
     private final boolean negated;
 
-    public TypeFeedbackCache(RiRuntime runtime, StructuredGraph graph, TypeFeedbackChanged changed) {
+    public TypeFeedbackCache(CodeCacheProvider runtime, StructuredGraph graph, TypeFeedbackChanged changed) {
         this.runtime = runtime;
         this.graph = graph;
         scalarTypeFeedback = new HashMap<>();
@@ -51,7 +51,8 @@
         this.changed = changed;
     }
 
-    public TypeFeedbackCache(RiRuntime runtime, StructuredGraph graph, HashMap<ValueNode, ScalarTypeFeedbackStore> scalarTypeFeedback, HashMap<ValueNode, ObjectTypeFeedbackStore> objectTypeFeedback, boolean negated, TypeFeedbackChanged changed) {
+    public TypeFeedbackCache(CodeCacheProvider runtime, StructuredGraph graph, HashMap<ValueNode, ScalarTypeFeedbackStore> scalarTypeFeedback, HashMap<ValueNode,
+                    ObjectTypeFeedbackStore> objectTypeFeedback, boolean negated, TypeFeedbackChanged changed) {
         this.runtime = runtime;
         this.graph = graph;
         this.scalarTypeFeedback = scalarTypeFeedback;
@@ -96,7 +97,7 @@
     }
 
     @Override
-    public RiRuntime runtime() {
+    public CodeCacheProvider runtime() {
         return runtime;
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/BitMap2D.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/BitMap2D.java	Sat Jun 09 16:52:12 2012 +0200
@@ -22,14 +22,14 @@
  */
 package com.oracle.graal.compiler.util;
 
-import com.oracle.graal.graph.*;
+import java.util.*;
 
 /**
  * This class implements a two-dimensional bitmap.
  */
 public final class BitMap2D {
 
-    private BitMap map;
+    private BitSet map;
     private final int bitsPerSlot;
 
     private int bitIndex(int slotIndex, int bitWithinSlotIndex)  {
@@ -42,7 +42,7 @@
     }
 
     public BitMap2D(int sizeInSlots, int bitsPerSlot) {
-        map = new BitMap(sizeInSlots * bitsPerSlot);
+        map = new BitSet(sizeInSlots * bitsPerSlot);
         this.bitsPerSlot = bitsPerSlot;
     }
 
@@ -81,8 +81,8 @@
            while (size <= slotIndex) {
                size *= 2;
            }
-           BitMap newBitMap = new BitMap(size * bitsPerSlot);
-           newBitMap.setUnion(map);
+           BitSet newBitMap = new BitSet(size * bitsPerSlot);
+           newBitMap.or(map);
            map = newBitMap;
        }
 
@@ -94,6 +94,6 @@
     }
 
     public void clear() {
-        map.clearAll();
+        map.clear();
     }
 }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/util/InliningUtil.java	Sat Jun 09 16:52:12 2012 +0200
@@ -28,7 +28,7 @@
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiTypeProfile.*;
+import com.oracle.graal.api.meta.JavaTypeProfile.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.phases.*;
 import com.oracle.graal.cri.*;
@@ -45,13 +45,13 @@
 public class InliningUtil {
 
     public interface InliningCallback {
-        StructuredGraph buildGraph(RiResolvedMethod method);
-        double inliningWeight(RiResolvedMethod caller, RiResolvedMethod method, Invoke invoke);
-        void recordMethodContentsAssumption(RiResolvedMethod method);
-        void recordConcreteMethodAssumption(RiResolvedMethod method, RiResolvedType context, RiResolvedMethod impl);
+        StructuredGraph buildGraph(ResolvedJavaMethod method);
+        double inliningWeight(ResolvedJavaMethod caller, ResolvedJavaMethod method, Invoke invoke);
+        void recordMethodContentsAssumption(ResolvedJavaMethod method);
+        void recordConcreteMethodAssumption(ResolvedJavaMethod method, ResolvedJavaType context, ResolvedJavaMethod impl);
     }
 
-    public static String methodName(RiResolvedMethod method, Invoke invoke) {
+    public static String methodName(ResolvedJavaMethod method, Invoke invoke) {
         if (!Debug.isLogEnabled()) {
             return null;
         } else if (invoke != null && invoke.stateAfter() != null) {
@@ -105,7 +105,7 @@
             return (weight < o.weight) ? -1 : (weight > o.weight) ? 1 : 0;
         }
 
-        protected static StructuredGraph getGraph(final RiResolvedMethod concrete, final InliningCallback callback) {
+        protected static StructuredGraph getGraph(final ResolvedJavaMethod concrete, final InliningCallback callback) {
             return Debug.scope("Inlining", concrete, new Callable<StructuredGraph>() {
                 @Override
                 public StructuredGraph call() throws Exception {
@@ -132,9 +132,9 @@
      * therefore is able to determine the called method exactly.
      */
     private static class ExactInlineInfo extends InlineInfo {
-        public final RiResolvedMethod concrete;
+        public final ResolvedJavaMethod concrete;
 
-        public ExactInlineInfo(Invoke invoke, double weight, int level, RiResolvedMethod concrete) {
+        public ExactInlineInfo(Invoke invoke, double weight, int level, ResolvedJavaMethod concrete) {
             super(invoke, weight, level);
             this.concrete = concrete;
         }
@@ -168,10 +168,10 @@
      * the receiver type cannot be proven. A type check guard will be generated if this inlining is performed.
      */
     private static class TypeGuardInlineInfo extends InlineInfo {
-        public final RiResolvedMethod concrete;
-        public final RiResolvedType type;
+        public final ResolvedJavaMethod concrete;
+        public final ResolvedJavaType type;
 
-        public TypeGuardInlineInfo(Invoke invoke, double weight, int level, RiResolvedMethod concrete, RiResolvedType type) {
+        public TypeGuardInlineInfo(Invoke invoke, double weight, int level, ResolvedJavaMethod concrete, ResolvedJavaType type) {
             super(invoke, weight, level);
             this.concrete = concrete;
             this.type = type;
@@ -189,7 +189,7 @@
             ValueNode receiver = invoke.callTarget().receiver();
             ReadHubNode objectClass = graph.add(new ReadHubNode(receiver));
             IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClass, type));
-            FixedGuardNode guard = graph.add(new FixedGuardNode(isTypeNode, RiDeoptReason.TypeCheckedInliningViolated, CiDeoptAction.InvalidateReprofile, invoke.leafGraphId()));
+            FixedGuardNode guard = graph.add(new FixedGuardNode(isTypeNode, DeoptimizationReason.TypeCheckedInliningViolated, CiDeoptAction.InvalidateReprofile, invoke.leafGraphId()));
             AnchorNode anchor = graph.add(new AnchorNode());
             assert invoke.predecessor() != null;
 
@@ -222,12 +222,12 @@
      * amounts of different receiver types and different methods. If an unknown type is encountered a deoptimization is triggered.
      */
     private static class MultiTypeGuardInlineInfo extends InlineInfo {
-        public final List<RiResolvedMethod> concretes;
+        public final List<ResolvedJavaMethod> concretes;
         public final ProfiledType[] ptypes;
         public final int[] typesToConcretes;
         public final double notRecordedTypeProbability;
 
-        public MultiTypeGuardInlineInfo(Invoke invoke, double weight, int level, List<RiResolvedMethod> concretes, ProfiledType[] ptypes,
+        public MultiTypeGuardInlineInfo(Invoke invoke, double weight, int level, List<ResolvedJavaMethod> concretes, ProfiledType[] ptypes,
                         int[] typesToConcretes, double notRecordedTypeProbability) {
             super(invoke, weight, level);
             assert concretes.size() > 0 && concretes.size() <= ptypes.length : "must have at least one method but no more than types methods";
@@ -242,7 +242,7 @@
         @Override
         public int compiledCodeSize() {
             int result = 0;
-            for (RiResolvedMethod m: concretes) {
+            for (ResolvedJavaMethod m: concretes) {
                 result += m.compiledCodeSize();
             }
             return result;
@@ -315,7 +315,7 @@
             if (shouldFallbackToInvoke()) {
                 unknownTypeNode = createInvocationBlock(graph, invoke, returnMerge, returnValuePhi, exceptionMerge, exceptionObjectPhi, 1, notRecordedTypeProbability, false);
             } else {
-                unknownTypeNode = graph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, RiDeoptReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
+                unknownTypeNode = graph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
             }
 
             // replace the invoke exception edge
@@ -344,12 +344,12 @@
                 BeginNode node = calleeEntryNodes[i];
                 Invoke invokeForInlining = (Invoke) node.next();
 
-                RiResolvedType commonType = getLeastCommonType(i);
+                ResolvedJavaType commonType = getLeastCommonType(i);
                 ValueNode receiver = invokeForInlining.callTarget().receiver();
                 ValueNode anchoredReceiver = createAnchoredReceiver(graph, node, commonType, receiver);
                 invokeForInlining.callTarget().replaceFirstInput(receiver, anchoredReceiver);
 
-                RiResolvedMethod concrete = concretes.get(i);
+                ResolvedJavaMethod concrete = concretes.get(i);
                 StructuredGraph calleeGraph = getGraph(concrete, callback);
                 callback.recordMethodContentsAssumption(concrete);
                 assert !IntrinsificationPhase.canIntrinsify(invokeForInlining, concrete, runtime);
@@ -357,8 +357,8 @@
             }
         }
 
-        private RiResolvedType getLeastCommonType(int concreteMethodIndex) {
-            RiResolvedType commonType = null;
+        private ResolvedJavaType getLeastCommonType(int concreteMethodIndex) {
+            ResolvedJavaType commonType = null;
             for (int i = 0; i < typesToConcretes.length; i++) {
                 if (typesToConcretes[i] == concreteMethodIndex) {
                     if (commonType == null) {
@@ -380,14 +380,14 @@
             ReadHubNode objectClassNode = graph.add(new ReadHubNode(invoke.callTarget().receiver()));
             graph.addBeforeFixed(invoke.node(), objectClassNode);
 
-            FixedNode unknownTypeNode = graph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, RiDeoptReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
+            FixedNode unknownTypeNode = graph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.TypeCheckedInliningViolated, invoke.leafGraphId()));
             FixedNode dispatchOnType = createDispatchOnType(graph, objectClassNode, new BeginNode[] {calleeEntryNode}, unknownTypeNode);
 
             FixedWithNextNode pred = (FixedWithNextNode) invoke.node().predecessor();
             pred.setNext(dispatchOnType);
             calleeEntryNode.setNext(invoke.node());
 
-            RiResolvedMethod concrete = concretes.get(0);
+            ResolvedJavaMethod concrete = concretes.get(0);
             StructuredGraph calleeGraph = getGraph(concrete, callback);
             assert !IntrinsificationPhase.canIntrinsify(invoke, concrete, runtime);
             callback.recordMethodContentsAssumption(concrete);
@@ -409,7 +409,7 @@
             return nextNode;
         }
 
-        private static IfNode createTypeCheck(StructuredGraph graph, ReadHubNode objectClassNode, RiResolvedType type, BeginNode tsux, FixedNode nextNode, double tsuxProbability, double probability) {
+        private static IfNode createTypeCheck(StructuredGraph graph, ReadHubNode objectClassNode, ResolvedJavaType type, BeginNode tsux, FixedNode nextNode, double tsuxProbability, double probability) {
             IfNode result;
             IsTypeNode isTypeNode = graph.unique(new IsTypeNode(objectClassNode, type));
             if (tsux instanceof MergeNode) {
@@ -514,9 +514,9 @@
      * but for which an assumption has to be registered because of non-final classes.
      */
     private static class AssumptionInlineInfo extends ExactInlineInfo {
-        public final RiResolvedType context;
+        public final ResolvedJavaType context;
 
-        public AssumptionInlineInfo(Invoke invoke, double weight, int level, RiResolvedType context, RiResolvedMethod concrete) {
+        public AssumptionInlineInfo(Invoke invoke, double weight, int level, ResolvedJavaType context, ResolvedJavaMethod concrete) {
             super(invoke, weight, level, concrete);
             this.context = context;
         }
@@ -553,9 +553,9 @@
      * @return an instance of InlineInfo, or null if no inlining is possible at the given invoke
      */
     public static InlineInfo getInlineInfo(Invoke invoke, int level, ExtendedRiRuntime runtime, CiAssumptions assumptions, InliningCallback callback, OptimisticOptimizations optimisticOpts) {
-        RiResolvedMethod parent = invoke.stateAfter().method();
+        ResolvedJavaMethod parent = invoke.stateAfter().method();
         MethodCallTargetNode callTarget = invoke.callTarget();
-        RiResolvedMethod targetMethod = callTarget.targetMethod();
+        ResolvedJavaMethod targetMethod = callTarget.targetMethod();
         if (targetMethod == null) {
             return null;
         }
@@ -571,17 +571,17 @@
             return null;
         }
         ObjectStamp receiverStamp = callTarget.receiver().objectStamp();
-        RiResolvedType receiverType = receiverStamp.type();
+        ResolvedJavaType receiverType = receiverStamp.type();
         if (receiverStamp.isExactType()) {
             assert receiverType.isSubtypeOf(targetMethod.holder()) : receiverType + " subtype of " + targetMethod.holder() + " for " + targetMethod;
-            RiResolvedMethod resolved = receiverType.resolveMethodImpl(targetMethod);
+            ResolvedJavaMethod resolved = receiverType.resolveMethodImpl(targetMethod);
             if (checkTargetConditions(invoke, resolved, optimisticOpts)) {
                 double weight = callback == null ? 0 : callback.inliningWeight(parent, resolved, invoke);
                 return new ExactInlineInfo(invoke, weight, level, resolved);
             }
             return null;
         }
-        RiResolvedType holder = targetMethod.holder();
+        ResolvedJavaType holder = targetMethod.holder();
 
         if (receiverStamp.type() != null) {
             // the invoke target might be more specific than the holder (happens after inlining: locals lose their declared type...)
@@ -592,7 +592,7 @@
         }
         // TODO (thomaswue) fix this
         if (assumptions != null) {
-            RiResolvedMethod concrete = holder.uniqueConcreteMethod(targetMethod);
+            ResolvedJavaMethod concrete = holder.uniqueConcreteMethod(targetMethod);
             if (concrete != null) {
                 if (checkTargetConditions(invoke, concrete, optimisticOpts)) {
                     double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
@@ -606,9 +606,9 @@
         return getTypeCheckedInlineInfo(invoke, level, callback, parent, targetMethod, optimisticOpts);
     }
 
-    private static InlineInfo getTypeCheckedInlineInfo(Invoke invoke, int level, InliningCallback callback, RiResolvedMethod parent, RiResolvedMethod targetMethod, OptimisticOptimizations optimisticOpts) {
-        RiProfilingInfo profilingInfo = parent.profilingInfo();
-        RiTypeProfile typeProfile = profilingInfo.getTypeProfile(invoke.bci());
+    private static InlineInfo getTypeCheckedInlineInfo(Invoke invoke, int level, InliningCallback callback, ResolvedJavaMethod parent, ResolvedJavaMethod targetMethod, OptimisticOptimizations optimisticOpts) {
+        ProfilingInfo profilingInfo = parent.profilingInfo();
+        JavaTypeProfile typeProfile = profilingInfo.getTypeProfile(invoke.bci());
         if (typeProfile != null) {
             ProfiledType[] ptypes = typeProfile.getTypes();
 
@@ -616,8 +616,8 @@
                 double notRecordedTypeProbability = typeProfile.getNotRecordedProbability();
                 if (ptypes.length == 1 && notRecordedTypeProbability == 0) {
                     if (optimisticOpts.inlineMonomorphicCalls()) {
-                        RiResolvedType type = ptypes[0].type;
-                        RiResolvedMethod concrete = type.resolveMethodImpl(targetMethod);
+                        ResolvedJavaType type = ptypes[0].type;
+                        ResolvedJavaMethod concrete = type.resolveMethodImpl(targetMethod);
                         if (checkTargetConditions(invoke, concrete, optimisticOpts)) {
                             double weight = callback == null ? 0 : callback.inliningWeight(parent, concrete, invoke);
                             return new TypeGuardInlineInfo(invoke, weight, level, concrete, type);
@@ -641,10 +641,10 @@
                         // TODO (chaeubl) sort types by probability
 
                         // determine concrete methods and map type to specific method
-                        ArrayList<RiResolvedMethod> concreteMethods = new ArrayList<>();
+                        ArrayList<ResolvedJavaMethod> concreteMethods = new ArrayList<>();
                         int[] typesToConcretes = new int[ptypes.length];
                         for (int i = 0; i < ptypes.length; i++) {
-                            RiResolvedMethod concrete = ptypes[i].type.resolveMethodImpl(targetMethod);
+                            ResolvedJavaMethod concrete = ptypes[i].type.resolveMethodImpl(targetMethod);
 
                             int index = concreteMethods.indexOf(concrete);
                             if (index < 0) {
@@ -656,7 +656,7 @@
 
                         double totalWeight = 0;
                         boolean canInline = true;
-                        for (RiResolvedMethod concrete: concreteMethods) {
+                        for (ResolvedJavaMethod concrete: concreteMethods) {
                             if (!checkTargetConditions(invoke, concrete, optimisticOpts)) {
                                 canInline = false;
                                 break;
@@ -689,7 +689,7 @@
         }
     }
 
-    private static ValueNode createAnchoredReceiver(StructuredGraph graph, FixedNode anchor, RiResolvedType commonType, ValueNode receiver) {
+    private static ValueNode createAnchoredReceiver(StructuredGraph graph, FixedNode anchor, ResolvedJavaType commonType, ValueNode receiver) {
         // to avoid that floating reads on receiver fields float above the type check
         return graph.unique(new PiNode(receiver, anchor, StampFactory.declaredNonNull(commonType)));
     }
@@ -710,16 +710,16 @@
         return true;
     }
 
-    private static boolean checkTargetConditions(Invoke invoke, RiMethod method, OptimisticOptimizations optimisticOpts) {
+    private static boolean checkTargetConditions(Invoke invoke, JavaMethod method, OptimisticOptimizations optimisticOpts) {
         if (method == null) {
             Debug.log("not inlining because method is not resolved");
             return false;
         }
-        if (!(method instanceof RiResolvedMethod)) {
+        if (!(method instanceof ResolvedJavaMethod)) {
             Debug.log("not inlining %s because it is unresolved", method.toString());
             return false;
         }
-        RiResolvedMethod resolvedMethod = (RiResolvedMethod) method;
+        ResolvedJavaMethod resolvedMethod = (ResolvedJavaMethod) method;
         if (Modifier.isNative(resolvedMethod.accessFlags())) {
             Debug.log("not inlining %s because it is a native method", methodName(resolvedMethod, invoke));
             return false;
@@ -736,7 +736,7 @@
             Debug.log("not inlining %s because it is marked non-inlinable", methodName(resolvedMethod, invoke));
             return false;
         }
-        if (computeRecursiveInliningLevel(invoke.stateAfter(), (RiResolvedMethod) method) > GraalOptions.MaximumRecursiveInlining) {
+        if (computeRecursiveInliningLevel(invoke.stateAfter(), (ResolvedJavaMethod) method) > GraalOptions.MaximumRecursiveInlining) {
             Debug.log("not inlining %s because it exceeds the maximum recursive inlining depth", methodName(resolvedMethod, invoke));
             return false;
         }
@@ -749,7 +749,7 @@
         return true;
     }
 
-    private static int computeRecursiveInliningLevel(FrameState state, RiResolvedMethod method) {
+    private static int computeRecursiveInliningLevel(FrameState state, ResolvedJavaMethod method) {
         assert state != null;
 
         int count = 0;
@@ -828,7 +828,7 @@
         } else {
             if (unwindNode != null) {
                 UnwindNode unwindDuplicate = (UnwindNode) duplicates.get(unwindNode);
-                DeoptimizeNode deoptimizeNode = new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.NotCompiledExceptionHandler, invoke.leafGraphId());
+                DeoptimizeNode deoptimizeNode = new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.NotCompiledExceptionHandler, invoke.leafGraphId());
                 unwindDuplicate.replaceAndDelete(graph.add(deoptimizeNode));
                 // move the deopt upwards if there is a monitor exit that tries to use the "after exception" frame state
                 // (because there is no "after exception" frame state!)
@@ -908,7 +908,7 @@
         NodeInputList<ValueNode> parameters = callTarget.arguments();
         ValueNode firstParam = parameters.size() <= 0 ? null : parameters.get(0);
         if (!callTarget.isStatic() && firstParam.kind() == Kind.Object && !firstParam.objectStamp().nonNull()) {
-            graph.addBeforeFixed(invoke.node(), graph.add(new FixedGuardNode(graph.unique(new IsNullNode(firstParam)), RiDeoptReason.ClassCastException, CiDeoptAction.InvalidateReprofile, true, invoke.leafGraphId())));
+            graph.addBeforeFixed(invoke.node(), graph.add(new FixedGuardNode(graph.unique(new IsNullNode(firstParam)), DeoptimizationReason.ClassCastException, CiDeoptAction.InvalidateReprofile, true, invoke.leafGraphId())));
         }
     }
 }
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/BitMap.java	Fri Jun 08 23:47:42 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,733 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 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.graph;
-
-import java.io.*;
-import java.util.*;
-
-/**
- * Implements a bitmap that stores a single bit for a range of integers (0-n).
- */
-public final class BitMap implements Serializable {
-
-    public static final long serialVersionUID = 0L;
-
-    private static final int ADDRESS_BITS_PER_WORD = 6;
-    private static final int BITS_PER_WORD = 1 << ADDRESS_BITS_PER_WORD;
-    private static final int BIT_INDEX_MASK = BITS_PER_WORD - 1;
-
-    public static final int DEFAULT_LENGTH = BITS_PER_WORD;
-
-    public static int roundUpLength(int length) {
-        return ((length + (BITS_PER_WORD - 1)) >> ADDRESS_BITS_PER_WORD) << ADDRESS_BITS_PER_WORD;
-    }
-
-    private int size;
-    private long low;
-    private long[] extra;
-
-    /**
-     * Constructs a new bit map with the {@linkplain #DEFAULT_LENGTH default length}.
-     */
-    public BitMap() {
-        this(DEFAULT_LENGTH);
-    }
-
-    /**
-     * Constructs a new bit map from a byte array encoded bit map.
-     *
-     * @param bitmap the bit map to convert
-     */
-    public BitMap(byte[] bitmap) {
-        this(bitmap, 0, bitmap.length);
-    }
-
-    /**
-     * Constructs a new bit map from a byte array encoded bit map.
-     *
-     * @param arr the byte array containing the bit map to convert
-     * @param off the byte index in {@code arr} at which the bit map starts
-     * @param numberOfBytes the number of bytes worth of bits to copy from {@code arr}
-     */
-    public BitMap(byte[] arr, int off, int numberOfBytes) {
-        this(numberOfBytes * 8);
-        int byteIndex = off;
-        int end = off + numberOfBytes;
-        assert end <= arr.length;
-        while (byteIndex < end && (byteIndex - off) < 8) {
-            long bite = (long) arr[byteIndex] & 0xff;
-            low |= bite << ((byteIndex - off) * 8);
-            byteIndex++;
-        }
-        if (byteIndex < end) {
-            assert (byteIndex - off) == 8;
-            int remBytes = end - byteIndex;
-            int remWords = (remBytes + 7) / 8;
-            for (int word = 0; word < remWords; word++) {
-                long w = 0L;
-                for (int i = 0; i < 8 && byteIndex < end; i++) {
-                    long bite = (long) arr[byteIndex] & 0xff;
-                    w |= bite << (i * 8);
-                    byteIndex++;
-                }
-                extra[word] = w;
-            }
-        }
-    }
-
-    /**
-     * Converts a {@code long} to a {@link BitMap}.
-     */
-    public static BitMap fromLong(long bitmap) {
-        BitMap bm = new BitMap(64);
-        bm.low = bitmap;
-        return bm;
-    }
-
-    /**
-     * Constructs a new bit map with the specified length.
-     *
-     * @param length the length of the bitmap
-     */
-    public BitMap(int length) {
-        assert length >= 0;
-        this.size = length;
-        if (length > BITS_PER_WORD) {
-            int n = wordIndex(length - 1) + 1;
-            extra = new long[n];
-        }
-    }
-
-    /**
-     * Sets the bit at the specified index.
-     *
-     * @param i the index of the bit to set
-     */
-    public void set(int i) {
-        if (checkIndex(i) < BITS_PER_WORD) {
-            low |= 1L << i;
-        } else {
-            int pos = wordIndex(i);
-            int index = bitInWord(i);
-            extra[pos] |= 1L << index;
-        }
-    }
-
-    /**
-     * Grows this bitmap to a new size, appending necessary zero bits.
-     *
-     * @param newLength the new length of the bitmap
-     */
-    public void grow(int newLength) {
-        if (newLength > size) {
-            // grow this bitmap to the new length
-            int newSize = newLength >> ADDRESS_BITS_PER_WORD;
-            if (newLength > 0) {
-                if (extra == null) {
-                    // extra just needs to be allocated now
-                    extra = new long[newSize];
-                } else {
-                    if (extra.length < newSize) {
-                        // extra needs to be copied
-                        long[] newExtra = new long[newSize];
-                        for (int i = 0; i < extra.length; i++) {
-                            newExtra[i] = extra[i];
-                        }
-                        extra = newExtra;
-                    } else {
-                        // nothing to do, extra is already the right size
-                    }
-                }
-            }
-            size = newLength;
-        }
-    }
-
-    private static int bitInWord(int i) {
-        return i & BIT_INDEX_MASK;
-    }
-
-    private static int wordIndex(int i) {
-        return (i >> ADDRESS_BITS_PER_WORD) - 1;
-    }
-
-    /**
-     * Clears the bit at the specified index.
-     * @param i the index of the bit to clear
-     */
-    public void clear(int i) {
-        if (checkIndex(i) < BITS_PER_WORD) {
-            low &= ~(1L << i);
-        } else {
-            int pos = wordIndex(i);
-            int index = bitInWord(i);
-            extra[pos] &= ~(1L << index);
-        }
-    }
-
-    /**
-     * Sets all the bits in this bitmap.
-     */
-    public void setAll() {
-        low = -1;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] = -1;
-            }
-        }
-    }
-
-    /**
-     * Clears all the bits in this bitmap.
-     */
-    public void clearAll() {
-        low = 0;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] = 0;
-            }
-        }
-    }
-
-    /**
-     * Gets the value of the bit at the specified index.
-     *
-     * @param i the index of the bit to get
-     * @return {@code true} if the bit at the specified position is {@code 1}
-     */
-    public boolean get(int i) {
-        if (checkIndex(i) < BITS_PER_WORD) {
-            return ((low >> i) & 1) != 0;
-        }
-        int pos = wordIndex(i);
-        int index = bitInWord(i);
-        long bits = extra[pos];
-        return ((bits >> index) & 1) != 0;
-    }
-
-    /**
-     * Gets the value of the bit at the specified index, returning {@code false} if the
-     * bitmap does not cover the specified index.
-     *
-     * @param i the index of the bit to get
-     * @return {@code true} if the bit at the specified position is {@code 1}
-     */
-    public boolean getDefault(int i) {
-        if (i < 0 || i >= size) {
-            return false;
-        }
-        if (i < BITS_PER_WORD) {
-            return ((low >> i) & 1) != 0;
-        }
-        int pos = wordIndex(i);
-        int index = bitInWord(i);
-        long bits = extra[pos];
-        return ((bits >> index) & 1) != 0;
-    }
-
-    /**
-     * Performs the union operation on this bitmap with the specified bitmap. That is, all bits set in either of the two
-     * bitmaps will be set in this bitmap following this operation.
-     *
-     * @param other the other bitmap for the union operation
-     */
-    public void setUnion(BitMap other) {
-        low |= other.low;
-        if (extra != null && other.extra != null) {
-            for (int i = 0; i < extra.length && i < other.extra.length; i++) {
-                extra[i] |= other.extra[i];
-            }
-        }
-    }
-
-    /**
-     * Performs the union operation on this bitmap with the specified bitmap. That is, all bits set in either of the two
-     * bitmaps will be set in this bitmap following this operation. It returns whether this bitmap was changed by the operation.
-     *
-     * @param other the other bitmap for the union operation
-     */
-    public boolean setUnionWithResult(BitMap other) {
-        long temp = low | other.low;
-        boolean changed = temp != low;
-        low = temp;
-
-        if (extra != null && other.extra != null) {
-            for (int i = 0; i < extra.length && i < other.extra.length; i++) {
-                temp = extra[i] | other.extra[i];
-                changed = changed || temp != extra[i];
-                extra[i] |= temp;
-            }
-        }
-        return changed;
-    }
-
-    /**
-     * Performs the union operation on this bitmap with the specified bitmap. That is, a bit is set in this
-     * bitmap if and only if it is set in both this bitmap and the specified bitmap.
-     *
-     * @param other the other bitmap for this operation
-     * @return {@code true} if any bits were cleared as a result of this operation
-     */
-    public boolean setIntersect(BitMap other) {
-        boolean same = true;
-        long intx = low & other.low;
-        if (low != intx) {
-            same = false;
-            low = intx;
-        }
-        long[] oxtra = other.extra;
-        if (extra != null && oxtra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                long a = extra[i];
-                if (i < oxtra.length) {
-                    // zero bits out of this map
-                    long ax = a & oxtra[i];
-                    if (a != ax) {
-                        same = false;
-                        extra[i] = ax;
-                    }
-                } else {
-                    // this bitmap is larger than the specified bitmap; zero remaining bits
-                    if (a != 0) {
-                        same = false;
-                        extra[i] = 0;
-                    }
-                }
-            }
-        }
-        return !same;
-    }
-
-    /**
-     * Gets the number of addressable bits in this bitmap.
-     *
-     * @return the size of this bitmap
-     */
-    public int size() {
-        return size;
-    }
-
-    private int checkIndex(int i) {
-        if (i < 0 || i >= size) {
-            throw new IndexOutOfBoundsException("Index " + i + " is out of bounds (size=" + size + ")");
-        }
-        return i;
-    }
-
-    public void setFrom(BitMap other) {
-        assert this.size == other.size : "must have same size";
-
-        low = other.low;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] = other.extra[i];
-            }
-        }
-    }
-
-    public void setDifference(BitMap other) {
-        assert this.size == other.size : "must have same size";
-
-        low &= ~other.low;
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                extra[i] &= ~other.extra[i];
-            }
-        }
-    }
-
-    public void negate() {
-        if (size == 0) {
-            return;
-        }
-        if (size < BITS_PER_WORD) {
-            long mask = (1L << size) - 1;
-            low = ~low & mask;
-        } else if (size == BITS_PER_WORD) {
-            low = ~low;
-        } else {
-            low = ~low;
-            if (extra != null) {
-                for (int i = 0; i < extra.length; i++) {
-                    extra[i] = ~extra[i];
-                    if (i == extra.length - 1 && wordIndex(size) == i) {
-                        if (bitInWord(size) != 0) {
-                            long mask = (1L << bitInWord(size)) - 1;
-                            extra[i] &= mask;
-                        }
-                    }
-                }
-
-            }
-        }
-    }
-
-    public boolean isSame(BitMap other) {
-        if (this.size != other.size || this.low != other.low) {
-            return false;
-        }
-
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                if (extra[i] != other.extra[i]) {
-                    return false;
-                }
-            }
-        }
-
-        return true;
-    }
-
-    /**
-     * Returns the index of the first set bit that occurs on or after a specified start index.
-     * If no such bit exists then -1 is returned.
-     * <p>
-     * To iterate over the set bits in a {@code BitMap}, use the following loop:
-     *
-     * <pre>
-     * for (int i = bitMap.nextSetBit(0); i &gt;= 0; i = bitMap.nextSetBit(i + 1)) {
-     *     // operate on index i here
-     * }
-     * </pre>
-     *
-     * @param fromIndex the index to start checking from (inclusive)
-     * @return the index of the lowest set bit between {@code [fromIndex .. size())} or -1 if there is no set bit in this range
-     * @throws IndexOutOfBoundsException if the specified index is negative.
-     */
-    public int nextSetBit(int fromIndex) {
-        return nextSetBit(fromIndex, size());
-    }
-
-    /**
-     * Returns the index of the first set bit that occurs on or after a specified start index
-     * and before a specified end index. If no such bit exists then -1 is returned.
-     * <p>
-     * To iterate over the set bits in a {@code BitMap}, use the following loop:
-     *
-     * <pre>
-     * for (int i = bitMap.nextSetBit(0, bitMap.size()); i &gt;= 0; i = bitMap.nextSetBit(i + 1, bitMap.size())) {
-     *     // operate on index i here
-     * }
-     * </pre>
-     *
-     * @param fromIndex the index to start checking from (inclusive)
-     * @param toIndex the index at which to stop checking (exclusive)
-     * @return the index of the lowest set bit between {@code [fromIndex .. toIndex)} or -1 if there is no set bit in this range
-     * @throws IndexOutOfBoundsException if the specified index is negative.
-     */
-    public int nextSetBit(int fromIndex, int toIndex) {
-        assert fromIndex <= size() : "index out of bounds";
-        assert toIndex <= size() : "index out of bounds";
-        assert fromIndex <= toIndex : "fromIndex > toIndex";
-
-        if (fromIndex == toIndex) {
-            return -1;
-        }
-        int fromWordIndex = wordIndex(fromIndex);
-        int toWordIndex = wordIndex(toIndex - 1) + 1;
-        int resultIndex = fromIndex;
-
-        // check bits including and to the left_ of offset's position
-        int pos = bitInWord(resultIndex);
-        long res = map(fromWordIndex) >> pos;
-        if (res != 0) {
-            resultIndex += Long.numberOfTrailingZeros(res);
-            assert resultIndex >= fromIndex && resultIndex < toIndex : "just checking";
-            if (resultIndex < toIndex) {
-                return resultIndex;
-            }
-            return -1;
-        }
-        // skip over all word length 0-bit runs
-        for (fromWordIndex++; fromWordIndex < toWordIndex; fromWordIndex++) {
-            res = map(fromWordIndex);
-            if (res != 0) {
-                // found a 1, return the offset
-                resultIndex = bitIndex(fromWordIndex) + Long.numberOfTrailingZeros(res);
-                assert resultIndex >= fromIndex : "just checking";
-                if (resultIndex < toIndex) {
-                    return resultIndex;
-                }
-                return -1;
-            }
-        }
-        return -1;
-    }
-
-    private static int bitIndex(int index) {
-        return (index + 1) << ADDRESS_BITS_PER_WORD;
-    }
-
-    private long map(int index) {
-        if (index == -1) {
-            return low;
-        }
-        return extra[index];
-    }
-
-    private static boolean allZeros(int start, long[] arr) {
-        for (int i = start; i < arr.length; i++) {
-            if (arr[i] != 0) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Compares this object against the specified object.
-     * The result is {@code true} if and only if {@code obj} is
-     * not {@code null} and is a {@code CiBitMap} object that has
-     * exactly the same set of bits set to {@code true} as this bit
-     * set.
-     *
-     * @param   obj   the object to compare with.
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (obj instanceof BitMap) {
-            BitMap bm = (BitMap) obj;
-            if (bm.low == low) {
-                if (bm.extra == null) {
-                    if (extra == null) {
-                        // Common case
-                        return true;
-                    }
-                    return allZeros(0, extra);
-                }
-                if (extra == null) {
-                    return allZeros(0, bm.extra);
-                }
-                // both 'extra' array non null:
-                int i = 0;
-                int length = Math.min(extra.length, bm.extra.length);
-                while (i < length) {
-                    if (extra[i] != bm.extra[i]) {
-                        return false;
-                    }
-                    i++;
-                }
-                if (extra.length > bm.extra.length) {
-                    return allZeros(length, extra);
-                }
-                if (extra.length < bm.extra.length) {
-                    return allZeros(length, bm.extra);
-                }
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * Returns a string representation of this bit map
-     * that is the same as the string returned by {@link BitSet#toString()}
-     * for a bit set with the same bits set as this bit map.
-     */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(size * 2);
-        sb.append('{');
-
-        int bit = nextSetBit(0);
-        if (bit != -1) {
-            sb.append(bit);
-            for (bit = nextSetBit(bit + 1); bit >= 0; bit = nextSetBit(bit + 1)) {
-                sb.append(", ").append(bit);
-            }
-        }
-
-        sb.append('}');
-        return sb.toString();
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + Arrays.hashCode(extra);
-        result = prime * result + (int) (low ^ (low >>> 32));
-        result = prime * result + size;
-        return result;
-    }
-
-    public static int highestOneBitIndex(long value) {
-        int bit = Long.numberOfTrailingZeros(Long.highestOneBit(value));
-        if (bit == 64) {
-            return -1;
-        }
-        return bit;
-    }
-
-    /**
-     * Returns the number of bits set to {@code true} in this bit map.
-     */
-    public int cardinality() {
-        int sum = Long.bitCount(low);
-        if (extra != null) {
-            for (long word : extra) {
-                sum += Long.bitCount(word);
-            }
-        }
-        return sum;
-    }
-
-    /**
-     * Returns the "logical size" of this bit map: the index of
-     * the highest set bit in the bit map plus one. Returns zero
-     * if the bit map contains no set bits.
-     *
-     * @return  the logical size of this bit map
-     */
-    public int length() {
-        if (extra != null) {
-            for (int i = extra.length - 1; i >= 0; i--) {
-                if (extra[i] != 0) {
-                    return (highestOneBitIndex(extra[i]) + ((i + 1) * 64)) + 1;
-                }
-            }
-        }
-        return highestOneBitIndex(low) + 1;
-    }
-
-    /**
-     * Returns a string representation of this bit map with every set bit represented as {@code '1'}
-     * and every unset bit represented as {@code '0'}. The first character in the returned string represents
-     * bit 0 in this bit map.
-     */
-    public String toBinaryString() {
-        StringBuilder sb = new StringBuilder(size);
-        for (int i = 0; i < size; ++i) {
-            sb.append(get(i) ? '1' : '0');
-        }
-        return sb.toString();
-    }
-
-    static final char[] hexDigits = {
-        '0', '1', '2', '3', '4', '5', '6', '7',
-        '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
-    };
-
-    /**
-     * Returns a string representation of this bit map in hex.
-     */
-    public String toHexString() {
-        if (size == 0) {
-            return "";
-        }
-        int hexSize = align(this.size, 4);
-        StringBuilder sb = new StringBuilder(hexSize / 4);
-        for (int i = 0; i < hexSize; i += 4) {
-            int nibble = get(i) ? 1 : 0;
-            if (get(i + 1)) {
-                nibble |= 2;
-            }
-            if (get(i + 2)) {
-                nibble |= 4;
-            }
-            if (get(i + 3)) {
-                nibble |= 8;
-            }
-
-            sb.append(hexDigits[nibble]);
-        }
-        return sb.toString();
-    }
-
-    private static int align(int size, int align) {
-        return (size + align - 1) & ~(align - 1);
-    }
-
-    public BitMap copy() {
-        BitMap n = new BitMap(BITS_PER_WORD);
-        n.low = low;
-        if (extra != null) {
-            n.extra = Arrays.copyOf(extra, extra.length);
-        }
-        n.size = size;
-        return n;
-    }
-
-    /**
-     * Copies this bit map into a given byte array.
-     *
-     * @param arr the destination
-     * @param off the byte index in {@code arr} at which to start writing
-     * @param numberOfBytes the number of bytes worth of bits to copy from this bit map.
-     * @return the number of bytes written to {@code arr}
-     */
-    public int copyTo(byte[] arr, int off, int numberOfBytes) {
-        for (int i = 0; i < numberOfBytes; ++i) {
-            long word = low;
-            int byteInWord;
-            if (i >= 8) {
-                int wordIndex = (i - 8) / 8;
-                word = extra[wordIndex];
-                byteInWord = i & 0x7;
-            } else {
-                byteInWord = i;
-            }
-            assert byteInWord < 8;
-            byte b = (byte) (word >> (byteInWord * 8));
-            arr[off + i] = b;
-        }
-        return numberOfBytes;
-    }
-
-    /**
-     * Converts this bit map to a byte array. The length of the returned
-     * byte array is {@code ((size() + 7) / 8)}.
-     */
-    public byte[] toByteArray() {
-        byte[] arr = new byte[(size + 7) / 8];
-        copyTo(arr, 0, arr.length);
-        return arr;
-    }
-
-    /**
-     * Converts this bit map to a long.
-     *
-     * @throws IllegalArgumentException if {@code (size() > 64)}
-     */
-    public long toLong() {
-        if (size > 64) {
-            throw new IllegalArgumentException("bit map of size " + size + " cannot be converted to long");
-        }
-        return low;
-    }
-
-    public boolean containsAll(BitMap other) {
-        assert this.size == other.size : "must have same size";
-        if ((low & other.low) != other.low) {
-            return false;
-        }
-        if (extra != null) {
-            for (int i = 0; i < extra.length; i++) {
-                if ((extra[i] & other.extra[i]) != other.extra[i]) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-}
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeBitMap.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/NodeBitMap.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,20 +30,22 @@
 
 public final class NodeBitMap extends NodeIterable<Node>{
     private final boolean autoGrow;
-    private final BitMap bitMap;
+    private final BitSet bitMap;
     private final Graph graph;
+    private int nodeCount;
 
     public NodeBitMap(Graph graph) {
         this(graph, false);
     }
 
     public NodeBitMap(Graph graph, boolean autoGrow) {
-        this(graph, autoGrow, new BitMap(graph.nodeIdCount()));
+        this(graph, autoGrow, graph.nodeIdCount(), new BitSet(graph.nodeIdCount()));
     }
 
-    private NodeBitMap(Graph graph, boolean autoGrow, BitMap bits) {
+    private NodeBitMap(Graph graph, boolean autoGrow, int nodeCount, BitSet bits) {
         this.graph = graph;
         this.autoGrow = autoGrow;
+        this.nodeCount = nodeCount;
         bitMap = bits;
     }
 
@@ -51,17 +53,13 @@
         return graph;
     }
 
-    public boolean setIntersect(NodeBitMap other) {
-        return bitMap.setIntersect(other.bitMap);
-    }
-
     public void setUnion(NodeBitMap other) {
-        bitMap.setUnion(other.bitMap);
+        bitMap.or(other.bitMap);
     }
 
     public void negate() {
         grow();
-        bitMap.negate();
+        bitMap.flip(0, nodeCount);
     }
 
     public boolean isNotNewMarked(Node node) {
@@ -73,15 +71,11 @@
     }
 
     public boolean isMarked(Node node) {
-        if (autoGrow && isNew(node)) {
-            return false;
-        }
-        assert check(node);
         return bitMap.get(node.id());
     }
 
     public boolean isNew(Node node) {
-        return node.id() >= bitMap.size();
+        return node.id() >= nodeCount;
     }
 
     public void mark(Node node) {
@@ -101,15 +95,15 @@
     }
 
     public void clearAll() {
-        bitMap.clearAll();
+        bitMap.clear();
     }
 
     public void grow(Node node) {
-        bitMap.grow(node.id() + 1);
+        nodeCount = Math.max(nodeCount, node.id() + 1);
     }
 
     public void grow() {
-        bitMap.grow(graph.nodeIdCount());
+        nodeCount = Math.max(nodeCount, graph.nodeIdCount());
     }
 
     private boolean check(Node node) {
@@ -119,11 +113,6 @@
         return true;
     }
 
-    @Override
-    public String toString() {
-        return bitMap.toBinaryString();
-    }
-
     public <T extends Node> void markAll(Iterable<T> nodes) {
         for (Node node : nodes) {
             mark(node);
@@ -186,7 +175,7 @@
     }
 
     public NodeBitMap copy() {
-        return new NodeBitMap(graph, autoGrow, bitMap.copy());
+        return new NodeBitMap(graph, autoGrow, nodeCount, (BitSet) bitMap.clone());
     }
 
     @Override
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java	Sat Jun 09 16:52:12 2012 +0200
@@ -67,7 +67,7 @@
         this.priority = priority;
     }
 
-    public RiResolvedMethod method() {
+    public ResolvedJavaMethod method() {
         return method;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Sat Jun 09 16:52:12 2012 +0200
@@ -105,9 +105,9 @@
             return true;
         } else {
             for (Object o : Debug.context()) {
-                if (o instanceof RiMethod) {
+                if (o instanceof JavaMethod) {
                     for (MethodFilter filter : methodFilter) {
-                        if (filter.matches((RiMethod) o)) {
+                        if (filter.matches((JavaMethod) o)) {
                             return true;
                         }
                     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Sat Jun 09 16:52:12 2012 +0200
@@ -142,7 +142,7 @@
         return vmToCompiler;
     }
 
-    public RiType lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve) {
+    public JavaType lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve) {
         if (returnType.length() == 1 && vmToCompiler instanceof VMToCompilerImpl) {
             VMToCompilerImpl exitsNative = (VMToCompilerImpl) vmToCompiler;
             Kind kind = Kind.fromPrimitiveOrVoidTypeChar(returnType.charAt(0));
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/MethodFilter.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/MethodFilter.java	Sat Jun 09 16:52:12 2012 +0200
@@ -106,22 +106,22 @@
         }
     }
 
-    public boolean matches(RiMethod o) {
+    public boolean matches(JavaMethod o) {
         // check method name first, since CiUtil.toJavaName is expensive
         if (methodName != null && !methodName.matcher(o.name()).matches()) {
             return false;
         }
-        if (clazz != null && !clazz.matcher(RiUtil.toJavaName(o.holder())).matches()) {
+        if (clazz != null && !clazz.matcher(MetaUtil.toJavaName(o.holder())).matches()) {
             return false;
         }
         if (signature != null) {
-            RiSignature sig = o.signature();
+            Signature sig = o.signature();
             if (sig.argumentCount(false) != signature.length) {
                 return false;
             }
             for (int i = 0; i < signature.length; i++) {
-                RiType type = sig.argumentTypeAt(i, null);
-                String javaName = RiUtil.toJavaName(type);
+                JavaType type = sig.argumentTypeAt(i, null);
+                String javaName = MetaUtil.toJavaName(type);
                 if (signature[i] != null && !signature[i].matcher(javaName).matches()) {
                     return false;
                 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Sat Jun 09 16:52:12 2012 +0200
@@ -41,25 +41,25 @@
 
     String RiMethod_signature(HotSpotMethodResolved method);
 
-    RiExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
+    ExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
 
     boolean RiMethod_hasBalancedMonitors(HotSpotMethodResolved method);
 
-    RiMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
+    JavaMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
 
     int RiMethod_invocationCount(HotSpotMethodResolved method);
 
     HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
 
-    RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
+    JavaType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
 
     Object RiConstantPool_lookupConstant(HotSpotTypeResolved pool, int cpi);
 
-    RiMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
+    JavaMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
 
-    RiType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
+    JavaType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
 
-    RiField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
+    JavaField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
 
     void RiConstantPool_loadReferencedType(HotSpotTypeResolved pool, int cpi, byte byteCode);
 
@@ -67,39 +67,39 @@
 
     HotSpotVMConfig getConfiguration();
 
-    RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
+    JavaMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
 
-    boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
+    boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, JavaType other);
 
-    RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
+    JavaType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
 
-    RiType getPrimitiveArrayType(Kind kind);
+    JavaType getPrimitiveArrayType(Kind kind);
 
-    RiType RiType_arrayOf(HotSpotTypeResolved klass);
+    JavaType RiType_arrayOf(HotSpotTypeResolved klass);
 
-    RiType RiType_componentType(HotSpotTypeResolved klass);
+    JavaType RiType_componentType(HotSpotTypeResolved klass);
 
     boolean RiType_isInitialized(HotSpotTypeResolved klass);
 
-    RiType getType(Class<?> javaClass);
+    JavaType getType(Class<?> javaClass);
 
-    RiType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
+    JavaType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
 
-    RiType RiType_superType(HotSpotTypeResolved klass);
+    JavaType RiType_superType(HotSpotTypeResolved klass);
 
     int getArrayLength(Constant array);
 
     boolean compareConstantObjects(Constant x, Constant y);
 
-    RiType getRiType(Constant constant);
+    JavaType getRiType(Constant constant);
 
-    RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
+    ResolvedJavaField[] RiType_fields(HotSpotTypeResolved klass);
 
     boolean RiMethod_hasCompiledCode(HotSpotMethodResolved method);
 
     int RiMethod_getCompiledCodeSize(HotSpotMethodResolved method);
 
-    RiMethod getRiMethod(Method reflectionMethod);
+    JavaMethod getRiMethod(Method reflectionMethod);
 
     long getMaxCallTargetOffset(CiRuntimeCall rtcall);
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Sat Jun 09 16:52:12 2012 +0200
@@ -38,7 +38,7 @@
     // Checkstyle: stop
 
     @Override
-    public native RiMethod getRiMethod(Method reflectionMethod);
+    public native JavaMethod getRiMethod(Method reflectionMethod);
 
     @Override
     public native byte[] RiMethod_code(HotSpotMethodResolved method);
@@ -47,34 +47,34 @@
     public native String RiMethod_signature(HotSpotMethodResolved method);
 
     @Override
-    public native RiExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
+    public native ExceptionHandler[] RiMethod_exceptionHandlers(HotSpotMethodResolved method);
 
     @Override
     public native boolean RiMethod_hasBalancedMonitors(HotSpotMethodResolved method);
 
     @Override
-    public native RiMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
+    public native JavaMethod RiMethod_uniqueConcreteMethod(HotSpotMethodResolved method);
 
     @Override
     public native int RiMethod_invocationCount(HotSpotMethodResolved method);
 
     @Override
-    public native RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
+    public native JavaType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass, boolean eagerResolve);
 
     @Override
     public native Object RiConstantPool_lookupConstant(HotSpotTypeResolved pool, int cpi);
 
     @Override
-    public native RiMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
+    public native JavaMethod RiConstantPool_lookupMethod(HotSpotTypeResolved pool, int cpi, byte byteCode);
 
     @Override
-    public native RiType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
+    public native JavaType RiConstantPool_lookupType(HotSpotTypeResolved pool, int cpi);
 
     @Override
     public native void RiConstantPool_loadReferencedType(HotSpotTypeResolved pool, int cpi, byte byteCode);
 
     @Override
-    public native RiField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
+    public native JavaField RiConstantPool_lookupField(HotSpotTypeResolved pool, int cpi, byte byteCode);
 
     @Override
     public native HotSpotCompiledMethod installMethod(HotSpotTargetMethod targetMethod, boolean makeDefault, HotSpotCodeInfo info);
@@ -83,28 +83,28 @@
     public native HotSpotVMConfig getConfiguration();
 
     @Override
-    public native RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
+    public native JavaMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature);
 
     @Override
-    public native boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other);
+    public native boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, JavaType other);
 
     @Override
-    public native RiType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
+    public native JavaType RiType_leastCommonAncestor(HotSpotTypeResolved thisType, HotSpotTypeResolved otherType);
 
     @Override
-    public native RiType getPrimitiveArrayType(Kind kind);
+    public native JavaType getPrimitiveArrayType(Kind kind);
 
     @Override
-    public native RiType RiType_arrayOf(HotSpotTypeResolved klass);
+    public native JavaType RiType_arrayOf(HotSpotTypeResolved klass);
 
     @Override
-    public native RiType RiType_componentType(HotSpotTypeResolved klass);
+    public native JavaType RiType_componentType(HotSpotTypeResolved klass);
 
     @Override
-    public native RiType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
+    public native JavaType RiType_uniqueConcreteSubtype(HotSpotTypeResolved klass);
 
     @Override
-    public native RiType RiType_superType(HotSpotTypeResolved klass);
+    public native JavaType RiType_superType(HotSpotTypeResolved klass);
 
     @Override
     public native boolean RiType_isInitialized(HotSpotTypeResolved klass);
@@ -113,7 +113,7 @@
     public native HotSpotMethodData RiMethod_methodData(HotSpotMethodResolved method);
 
     @Override
-    public native RiType getType(Class<?> javaClass);
+    public native JavaType getType(Class<?> javaClass);
 
     @Override
     public int getArrayLength(Constant array) {
@@ -126,7 +126,7 @@
     }
 
     @Override
-    public RiType getRiType(Constant constant) {
+    public JavaType getRiType(Constant constant) {
         Object o = constant.asObject();
         if (o == null) {
             return null;
@@ -135,7 +135,7 @@
     }
 
     @Override
-    public native RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
+    public native ResolvedJavaField[] RiType_fields(HotSpotTypeResolved klass);
 
     @Override
     public native boolean RiMethod_hasCompiledCode(HotSpotMethodResolved method);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Sat Jun 09 16:52:12 2012 +0200
@@ -45,17 +45,17 @@
 
     PrintStream log();
 
-    RiMethod createRiMethodUnresolved(String name, String signature, RiType holder);
+    JavaMethod createRiMethodUnresolved(String name, String signature, JavaType holder);
 
-    RiSignature createRiSignature(String signature);
+    Signature createRiSignature(String signature);
 
-    RiField createRiField(RiType holder, String name, RiType type, int offset, int flags);
+    JavaField createRiField(JavaType holder, String name, JavaType type, int offset, int flags);
 
-    RiType createRiType(HotSpotConstantPool pool, String name);
+    JavaType createRiType(HotSpotConstantPool pool, String name);
 
-    RiType createRiTypePrimitive(int basicType);
+    JavaType createRiTypePrimitive(int basicType);
 
-    RiType createRiTypeUnresolved(String name);
+    JavaType createRiTypeUnresolved(String name);
 
     Constant createCiConstant(Kind kind, long value);
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Sat Jun 09 16:52:12 2012 +0200
@@ -223,7 +223,7 @@
     }
 
     private void enqueue(Method m) throws Throwable {
-        RiMethod riMethod = compiler.getRuntime().getRiMethod(m);
+        JavaMethod riMethod = compiler.getRuntime().getResolvedJavaMethod(m);
         assert !Modifier.isAbstract(((HotSpotMethodResolved) riMethod).accessFlags()) && !Modifier.isNative(((HotSpotMethodResolved) riMethod).accessFlags()) : riMethod;
         compileMethod((HotSpotMethodResolved) riMethod, 0, false, 10);
     }
@@ -397,17 +397,17 @@
     }
 
     @Override
-    public RiMethod createRiMethodUnresolved(String name, String signature, RiType holder) {
+    public JavaMethod createRiMethodUnresolved(String name, String signature, JavaType holder) {
         return new HotSpotMethodUnresolved(name, signature, holder);
     }
 
     @Override
-    public RiSignature createRiSignature(String signature) {
+    public Signature createRiSignature(String signature) {
         return new HotSpotSignature(signature);
     }
 
     @Override
-    public RiField createRiField(RiType holder, String name, RiType type, int offset, int flags) {
+    public JavaField createRiField(JavaType holder, String name, JavaType type, int offset, int flags) {
         if (offset != -1) {
             HotSpotTypeResolved resolved = (HotSpotTypeResolved) holder;
             return resolved.createRiField(name, type, offset, flags);
@@ -416,12 +416,12 @@
     }
 
     @Override
-    public RiType createRiType(HotSpotConstantPool pool, String name) {
+    public JavaType createRiType(HotSpotConstantPool pool, String name) {
         throw new RuntimeException("not implemented");
     }
 
     @Override
-    public RiType createRiTypePrimitive(int basicType) {
+    public JavaType createRiTypePrimitive(int basicType) {
         switch (basicType) {
             case 4:
                 return typeBoolean;
@@ -447,7 +447,7 @@
     }
 
     @Override
-    public RiType createRiTypeUnresolved(String name) {
+    public JavaType createRiTypeUnresolved(String name) {
         return new HotSpotTypeUnresolved(name);
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java	Sat Jun 09 16:52:12 2012 +0200
@@ -52,7 +52,7 @@
 
         protected long sortCount;
 
-        protected Counter(RiResolvedMethod method) {
+        protected Counter(ResolvedJavaMethod method) {
             this.method = CiUtil.format("%H.%n", method);
             counters.add(this);
         }
@@ -127,7 +127,7 @@
     }
 
 
-    public static void emitCounter(LIRGenerator gen, RiResolvedMethod method) {
+    public static void emitCounter(LIRGenerator gen, ResolvedJavaMethod method) {
         if (!GraalOptions.MethodEntryCounters) {
             return;
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/CurrentThread.java	Sat Jun 09 16:52:12 2012 +0200
@@ -33,8 +33,8 @@
 
     private int threadObjectOffset;
 
-    public CurrentThread(int threadObjectOffset, RiRuntime runtime) {
-        super(StampFactory.declaredNonNull(runtime.getType(Thread.class)));
+    public CurrentThread(int threadObjectOffset, CodeCacheProvider runtime) {
+        super(StampFactory.declaredNonNull(runtime.getResolvedJavaType(Thread.class)));
         this.threadObjectOffset = threadObjectOffset;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/TailcallNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -58,7 +58,7 @@
     public void generate(LIRGeneratorTool generator) {
         LIRGenerator gen = (LIRGenerator) generator;
         HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
-        RiResolvedMethod method = frameState.method();
+        ResolvedJavaMethod method = frameState.method();
         boolean isStatic = Modifier.isStatic(method.accessFlags());
 
         Kind[] signature = CiUtil.signatureToKinds(method.signature(), isStatic ? null : method.holder().kind());
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCodeInfo.java	Sat Jun 09 16:52:12 2012 +0200
@@ -62,7 +62,7 @@
     }
 
     @Override
-    public RiResolvedMethod method() {
+    public ResolvedJavaMethod method() {
         return method;
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Sat Jun 09 16:52:12 2012 +0200
@@ -38,15 +38,15 @@
 
     private static final long serialVersionUID = 156632908220561612L;
 
-    private final RiResolvedMethod method;
+    private final ResolvedJavaMethod method;
     private long nmethod;
 
-    public HotSpotCompiledMethod(RiResolvedMethod method) {
+    public HotSpotCompiledMethod(ResolvedJavaMethod method) {
         this.method = method;
     }
 
     @Override
-    public RiResolvedMethod method() {
+    public ResolvedJavaMethod method() {
         return method;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotConstantPool.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotConstantPool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -28,7 +28,7 @@
 /**
  * Implementation of RiConstantPool for HotSpot.
  */
-public class HotSpotConstantPool extends CompilerObject implements RiConstantPool {
+public class HotSpotConstantPool extends CompilerObject implements ConstantPool {
 
     private static final long serialVersionUID = -5443206401485234850L;
 
@@ -45,22 +45,22 @@
     }
 
     @Override
-    public RiSignature lookupSignature(int cpi) {
+    public Signature lookupSignature(int cpi) {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public RiMethod lookupMethod(int cpi, int byteCode) {
+    public JavaMethod lookupMethod(int cpi, int byteCode) {
         return HotSpotGraalRuntime.getInstance().getCompilerToVM().RiConstantPool_lookupMethod(type, cpi, (byte) byteCode);
     }
 
     @Override
-    public RiType lookupType(int cpi, int opcode) {
+    public JavaType lookupType(int cpi, int opcode) {
         return HotSpotGraalRuntime.getInstance().getCompilerToVM().RiConstantPool_lookupType(type, cpi);
     }
 
     @Override
-    public RiField lookupField(int cpi, int opcode) {
+    public JavaField lookupField(int cpi, int opcode) {
         return HotSpotGraalRuntime.getInstance().getCompilerToVM().RiConstantPool_lookupField(type, cpi, (byte) opcode);
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotExceptionHandler.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotExceptionHandler.java	Sat Jun 09 16:52:12 2012 +0200
@@ -26,13 +26,13 @@
 import com.oracle.graal.hotspot.*;
 
 
-public final class HotSpotExceptionHandler extends CompilerObject implements RiExceptionHandler {
+public final class HotSpotExceptionHandler extends CompilerObject implements ExceptionHandler {
     private static final long serialVersionUID = 7110038548061733686L;
     private int startBci;
     private int endBci;
     private int handlerBci;
     private int catchClassIndex;
-    private RiType catchClass;
+    private JavaType catchClass;
 
     private HotSpotExceptionHandler() {
     }
@@ -63,7 +63,7 @@
     }
 
     @Override
-    public RiType catchType() {
+    public JavaType catchType() {
         return catchClass;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Sat Jun 09 16:52:12 2012 +0200
@@ -28,24 +28,24 @@
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiType.*;
+import com.oracle.graal.api.meta.JavaType.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.hotspot.*;
 
 /**
  * Represents a field in a HotSpot type.
  */
-public class HotSpotField extends CompilerObject implements RiResolvedField {
+public class HotSpotField extends CompilerObject implements ResolvedJavaField {
 
     private static final long serialVersionUID = 7692985878836955683L;
-    private final RiResolvedType holder;
+    private final ResolvedJavaType holder;
     private final String name;
-    private final RiType type;
+    private final JavaType type;
     private final int offset;
     private final int accessFlags;
     private Constant constant;                // Constant part only valid for static fields.
 
-    public HotSpotField(RiResolvedType holder, String name, RiType type, int offset, int accessFlags) {
+    public HotSpotField(ResolvedJavaType holder, String name, JavaType type, int offset, int accessFlags) {
         this.holder = holder;
         this.name = name;
         this.type = type;
@@ -87,7 +87,7 @@
     }
 
     @Override
-    public RiResolvedType holder() {
+    public ResolvedJavaType holder() {
         return holder;
     }
 
@@ -102,7 +102,7 @@
     }
 
     @Override
-    public RiType type() {
+    public JavaType type() {
         return type;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotGraphCache.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotGraphCache.java	Sat Jun 09 16:52:12 2012 +0200
@@ -44,7 +44,7 @@
  * depends upon the reachability of the keys.
  *
  * Therefore the graph cache is implemented in such a way that it stores its cache entries within the RiResolvedMethod.
- * It uses the {@link RiResolvedMethod#compilerStorage()} map with the HotSpotGraphCache instance as key.
+ * It uses the {@link ResolvedJavaMethod#compilerStorage()} map with the HotSpotGraphCache instance as key.
  * The cached graph will be kept alive as long as the RiResolvedMethod is alive, but does not prevent the method, and
  * therefore the class, from being unloaded.
  *
@@ -65,7 +65,7 @@
      * An ordered hash map for looking up the methods corresponding to a specific graph id. It enforces the maximum
      * graph cache size by removing the oldest (in insertion-order) element if the cache gets too big.
      */
-    private final class LRUCache extends LinkedHashMap<Long, WeakReference<RiResolvedMethod>> {
+    private final class LRUCache extends LinkedHashMap<Long, WeakReference<ResolvedJavaMethod>> {
 
         private static final long serialVersionUID = -3973307040793397840L;
 
@@ -74,9 +74,9 @@
         }
 
         @Override
-        protected boolean removeEldestEntry(Entry<Long, WeakReference<RiResolvedMethod>> eldest) {
+        protected boolean removeEldestEntry(Entry<Long, WeakReference<ResolvedJavaMethod>> eldest) {
             if (size() > GraalOptions.GraphCacheSize) {
-                RiResolvedMethod method = eldest.getValue().get();
+                ResolvedJavaMethod method = eldest.getValue().get();
                 if (method != null) {
                     StructuredGraph cachedGraph = (StructuredGraph) method.compilerStorage().get(HotSpotGraphCache.this);
                     if (cachedGraph != null && cachedGraph.graphId() == eldest.getKey()) {
@@ -90,7 +90,7 @@
         }
     }
 
-    private final Map<Long, WeakReference<RiResolvedMethod>> cachedGraphIds = Collections.synchronizedMap(new LRUCache());
+    private final Map<Long, WeakReference<ResolvedJavaMethod>> cachedGraphIds = Collections.synchronizedMap(new LRUCache());
 
     public HotSpotGraphCache() {
         if (GraalOptions.PrintGraphCache) {
@@ -109,7 +109,7 @@
     }
 
     @Override
-    public StructuredGraph get(RiResolvedMethod method) {
+    public StructuredGraph get(ResolvedJavaMethod method) {
         StructuredGraph result = (StructuredGraph) method.compilerStorage().get(this);
 
         if (GraalOptions.PrintGraphCache) {
@@ -135,8 +135,8 @@
 
     public void clear() {
         synchronized (cachedGraphIds) {
-            for (WeakReference<RiResolvedMethod> ref : cachedGraphIds.values()) {
-                RiResolvedMethod method = ref.get();
+            for (WeakReference<ResolvedJavaMethod> ref : cachedGraphIds.values()) {
+                ResolvedJavaMethod method = ref.get();
                 if (method != null) {
                     method.compilerStorage().remove(this);
                 }
@@ -152,8 +152,8 @@
 
     public void removeGraphs(long[] deoptedGraphs) {
         for (long graphId : deoptedGraphs) {
-            WeakReference<RiResolvedMethod> ref = cachedGraphIds.get(graphId);
-            RiResolvedMethod method = ref == null ? null : ref.get();
+            WeakReference<ResolvedJavaMethod> ref = cachedGraphIds.get(graphId);
+            ResolvedJavaMethod method = ref == null ? null : ref.get();
             if (method != null) {
                 StructuredGraph cachedGraph = (StructuredGraph) method.compilerStorage().get(this);
                 if (cachedGraph != null && cachedGraph.graphId() == graphId) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethod.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethod.java	Sat Jun 09 16:52:12 2012 +0200
@@ -25,7 +25,7 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.hotspot.*;
 
-public abstract class HotSpotMethod extends CompilerObject implements RiMethod {
+public abstract class HotSpotMethod extends CompilerObject implements JavaMethod {
 
     private static final long serialVersionUID = 7167491397941960839L;
     protected String name;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodData.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodData.java	Sat Jun 09 16:52:12 2012 +0200
@@ -27,7 +27,7 @@
 import sun.misc.*;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiTypeProfile.*;
+import com.oracle.graal.api.meta.JavaTypeProfile.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.hotspot.*;
 
@@ -42,8 +42,8 @@
 
     // TODO (chaeubl) use same logic as in NodeClass?
     private static final Unsafe unsafe = Unsafe.getUnsafe();
-    private static final HotSpotMethodDataAccessor NO_DATA_NO_EXCEPTION_ACCESSOR = new NoMethodData(RiExceptionSeen.FALSE);
-    private static final HotSpotMethodDataAccessor NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR = new NoMethodData(RiExceptionSeen.NOT_SUPPORTED);
+    private static final HotSpotMethodDataAccessor NO_DATA_NO_EXCEPTION_ACCESSOR = new NoMethodData(ExceptionSeen.FALSE);
+    private static final HotSpotMethodDataAccessor NO_DATA_EXCEPTION_POSSIBLY_NOT_RECORDED_ACCESSOR = new NoMethodData(ExceptionSeen.NOT_SUPPORTED);
     private static final HotSpotVMConfig config;
     // sorted by tag
     private static final HotSpotMethodDataAccessor[] PROFILE_DATA_ACCESSORS = {
@@ -76,7 +76,7 @@
         return position >= 0 && position < normalDataSize + extraDataSize;
     }
 
-    public int getDeoptimizationCount(RiDeoptReason reason) {
+    public int getDeoptimizationCount(DeoptimizationReason reason) {
         int reasonIndex = HotSpotGraalRuntime.getInstance().getRuntime().convertDeoptReason(reason);
         return unsafe.getByte(hotspotMirror, (long) config.methodDataOopTrapHistoryOffset + reasonIndex) & 0xFF;
     }
@@ -189,12 +189,12 @@
         }
 
         @Override
-        public RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
-            return RiExceptionSeen.get((getFlags(data, position) & EXCEPTIONS_MASK) != 0);
+        public ExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
+            return ExceptionSeen.get((getFlags(data, position) & EXCEPTIONS_MASK) != 0);
         }
 
         @Override
-        public RiTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
+        public JavaTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
             return null;
         }
 
@@ -226,9 +226,9 @@
         private static final int NO_DATA_TAG = 0;
         private static final int NO_DATA_SIZE = cellIndexToOffset(0);
 
-        private final RiExceptionSeen exceptionSeen;
+        private final ExceptionSeen exceptionSeen;
 
-        protected NoMethodData(RiExceptionSeen exceptionSeen) {
+        protected NoMethodData(ExceptionSeen exceptionSeen) {
             super(NO_DATA_TAG, NO_DATA_SIZE);
             this.exceptionSeen = exceptionSeen;
         }
@@ -240,7 +240,7 @@
 
 
         @Override
-        public RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
+        public ExceptionSeen getExceptionSeen(HotSpotMethodData data, int position) {
             return exceptionSeen;
         }
     }
@@ -328,10 +328,10 @@
         }
 
         @Override
-        public RiTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
+        public JavaTypeProfile getTypeProfile(HotSpotMethodData data, int position) {
             int typeProfileWidth = config.typeProfileWidth;
 
-            RiResolvedType[] types = new RiResolvedType[typeProfileWidth];
+            ResolvedJavaType[] types = new ResolvedJavaType[typeProfileWidth];
             long[] counts = new long[typeProfileWidth];
             long totalCount = 0;
             int entries = 0;
@@ -347,7 +347,7 @@
                     }
 
 
-                    types[entries] = (RiResolvedType) graalMirror;
+                    types[entries] = (ResolvedJavaType) graalMirror;
 
                     long count = data.readUnsignedInt(position, getCountOffset(i));
                     totalCount += count;
@@ -367,7 +367,7 @@
             return getCounterValue(data, position);
         }
 
-        private static RiTypeProfile createRiTypeProfile(RiResolvedType[] types, long[] counts, long totalCount, int entries) {
+        private static JavaTypeProfile createRiTypeProfile(ResolvedJavaType[] types, long[] counts, long totalCount, int entries) {
             if (entries <= 0 || totalCount < GraalOptions.MatureExecutionsTypeProfile) {
                 return null;
             }
@@ -384,7 +384,7 @@
             Arrays.sort(ptypes);
 
             double notRecordedTypeProbability = entries < config.typeProfileWidth ? 0.0 : Math.min(1.0, Math.max(0.0, 1.0 - totalProbability));
-            return new RiTypeProfile(notRecordedTypeProbability, ptypes);
+            return new JavaTypeProfile(notRecordedTypeProbability, ptypes);
         }
 
         private static int getReceiverOffset(int row) {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodDataAccessor.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodDataAccessor.java	Sat Jun 09 16:52:12 2012 +0200
@@ -26,7 +26,7 @@
 
 /**
  * Interface for accessor objects that encapsulate the logic for accessing the different kinds of data in a HotSpot methodDataOop.
- * This interface is similar to the interface {@link RiProfilingInfo}, but most methods require a MethodDataObject and the
+ * This interface is similar to the interface {@link ProfilingInfo}, but most methods require a MethodDataObject and the
  * exact position within the methodData.
  */
 public interface HotSpotMethodDataAccessor {
@@ -48,9 +48,9 @@
      */
     int getSize(HotSpotMethodData data, int position);
 
-    RiTypeProfile getTypeProfile(HotSpotMethodData data, int position);
+    JavaTypeProfile getTypeProfile(HotSpotMethodData data, int position);
     double getBranchTakenProbability(HotSpotMethodData data, int position);
     double[] getSwitchProbabilities(HotSpotMethodData data, int position);
-    RiExceptionSeen getExceptionSeen(HotSpotMethodData data, int position);
+    ExceptionSeen getExceptionSeen(HotSpotMethodData data, int position);
     int getExecutionCount(HotSpotMethodData data, int position);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolved.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolved.java	Sat Jun 09 16:52:12 2012 +0200
@@ -25,9 +25,9 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.hotspot.*;
 
-public interface HotSpotMethodResolved extends RiResolvedMethod {
+public interface HotSpotMethodResolved extends ResolvedJavaMethod {
 
-    RiResolvedMethod uniqueConcreteMethod();
+    ResolvedJavaMethod uniqueConcreteMethod();
     int vtableEntryOffset();
 
     void setCurrentTask(CompilationTask task);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodResolvedImpl.java	Sat Jun 09 16:52:12 2012 +0200
@@ -53,10 +53,10 @@
     private final int accessFlags;
     private final int maxLocals;
     private final int maxStackSize;
-    private RiSignature signature;
+    private Signature signature;
     private Boolean hasBalancedMonitors;
     private Map<Object, Object> compilerStorage;
-    private RiResolvedType holder;
+    private ResolvedJavaType holder;
     private HotSpotMethodData methodData;
     private byte[] code;
     private boolean canBeInlined;
@@ -69,7 +69,7 @@
     }
 
     @Override
-    public RiResolvedType holder() {
+    public ResolvedJavaType holder() {
         return holder;
     }
 
@@ -98,7 +98,7 @@
     }
 
     @Override
-    public RiExceptionHandler[] exceptionHandlers() {
+    public ExceptionHandler[] exceptionHandlers() {
         return HotSpotGraalRuntime.getInstance().getCompilerToVM().RiMethod_exceptionHandlers(this);
     }
 
@@ -161,12 +161,12 @@
     }
 
     @Override
-    public RiResolvedMethod uniqueConcreteMethod() {
-        return (RiResolvedMethod) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiMethod_uniqueConcreteMethod(this);
+    public ResolvedJavaMethod uniqueConcreteMethod() {
+        return (ResolvedJavaMethod) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiMethod_uniqueConcreteMethod(this);
     }
 
     @Override
-    public RiSignature signature() {
+    public Signature signature() {
         if (signature == null) {
             signature = new HotSpotSignature(HotSpotGraalRuntime.getInstance().getCompilerToVM().RiMethod_signature(this));
         }
@@ -192,7 +192,7 @@
     }
 
     @Override
-    public RiResolvedType accessor() {
+    public ResolvedJavaType accessor() {
         return null;
     }
 
@@ -231,7 +231,7 @@
         return GraalOptions.PICache != null && (profilingInfoFilter == null || profilingInfoFilter.matches(this));
     }
 
-    private RiProfilingInfo loadProfilingInfo() {
+    private ProfilingInfo loadProfilingInfo() {
         if (!useProfilingInfoCache()) {
             return null;
         }
@@ -253,7 +253,7 @@
         }
     }
 
-    private void saveProfilingInfo(RiProfilingInfo info) {
+    private void saveProfilingInfo(ProfilingInfo info) {
         if (useProfilingInfoCache()) {
             synchronized (this) {
                 String base = JniMangle.mangleMethod(holder, name, signature(), false);
@@ -270,8 +270,8 @@
     }
 
     @Override
-    public RiProfilingInfo profilingInfo() {
-        RiProfilingInfo info = loadProfilingInfo();
+    public ProfilingInfo profilingInfo() {
+        ProfilingInfo info = loadProfilingInfo();
         if (info != null) {
             return info;
         }
@@ -282,7 +282,7 @@
 
         if (methodData == null || (!methodData.hasNormalData() && !methodData.hasExtraData())) {
             // Be optimistic and return false for exceptionSeen. A methodDataOop is allocated in case of a deoptimization.
-            info = BaseProfilingInfo.get(RiExceptionSeen.FALSE);
+            info = BaseProfilingInfo.get(ExceptionSeen.FALSE);
         } else {
             info = new HotSpotProfilingInfo(methodData, codeSize);
             saveProfilingInfo(info);
@@ -299,7 +299,7 @@
     }
 
     @Override
-    public RiConstantPool getConstantPool() {
+    public ConstantPool getConstantPool() {
         return ((HotSpotTypeResolvedImpl) holder()).constantPool();
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodUnresolved.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotMethodUnresolved.java	Sat Jun 09 16:52:12 2012 +0200
@@ -29,22 +29,22 @@
  */
 public final class HotSpotMethodUnresolved extends HotSpotMethod {
     private static final long serialVersionUID = 5610263481791970079L;
-    private final RiSignature signature;
-    protected RiType holder;
+    private final Signature signature;
+    protected JavaType holder;
 
-    public HotSpotMethodUnresolved(String name, String signature, RiType holder) {
+    public HotSpotMethodUnresolved(String name, String signature, JavaType holder) {
         this.name = name;
         this.holder = holder;
         this.signature = new HotSpotSignature(signature);
     }
 
     @Override
-    public RiSignature signature() {
+    public Signature signature() {
         return signature;
     }
 
     @Override
-    public RiType holder() {
+    public JavaType holder() {
         return holder;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotProfilingInfo.java	Sat Jun 09 16:52:12 2012 +0200
@@ -28,7 +28,7 @@
 import com.oracle.graal.hotspot.*;
 
 
-public final class HotSpotProfilingInfo extends CompilerObject implements RiProfilingInfo {
+public final class HotSpotProfilingInfo extends CompilerObject implements ProfilingInfo {
 
     private static final long serialVersionUID = -8307682725047864875L;
     private static final DebugMetric metricInsufficentSpace = Debug.metric("InsufficientSpaceForProfilingData");
@@ -53,7 +53,7 @@
     }
 
     @Override
-    public RiTypeProfile getTypeProfile(int bci) {
+    public JavaTypeProfile getTypeProfile(int bci) {
         findBCI(bci, false);
         return dataAccessor.getTypeProfile(methodData, position);
     }
@@ -71,7 +71,7 @@
     }
 
     @Override
-    public RiExceptionSeen getExceptionSeen(int bci) {
+    public ExceptionSeen getExceptionSeen(int bci) {
         findBCI(bci, true);
         return dataAccessor.getExceptionSeen(methodData, position);
     }
@@ -83,7 +83,7 @@
     }
 
     @Override
-    public int getDeoptimizationCount(RiDeoptReason reason) {
+    public int getDeoptimizationCount(DeoptimizationReason reason) {
         return methodData.getDeoptimizationCount(reason);
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Sat Jun 09 16:52:12 2012 +0200
@@ -31,7 +31,7 @@
 import com.oracle.graal.api.code.CiTargetMethod.*;
 import com.oracle.graal.api.code.CiUtil.*;
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiType.*;
+import com.oracle.graal.api.meta.JavaType.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.target.*;
 import com.oracle.graal.cri.*;
@@ -174,18 +174,18 @@
     }
 
     @Override
-    public String disassemble(RiResolvedMethod method) {
+    public String disassemble(ResolvedJavaMethod method) {
         return compiler.getCompilerToVM().disassembleJava((HotSpotMethodResolved) method);
     }
 
     @Override
-    public RiResolvedType asRiType(Kind kind) {
-        return (RiResolvedType) compiler.getCompilerToVM().getType(kind.toJavaClass());
+    public ResolvedJavaType getResolvedJavaType(Kind kind) {
+        return (ResolvedJavaType) compiler.getCompilerToVM().getType(kind.toJavaClass());
     }
 
     @Override
-    public RiResolvedType getTypeOf(Constant constant) {
-        return (RiResolvedType) compiler.getCompilerToVM().getRiType(constant);
+    public ResolvedJavaType getTypeOf(Constant constant) {
+        return (ResolvedJavaType) compiler.getCompilerToVM().getRiType(constant);
     }
 
     @Override
@@ -200,7 +200,7 @@
     }
 
     @Override
-    public CiRegisterConfig getRegisterConfig(RiMethod method) {
+    public CiRegisterConfig getRegisterConfig(JavaMethod method) {
         return regConfig;
     }
 
@@ -269,7 +269,7 @@
             CompareAndSwapNode cas = (CompareAndSwapNode) n;
             ValueNode expected = cas.expected();
             if (expected.kind() == Kind.Object && !cas.newValue().isNullConstant()) {
-                RiResolvedType type = cas.object().objectStamp().type();
+                ResolvedJavaType type = cas.object().objectStamp().type();
                 if (type != null && !type.isArrayClass() && type.toJava() != Object.class) {
                     // Use a field write barrier since it's not an array store
                     FieldWriteBarrier writeBarrier = graph.add(new FieldWriteBarrier(cas.object()));
@@ -301,9 +301,9 @@
             ValueNode array = storeIndexed.array();
             if (elementKind == Kind.Object && !value.isNullConstant()) {
                 // Store check!
-                RiResolvedType arrayType = array.objectStamp().type();
+                ResolvedJavaType arrayType = array.objectStamp().type();
                 if (arrayType != null && array.objectStamp().isExactType()) {
-                    RiResolvedType elementType = arrayType.componentType();
+                    ResolvedJavaType elementType = arrayType.componentType();
                     if (elementType.superType() != null) {
                         ConstantNode type = ConstantNode.forCiConstant(elementType.getEncoding(Representation.ObjectHub), this, graph);
                         checkcast = graph.add(new CheckCastNode(type, elementType, value));
@@ -369,7 +369,7 @@
             if (option.length() == 0) {
                 return true;
             }
-            RiResolvedMethod method = graph.method();
+            ResolvedJavaMethod method = graph.method();
             return method != null && CiUtil.format("%H.%n", method).contains(option);
         }
         return false;
@@ -386,15 +386,15 @@
     private static ValueNode createBoundsCheck(AccessIndexedNode n, CiLoweringTool tool) {
         StructuredGraph graph = (StructuredGraph) n.graph();
         ArrayLengthNode arrayLength = graph.add(new ArrayLengthNode(n.array()));
-        ValueNode guard = tool.createGuard(graph.unique(new IntegerBelowThanNode(n.index(), arrayLength)), RiDeoptReason.BoundsCheckException, CiDeoptAction.InvalidateReprofile, n.leafGraphId());
+        ValueNode guard = tool.createGuard(graph.unique(new IntegerBelowThanNode(n.index(), arrayLength)), DeoptimizationReason.BoundsCheckException, CiDeoptAction.InvalidateReprofile, n.leafGraphId());
 
         graph.addBeforeFixed(n, arrayLength);
         return guard;
     }
 
     @Override
-    public StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List<? extends Node> parameters) {
-        RiType holder = method.holder();
+    public StructuredGraph intrinsicGraph(ResolvedJavaMethod caller, int bci, ResolvedJavaMethod method, List<? extends Node> parameters) {
+        JavaType holder = method.holder();
         String fullName = method.name() + method.signature().asString();
         String holderName = holder.name();
         if (holderName.equals("Ljava/lang/Object;")) {
@@ -411,7 +411,7 @@
                 StructuredGraph graph = new StructuredGraph();
                 LocalNode receiver = graph.unique(new LocalNode(0, StampFactory.objectNonNull()));
                 SafeReadNode klassOop = safeReadHub(graph, receiver, StructuredGraph.INVALID_GRAPH_ID);
-                Stamp resultStamp = StampFactory.declaredNonNull(getType(Class.class));
+                Stamp resultStamp = StampFactory.declaredNonNull(getResolvedJavaType(Class.class));
                 FloatingReadNode result = graph.unique(new FloatingReadNode(klassOop, LocationNode.create(LocationNode.FINAL_LOCATION, Kind.Object, config.classMirrorOffset, graph), null, resultStamp));
                 ReturnNode ret = graph.add(new ReturnNode(result));
                 graph.start().setNext(klassOop);
@@ -449,8 +449,8 @@
         return graph.add(new SafeReadNode(value, LocationNode.create(LocationNode.FINAL_LOCATION, kind, offset, graph), stamp, leafGraphId));
     }
 
-    public RiResolvedType getType(Class<?> clazz) {
-        return (RiResolvedType) compiler.getCompilerToVM().getType(clazz);
+    public ResolvedJavaType getResolvedJavaType(Class<?> clazz) {
+        return (ResolvedJavaType) compiler.getCompilerToVM().getType(clazz);
     }
 
     public Object asCallTarget(Object target) {
@@ -461,11 +461,11 @@
         return compiler.getCompilerToVM().getMaxCallTargetOffset(rtcall);
     }
 
-    public RiResolvedMethod getRiMethod(Method reflectionMethod) {
-        return (RiResolvedMethod) compiler.getCompilerToVM().getRiMethod(reflectionMethod);
+    public ResolvedJavaMethod getResolvedJavaMethod(Method reflectionMethod) {
+        return (ResolvedJavaMethod) compiler.getCompilerToVM().getRiMethod(reflectionMethod);
     }
 
-    private static HotSpotCodeInfo makeInfo(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) {
+    private static HotSpotCodeInfo makeInfo(ResolvedJavaMethod method, CiTargetMethod code, CodeInfo[] info) {
         HotSpotCodeInfo hsInfo = null;
         if (info != null && info.length > 0) {
             hsInfo = new HotSpotCodeInfo(code, (HotSpotMethodResolved) method);
@@ -474,13 +474,13 @@
         return hsInfo;
     }
 
-    public void installMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) {
+    public void installMethod(ResolvedJavaMethod method, CiTargetMethod code, CodeInfo[] info) {
         HotSpotCodeInfo hsInfo = makeInfo(method, code, info);
         compiler.getCompilerToVM().installMethod(new HotSpotTargetMethod((HotSpotMethodResolved) method, code), true, hsInfo);
     }
 
     @Override
-    public InstalledCode addMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) {
+    public InstalledCode addMethod(ResolvedJavaMethod method, CiTargetMethod code, CodeInfo[] info) {
         HotSpotCodeInfo hsInfo = makeInfo(method, code, info);
         return compiler.getCompilerToVM().installMethod(new HotSpotTargetMethod((HotSpotMethodResolved) method, code), false, hsInfo);
     }
@@ -491,13 +491,13 @@
     }
 
     @Override
-    public CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph) {
+    public CiTargetMethod compile(ResolvedJavaMethod method, StructuredGraph graph) {
         OptimisticOptimizations optimisticOpts = OptimisticOptimizations.ALL;
         return compiler.getCompiler().compileMethod(method, graph, -1, compiler.getCache(), compiler.getVMToCompiler().createPhasePlan(optimisticOpts), optimisticOpts);
     }
 
     @Override
-    public int encodeDeoptActionAndReason(CiDeoptAction action, RiDeoptReason reason) {
+    public int encodeDeoptActionAndReason(CiDeoptAction action, DeoptimizationReason reason) {
         final int actionShift = 0;
         final int reasonShift = 3;
 
@@ -519,7 +519,7 @@
     }
 
     @Override
-    public int convertDeoptReason(RiDeoptReason reason) {
+    public int convertDeoptReason(DeoptimizationReason reason) {
         switch(reason) {
             case None: return 0;
             case NullCheckException: return 1;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotSignature.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotSignature.java	Sat Jun 09 16:52:12 2012 +0200
@@ -31,14 +31,14 @@
 /**
  * Represents a method signature.
  */
-public class HotSpotSignature extends CompilerObject implements RiSignature {
+public class HotSpotSignature extends CompilerObject implements Signature {
 
     private static final long serialVersionUID = -2890917956072366116L;
     private final List<String> arguments = new ArrayList<>();
     private final String returnType;
     private final String originalString;
-    private RiType[] argumentTypes;
-    private RiType returnTypeCache;
+    private JavaType[] argumentTypes;
+    private JavaType returnTypeCache;
 
     public HotSpotSignature(String signature) {
         assert signature.length() > 0;
@@ -111,12 +111,12 @@
     }
 
     @Override
-    public RiType argumentTypeAt(int index, RiResolvedType accessingClass) {
+    public JavaType argumentTypeAt(int index, ResolvedJavaType accessingClass) {
         if (argumentTypes == null) {
-            argumentTypes = new RiType[arguments.size()];
+            argumentTypes = new JavaType[arguments.size()];
         }
-        RiType type = argumentTypes[index];
-        if (type == null || !(type instanceof RiResolvedType)) {
+        JavaType type = argumentTypes[index];
+        if (type == null || !(type instanceof ResolvedJavaType)) {
             type = HotSpotGraalRuntime.getInstance().lookupType(arguments.get(index), (HotSpotTypeResolved) accessingClass, true);
             argumentTypes[index] = type;
         }
@@ -134,7 +134,7 @@
     }
 
     @Override
-    public RiType returnType(RiType accessingClass) {
+    public JavaType returnType(JavaType accessingClass) {
         if (returnTypeCache == null) {
             returnTypeCache = HotSpotGraalRuntime.getInstance().lookupType(returnType, (HotSpotTypeResolved) accessingClass, false);
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotType.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotType.java	Sat Jun 09 16:52:12 2012 +0200
@@ -28,7 +28,7 @@
 /**
  * Common interface for all HotSpot RiType-implementations.
  */
-public abstract class HotSpotType extends CompilerObject implements RiType {
+public abstract class HotSpotType extends CompilerObject implements JavaType {
     private static final long serialVersionUID = -4252886265301910771L;
     protected String name;
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,7 +32,7 @@
 /**
  * Implementation of RiType for primitive HotSpot types.
  */
-public final class HotSpotTypePrimitive extends HotSpotType implements RiResolvedType {
+public final class HotSpotTypePrimitive extends HotSpotType implements ResolvedJavaType {
 
     private static final long serialVersionUID = -6208552348908071473L;
     private Kind kind;
@@ -51,27 +51,27 @@
     }
 
     @Override
-    public RiResolvedType arrayOf() {
-        return (RiResolvedType) HotSpotGraalRuntime.getInstance().getCompilerToVM().getPrimitiveArrayType(kind);
+    public ResolvedJavaType arrayOf() {
+        return (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().getPrimitiveArrayType(kind);
     }
 
     @Override
-    public RiResolvedType componentType() {
+    public ResolvedJavaType componentType() {
         return null;
     }
 
     @Override
-    public RiResolvedType exactType() {
+    public ResolvedJavaType exactType() {
         return this;
     }
 
     @Override
-    public RiResolvedType superType() {
+    public ResolvedJavaType superType() {
         return null;
     }
 
     @Override
-    public RiResolvedType leastCommonAncestor(RiResolvedType otherType) {
+    public ResolvedJavaType leastCommonAncestor(ResolvedJavaType otherType) {
         return null;
     }
 
@@ -126,7 +126,7 @@
     }
 
     @Override
-    public boolean isSubtypeOf(RiResolvedType other) {
+    public boolean isSubtypeOf(ResolvedJavaType other) {
         return false;
     }
 
@@ -136,7 +136,7 @@
     }
 
     @Override
-    public RiResolvedMethod resolveMethodImpl(RiResolvedMethod method) {
+    public ResolvedJavaMethod resolveMethodImpl(ResolvedJavaMethod method) {
         return null;
     }
 
@@ -146,17 +146,17 @@
     }
 
     @Override
-    public RiResolvedType uniqueConcreteSubtype() {
+    public ResolvedJavaType uniqueConcreteSubtype() {
         return this;
     }
 
     @Override
-    public RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method) {
+    public ResolvedJavaMethod uniqueConcreteMethod(ResolvedJavaMethod method) {
         return null;
     }
 
     @Override
-    public RiResolvedField[] declaredFields() {
+    public ResolvedJavaField[] declaredFields() {
         return null;
     }
 
@@ -171,7 +171,7 @@
     }
 
     @Override
-    public RiResolvedType resolve(RiResolvedType accessingClass) {
+    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
         return this;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolved.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolved.java	Sat Jun 09 16:52:12 2012 +0200
@@ -24,15 +24,15 @@
 
 import com.oracle.graal.api.meta.*;
 
-public interface HotSpotTypeResolved extends RiResolvedType {
+public interface HotSpotTypeResolved extends ResolvedJavaType {
 
     String toString();
 
-    RiConstantPool constantPool();
+    ConstantPool constantPool();
 
     int instanceSize();
 
-    RiField createRiField(String name, RiType type, int offset, int flags);
+    JavaField createRiField(String name, JavaType type, int offset, int flags);
 
     HotSpotKlassOop klassOop();
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Sat Jun 09 16:52:12 2012 +0200
@@ -47,13 +47,13 @@
     private boolean isInstanceClass;
     private boolean isInterface;
     private int instanceSize;
-    private HashMap<Long, RiResolvedField> fieldCache;
-    private RiResolvedType superType;
+    private HashMap<Long, ResolvedJavaField> fieldCache;
+    private ResolvedJavaType superType;
     private boolean superTypeSet;
-    private RiResolvedField[] fields;
-    private RiConstantPool constantPool;
+    private ResolvedJavaField[] fields;
+    private ConstantPool constantPool;
     private boolean isInitialized;
-    private RiResolvedType arrayOfType;
+    private ResolvedJavaType arrayOfType;
 
     private HotSpotTypeResolvedImpl() {
     }
@@ -64,48 +64,48 @@
     }
 
     @Override
-    public RiResolvedType arrayOf() {
+    public ResolvedJavaType arrayOf() {
         if (arrayOfType == null) {
-           arrayOfType = (RiResolvedType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_arrayOf(this);
+           arrayOfType = (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_arrayOf(this);
         }
         return arrayOfType;
     }
 
     @Override
-    public RiResolvedType componentType() {
+    public ResolvedJavaType componentType() {
         assert isArrayClass();
-        return (RiResolvedType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_componentType(this);
+        return (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_componentType(this);
     }
 
     @Override
-    public RiResolvedType uniqueConcreteSubtype() {
+    public ResolvedJavaType uniqueConcreteSubtype() {
         if (isArrayClass()) {
             return Modifier.isFinal(componentType().accessFlags()) ? this : null;
         } else {
-            return (RiResolvedType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_uniqueConcreteSubtype(this);
+            return (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_uniqueConcreteSubtype(this);
         }
     }
 
     @Override
-    public RiResolvedType superType() {
+    public ResolvedJavaType superType() {
         if (!superTypeSet) {
-            superType = (RiResolvedType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_superType(this);
+            superType = (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_superType(this);
             superTypeSet = true;
         }
         return superType;
     }
 
     @Override
-    public RiResolvedType leastCommonAncestor(RiResolvedType otherType) {
+    public ResolvedJavaType leastCommonAncestor(ResolvedJavaType otherType) {
         if (otherType instanceof HotSpotTypePrimitive) {
             return null;
         } else {
-            return (RiResolvedType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_leastCommonAncestor(this, (HotSpotTypeResolved) otherType);
+            return (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_leastCommonAncestor(this, (HotSpotTypeResolved) otherType);
         }
     }
 
     @Override
-    public RiResolvedType exactType() {
+    public ResolvedJavaType exactType() {
         if (Modifier.isFinal(accessFlags)) {
             return this;
         }
@@ -175,7 +175,7 @@
     }
 
     @Override
-    public boolean isSubtypeOf(RiResolvedType other) {
+    public boolean isSubtypeOf(ResolvedJavaType other) {
         if (other instanceof HotSpotTypeResolved) {
             return HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_isSubtypeOf(this, other);
         }
@@ -189,9 +189,9 @@
     }
 
     @Override
-    public RiResolvedMethod resolveMethodImpl(RiResolvedMethod method) {
+    public ResolvedJavaMethod resolveMethodImpl(ResolvedJavaMethod method) {
         assert method instanceof HotSpotMethod;
-        return (RiResolvedMethod) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_resolveMethodImpl(this, method.name(), method.signature().asString());
+        return (ResolvedJavaMethod) HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_resolveMethodImpl(this, method.name(), method.signature().asString());
     }
 
     @Override
@@ -200,7 +200,7 @@
     }
 
     @Override
-    public RiConstantPool constantPool() {
+    public ConstantPool constantPool() {
         if (constantPool == null) {
             constantPool = new HotSpotConstantPool(this);
         }
@@ -213,8 +213,8 @@
     }
 
     @Override
-    public synchronized RiResolvedField createRiField(String fieldName, RiType type, int offset, int flags) {
-        RiResolvedField result = null;
+    public synchronized ResolvedJavaField createRiField(String fieldName, JavaType type, int offset, int flags) {
+        ResolvedJavaField result = null;
 
         long id = offset + ((long) flags << 32);
 
@@ -237,12 +237,12 @@
     }
 
     @Override
-    public RiResolvedMethod uniqueConcreteMethod(RiResolvedMethod method) {
+    public ResolvedJavaMethod uniqueConcreteMethod(ResolvedJavaMethod method) {
         return ((HotSpotMethodResolved) method).uniqueConcreteMethod();
     }
 
     @Override
-    public RiResolvedField[] declaredFields() {
+    public ResolvedJavaField[] declaredFields() {
         if (fields == null) {
             fields = HotSpotGraalRuntime.getInstance().getCompilerToVM().RiType_fields(this);
         }
@@ -260,7 +260,7 @@
     }
 
     @Override
-    public RiResolvedType resolve(RiResolvedType accessingClass) {
+    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
         return this;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeUnresolved.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeUnresolved.java	Sat Jun 09 16:52:12 2012 +0200
@@ -78,13 +78,13 @@
     }
 
     @Override
-    public RiType componentType() {
+    public JavaType componentType() {
         assert dimensions > 0 : "no array class" + name();
         return new HotSpotTypeUnresolved(simpleName, dimensions - 1);
     }
 
     @Override
-    public RiType arrayOf() {
+    public JavaType arrayOf() {
         return new HotSpotTypeUnresolved(simpleName, dimensions + 1);
     }
 
@@ -109,13 +109,13 @@
     }
 
     @Override
-    public Kind getRepresentationKind(RiType.Representation r) {
+    public Kind getRepresentationKind(JavaType.Representation r) {
         return Kind.Object;
     }
 
     @Override
-    public RiResolvedType resolve(RiResolvedType accessingClass) {
-        return (RiResolvedType) HotSpotGraalRuntime.getInstance().lookupType(name, (HotSpotTypeResolved) accessingClass, true);
+    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
+        return (ResolvedJavaType) HotSpotGraalRuntime.getInstance().lookupType(name, (HotSpotTypeResolved) accessingClass, true);
     }
 
     @Override
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Sat Jun 09 16:52:12 2012 +0200
@@ -579,7 +579,7 @@
             if (counters != null) {
                 incCounter(asm, counter, counters, CheckcastCounter.exception);
             }
-            RiDeoptReason deoptReason = exact ? RiDeoptReason.OptimizedTypeCheckViolated : RiDeoptReason.ClassCastException;
+            DeoptimizationReason deoptReason = exact ? DeoptimizationReason.OptimizedTypeCheckViolated : DeoptimizationReason.ClassCastException;
             XirOperand scratch = asm.createRegisterTemp("scratch", target.wordKind, AMD64.r10);
             asm.mov(scratch, wordConst(asm, compiler.getRuntime().encodeDeoptActionAndReason(CiDeoptAction.InvalidateReprofile, deoptReason)));
             asm.callRuntime(CiRuntimeCall.Deoptimize, null);
@@ -738,12 +738,12 @@
     };
 
     @Override
-    public XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, RiMethod method) {
+    public XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, JavaMethod method) {
         return new XirSnippet(invokeInterfaceTemplates.get(site), receiver, wordArg(0));
     }
 
     @Override
-    public XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, RiMethod method, boolean megamorph) {
+    public XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, JavaMethod method, boolean megamorph) {
         int vtableEntryOffset = 0;
 
         if (GraalOptions.InlineVTableStubs && (GraalOptions.AlwaysInlineVTableStubs || megamorph)) {
@@ -760,12 +760,12 @@
     }
 
     @Override
-    public XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, RiMethod method) {
+    public XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, JavaMethod method) {
         return new XirSnippet(invokeSpecialTemplates.get(site), receiver, wordArg(0));
     }
 
     @Override
-    public XirSnippet genInvokeStatic(XirSite site, RiMethod method) {
+    public XirSnippet genInvokeStatic(XirSite site, JavaMethod method) {
         return new XirSnippet(invokeStaticTemplates.get(site), wordArg(0));
     }
 
@@ -780,33 +780,33 @@
     }
 
     @Override
-    public XirSnippet genNewInstance(XirSite site, RiType type) {
+    public XirSnippet genNewInstance(XirSite site, JavaType type) {
         HotSpotTypeResolved resolvedType = (HotSpotTypeResolved) type;
         int instanceSize = resolvedType.instanceSize();
         return new XirSnippet(newInstanceTemplates.get(site, instanceSize), XirArgument.forObject(resolvedType.klassOop()));
     }
 
     @Override
-    public XirSnippet genNewArray(XirSite site, XirArgument length, Kind elementKind, RiType componentType, RiType arrayType) {
+    public XirSnippet genNewArray(XirSite site, XirArgument length, Kind elementKind, JavaType componentType, JavaType arrayType) {
         if (elementKind == Kind.Object) {
-            assert arrayType instanceof RiResolvedType;
+            assert arrayType instanceof ResolvedJavaType;
             return new XirSnippet(newObjectArrayTemplates.get(site), length, XirArgument.forObject(((HotSpotType) arrayType).klassOop()));
         } else {
             assert arrayType == null;
-            RiType primitiveArrayType = compiler.getCompilerToVM().getPrimitiveArrayType(elementKind);
+            JavaType primitiveArrayType = compiler.getCompilerToVM().getPrimitiveArrayType(elementKind);
             return new XirSnippet(newTypeArrayTemplates.get(site, elementKind), length, XirArgument.forObject(((HotSpotType) primitiveArrayType).klassOop()));
         }
     }
 
     @Override
-    public XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType type) {
+    public XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, JavaType type) {
         XirArgument[] params = Arrays.copyOf(lengths, lengths.length + 1);
         params[lengths.length] = XirArgument.forObject(((HotSpotType) type).klassOop());
         return new XirSnippet(multiNewArrayTemplate.get(site, lengths.length), params);
     }
 
     @Override
-    public XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, RiResolvedType type, RiTypeProfile profile) {
+    public XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, ResolvedJavaType type, JavaTypeProfile profile) {
         final boolean useCounters = GraalOptions.CheckcastCounters;
         TypeCheckHints hints = new TypeCheckHints(type, profile, site.assumptions(), GraalOptions.CheckcastMinHintHitProbability, GraalOptions.CheckcastMaxHints);
         int hintsLength = hints.types.length;
@@ -832,7 +832,7 @@
             if (!hints.exact) {
                 params[i++] = hub;
             }
-            for (RiResolvedType hint : hints.types) {
+            for (ResolvedJavaType hint : hints.types) {
                 params[i++] = XirArgument.forObject(((HotSpotType) hint).klassOop());
             }
             XirTemplate template = hints.exact ? checkCastTemplates.get(site, hintsLength, EXACT_HINTS) : checkCastTemplates.get(site, hintsLength);
@@ -841,7 +841,7 @@
     }
 
     @Override
-    public XirSnippet genInstanceOf(XirSite site, XirArgument object, XirArgument hub, RiResolvedType type, RiTypeProfile profile) {
+    public XirSnippet genInstanceOf(XirSite site, XirArgument object, XirArgument hub, ResolvedJavaType type, JavaTypeProfile profile) {
         TypeCheckHints hints = new TypeCheckHints(type, profile, site.assumptions(), GraalOptions.InstanceOfMinHintHitProbability, GraalOptions.InstanceOfMaxHints);
         int hintsLength = hints.types.length;
         if (hintsLength == 0) {
@@ -853,7 +853,7 @@
             if (!hints.exact) {
                 params[i++] = hub;
             }
-            for (RiResolvedType hint : hints.types) {
+            for (ResolvedJavaType hint : hints.types) {
                 params[i++] = XirArgument.forObject(((HotSpotType) hint).klassOop());
             }
             XirTemplate template = hints.exact ? instanceOfTemplates.get(site, hintsLength, EXACT_HINTS) : instanceOfTemplates.get(site, hintsLength);
@@ -862,7 +862,7 @@
     }
 
     @Override
-    public XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument object, XirArgument hub, XirArgument trueValue, XirArgument falseValue, RiResolvedType type, RiTypeProfile profile) {
+    public XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument object, XirArgument hub, XirArgument trueValue, XirArgument falseValue, ResolvedJavaType type, JavaTypeProfile profile) {
         TypeCheckHints hints = new TypeCheckHints(type, profile, site.assumptions(), GraalOptions.InstanceOfMinHintHitProbability, GraalOptions.InstanceOfMaxHints);
         int hintsLength = hints.types.length;
         if (hintsLength == 0) {
@@ -876,7 +876,7 @@
             }
             params[i++] = trueValue;
             params[i++] = falseValue;
-            for (RiResolvedType hint : hints.types) {
+            for (ResolvedJavaType hint : hints.types) {
                 params[i++] = XirArgument.forObject(((HotSpotType) hint).klassOop());
             }
             XirTemplate template = hints.exact ? materializeInstanceOfTemplates.get(site, hintsLength, EXACT_HINTS) : materializeInstanceOfTemplates.get(site, hintsLength);
@@ -885,8 +885,8 @@
     }
 
     @Override
-    public XirSnippet genTypeBranch(XirSite site, XirArgument thisHub, XirArgument otherHub, RiType type) {
-        assert type instanceof RiResolvedType;
+    public XirSnippet genTypeBranch(XirSite site, XirArgument thisHub, XirArgument otherHub, JavaType type) {
+        assert type instanceof ResolvedJavaType;
         return new XirSnippet(typeCheckTemplates.get(site), thisHub, otherHub);
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Sat Jun 09 16:52:12 2012 +0200
@@ -74,7 +74,7 @@
         Object objectHub = UnsafeLoadNode.loadObject(object, 0, hubOffset(), true);
         if (objectHub != exactHub) {
             exactMiss.inc();
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, RiDeoptReason.ClassCastException);
+            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         exactHit.inc();
         return object;
@@ -96,7 +96,7 @@
         Object objectHub = UnsafeLoadNode.loadObject(object, 0, hubOffset(), true);
         if (UnsafeLoadNode.loadObject(objectHub, 0, superCheckOffset, true) != hub) {
             displayMiss.inc();
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, RiDeoptReason.ClassCastException);
+            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         displayHit.inc();
         return object;
@@ -122,7 +122,7 @@
             }
         }
         if (!checkSecondarySubType(hub, objectHub)) {
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, RiDeoptReason.ClassCastException);
+            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         return object;
     }
@@ -148,7 +148,7 @@
             }
         }
         if (!checkUnknownSubType(hub, objectHub)) {
-            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, RiDeoptReason.ClassCastException);
+            DeoptimizeNode.deopt(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.ClassCastException);
         }
         return object;
     }
@@ -332,20 +332,20 @@
     public static class Templates {
 
         private final Cache cache;
-        private final RiResolvedMethod exact;
-        private final RiResolvedMethod primary;
-        private final RiResolvedMethod secondary;
-        private final RiResolvedMethod unknown;
-        private final RiRuntime runtime;
+        private final ResolvedJavaMethod exact;
+        private final ResolvedJavaMethod primary;
+        private final ResolvedJavaMethod secondary;
+        private final ResolvedJavaMethod unknown;
+        private final CodeCacheProvider runtime;
 
-        public Templates(RiRuntime runtime) {
+        public Templates(CodeCacheProvider runtime) {
             this.runtime = runtime;
             this.cache = new Cache(runtime);
             try {
-                exact = runtime.getRiMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastExact", Object.class, Object.class, boolean.class));
-                primary = runtime.getRiMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastPrimary", Object.class, Object.class, boolean.class, int.class));
-                secondary = runtime.getRiMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastSecondary", Object.class, Object.class, Object[].class, boolean.class));
-                unknown = runtime.getRiMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastUnknown", Object.class, Object.class, Object[].class, boolean.class));
+                exact = runtime.getResolvedJavaMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastExact", Object.class, Object.class, boolean.class));
+                primary = runtime.getResolvedJavaMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastPrimary", Object.class, Object.class, boolean.class, int.class));
+                secondary = runtime.getResolvedJavaMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastSecondary", Object.class, Object.class, Object[].class, boolean.class));
+                unknown = runtime.getResolvedJavaMethod(CheckCastSnippets.class.getDeclaredMethod("checkcastUnknown", Object.class, Object.class, Object[].class, boolean.class));
             } catch (NoSuchMethodException e) {
                 throw new GraalInternalError(e);
             }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/IntrinsifyArrayCopyPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -37,15 +37,15 @@
 
 public class IntrinsifyArrayCopyPhase extends Phase {
     private final ExtendedRiRuntime runtime;
-    private RiResolvedMethod arrayCopy;
-    private RiResolvedMethod byteArrayCopy;
-    private RiResolvedMethod shortArrayCopy;
-    private RiResolvedMethod charArrayCopy;
-    private RiResolvedMethod intArrayCopy;
-    private RiResolvedMethod longArrayCopy;
-    private RiResolvedMethod floatArrayCopy;
-    private RiResolvedMethod doubleArrayCopy;
-    private RiResolvedMethod objectArrayCopy;
+    private ResolvedJavaMethod arrayCopy;
+    private ResolvedJavaMethod byteArrayCopy;
+    private ResolvedJavaMethod shortArrayCopy;
+    private ResolvedJavaMethod charArrayCopy;
+    private ResolvedJavaMethod intArrayCopy;
+    private ResolvedJavaMethod longArrayCopy;
+    private ResolvedJavaMethod floatArrayCopy;
+    private ResolvedJavaMethod doubleArrayCopy;
+    private ResolvedJavaMethod objectArrayCopy;
 
     public IntrinsifyArrayCopyPhase(ExtendedRiRuntime runtime) {
         this.runtime = runtime;
@@ -58,7 +58,7 @@
             floatArrayCopy = getArrayCopySnippet(runtime, float.class);
             doubleArrayCopy = getArrayCopySnippet(runtime, double.class);
             objectArrayCopy = getArrayCopySnippet(runtime, Object.class);
-            arrayCopy = runtime.getRiMethod(System.class.getDeclaredMethod("arraycopy", Object.class, int.class, Object.class, int.class, int.class));
+            arrayCopy = runtime.getResolvedJavaMethod(System.class.getDeclaredMethod("arraycopy", Object.class, int.class, Object.class, int.class, int.class));
         } catch (SecurityException e) {
             e.printStackTrace();
         } catch (NoSuchMethodException e) {
@@ -66,23 +66,23 @@
         }
     }
 
-    private static RiResolvedMethod getArrayCopySnippet(RiRuntime runtime, Class<?> componentClass) throws NoSuchMethodException {
+    private static ResolvedJavaMethod getArrayCopySnippet(CodeCacheProvider runtime, Class<?> componentClass) throws NoSuchMethodException {
         Class<?> arrayClass = Array.newInstance(componentClass, 0).getClass();
-        return runtime.getRiMethod(ArrayCopySnippets.class.getDeclaredMethod("arraycopy", arrayClass, int.class, arrayClass, int.class, int.class));
+        return runtime.getResolvedJavaMethod(ArrayCopySnippets.class.getDeclaredMethod("arraycopy", arrayClass, int.class, arrayClass, int.class, int.class));
     }
 
     @Override
     protected void run(StructuredGraph graph) {
         boolean hits = false;
         for (MethodCallTargetNode methodCallTarget : graph.getNodes(MethodCallTargetNode.class)) {
-            RiResolvedMethod targetMethod = methodCallTarget.targetMethod();
-            RiResolvedMethod snippetMethod = null;
+            ResolvedJavaMethod targetMethod = methodCallTarget.targetMethod();
+            ResolvedJavaMethod snippetMethod = null;
             if (targetMethod == arrayCopy) {
                 ValueNode src = methodCallTarget.arguments().get(0);
                 ValueNode dest = methodCallTarget.arguments().get(2);
                 assert src != null && dest != null;
-                RiResolvedType srcType = src.objectStamp().type();
-                RiResolvedType destType = dest.objectStamp().type();
+                ResolvedJavaType srcType = src.objectStamp().type();
+                ResolvedJavaType destType = dest.objectStamp().type();
                 if (srcType != null
                                 && srcType.isArrayClass()
                                 && destType != null
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java	Sat Jun 09 16:52:12 2012 +0200
@@ -51,12 +51,12 @@
 
 public class HotSpotAMD64Backend extends Backend {
 
-    public HotSpotAMD64Backend(RiRuntime runtime, CiTarget target) {
+    public HotSpotAMD64Backend(CodeCacheProvider runtime, CiTarget target) {
         super(runtime, target);
     }
 
     @Override
-    public LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, RiResolvedMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
+    public LIRGenerator newLIRGenerator(Graph graph, FrameMap frameMap, ResolvedJavaMethod method, LIR lir, RiXirGenerator xir, CiAssumptions assumptions) {
         return new AMD64LIRGenerator(graph, runtime, target, frameMap, method, lir, xir, assumptions) {
 
             @Override
@@ -175,7 +175,7 @@
     }
 
     @Override
-    public void emitCode(TargetMethodAssembler tasm, RiResolvedMethod method, LIR lir) {
+    public void emitCode(TargetMethodAssembler tasm, ResolvedJavaMethod method, LIR lir) {
         AMD64MacroAssembler asm = (AMD64MacroAssembler) tasm.asm;
         FrameMap frameMap = tasm.frameMap;
         CiRegisterConfig regConfig = frameMap.registerConfig;
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/BciBlockMapping.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,7 +30,6 @@
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
 import com.oracle.graal.java.bytecode.*;
 import com.oracle.graal.nodes.*;
 
@@ -91,10 +90,10 @@
         public Block retSuccessor;
         public boolean endsWithRet = false;
 
-        public BitMap localsLiveIn;
-        public BitMap localsLiveOut;
-        private BitMap localsLiveGen;
-        private BitMap localsLiveKill;
+        public BitSet localsLiveIn;
+        public BitSet localsLiveOut;
+        private BitSet localsLiveGen;
+        private BitSet localsLiveKill;
 
         public Block exceptionDispatchBlock() {
             if (successors.size() > 0 && successors.get(successors.size() - 1) instanceof ExceptionDispatchBlock) {
@@ -139,9 +138,9 @@
     }
 
     public static class ExceptionDispatchBlock extends Block {
-        private HashMap<RiExceptionHandler, ExceptionDispatchBlock> exceptionDispatch = new HashMap<>();
+        private HashMap<ExceptionHandler, ExceptionDispatchBlock> exceptionDispatch = new HashMap<>();
 
-        public RiExceptionHandler handler;
+        public ExceptionHandler handler;
         public int deoptBci;
     }
 
@@ -149,12 +148,12 @@
      * The blocks found in this method, in reverse postorder.
      */
     public final List<Block> blocks;
-    public final RiResolvedMethod method;
+    public final ResolvedJavaMethod method;
     public boolean hasJsrBytecodes;
     public Block startBlock;
 
     private final BytecodeStream stream;
-    private final RiExceptionHandler[] exceptionHandlers;
+    private final ExceptionHandler[] exceptionHandlers;
     private Block[] blockMap;
     public Block[] loopHeaders;
 
@@ -162,7 +161,7 @@
      * Creates a new BlockMap instance from bytecode of the given method .
      * @param method the compiler interface method containing the code
      */
-    public BciBlockMapping(RiResolvedMethod method) {
+    public BciBlockMapping(ResolvedJavaMethod method) {
         this.method = method;
         exceptionHandlers = method.exceptionHandlers();
         stream = new BytecodeStream(method.code());
@@ -233,7 +232,7 @@
 
     private void makeExceptionEntries() {
         // start basic blocks at all exception handler blocks and mark them as exception entries
-        for (RiExceptionHandler h : this.exceptionHandlers) {
+        for (ExceptionHandler h : this.exceptionHandlers) {
             Block xhandler = makeBlock(h.handlerBCI());
             xhandler.isExceptionEntry = true;
         }
@@ -475,20 +474,20 @@
     }
 
 
-    private HashMap<RiExceptionHandler, ExceptionDispatchBlock> initialExceptionDispatch = new HashMap<>();
+    private HashMap<ExceptionHandler, ExceptionDispatchBlock> initialExceptionDispatch = new HashMap<>();
 
     private ExceptionDispatchBlock handleExceptions(int bci) {
         ExceptionDispatchBlock lastHandler = null;
 
         for (int i = exceptionHandlers.length - 1; i >= 0; i--) {
-            RiExceptionHandler h = exceptionHandlers[i];
+            ExceptionHandler h = exceptionHandlers[i];
             if (h.startBCI() <= bci && bci < h.endBCI()) {
                 if (h.isCatchAll()) {
                     // Discard all information about succeeding exception handlers, since they can never be reached.
                     lastHandler = null;
                 }
 
-                HashMap<RiExceptionHandler, ExceptionDispatchBlock> exceptionDispatch = lastHandler != null ? lastHandler.exceptionDispatch : initialExceptionDispatch;
+                HashMap<ExceptionHandler, ExceptionDispatchBlock> exceptionDispatch = lastHandler != null ? lastHandler.exceptionDispatch : initialExceptionDispatch;
                 ExceptionDispatchBlock curHandler = exceptionDispatch.get(h);
                 if (curHandler == null) {
                     curHandler = new ExceptionDispatchBlock();
@@ -722,15 +721,20 @@
                 Debug.log("  start B%d  [%d, %d]  in: %s  out: %s  gen: %s  kill: %s", block.blockID, block.startBci, block.endBci, block.localsLiveIn, block.localsLiveOut, block.localsLiveGen, block.localsLiveKill);
 
                 boolean blockChanged = (iteration == 0);
-                for (Block sux : block.successors) {
-                    Debug.log("    Successor B%d: %s", sux.blockID, sux.localsLiveIn);
-                    blockChanged = block.localsLiveOut.setUnionWithResult(sux.localsLiveIn) || blockChanged;
+                if (block.successors.size() > 0) {
+                    int oldCardinality = block.localsLiveOut.cardinality();
+                    for (Block sux : block.successors) {
+                        Debug.log("    Successor B%d: %s", sux.blockID, sux.localsLiveIn);
+                        block.localsLiveOut.or(sux.localsLiveIn);
+                    }
+                    blockChanged |= (oldCardinality != block.localsLiveOut.cardinality());
                 }
 
                 if (blockChanged) {
-                    block.localsLiveIn.setFrom(block.localsLiveOut);
-                    block.localsLiveIn.setDifference(block.localsLiveKill);
-                    block.localsLiveIn.setUnion(block.localsLiveGen);
+                    block.localsLiveIn.clear();
+                    block.localsLiveIn.or(block.localsLiveOut);
+                    block.localsLiveIn.xor(block.localsLiveKill);
+                    block.localsLiveIn.or(block.localsLiveGen);
                     Debug.log("  end   B%d  [%d, %d]  in: %s  out: %s  gen: %s  kill: %s", block.blockID, block.startBci, block.endBci, block.localsLiveIn, block.localsLiveOut, block.localsLiveGen, block.localsLiveKill);
                 }
                 changed |= blockChanged;
@@ -740,10 +744,10 @@
     }
 
     private void computeLocalLiveness(Block block) {
-        block.localsLiveIn = new BitMap(method.maxLocals());
-        block.localsLiveOut = new BitMap(method.maxLocals());
-        block.localsLiveGen = new BitMap(method.maxLocals());
-        block.localsLiveKill = new BitMap(method.maxLocals());
+        block.localsLiveIn = new BitSet(method.maxLocals());
+        block.localsLiveOut = new BitSet(method.maxLocals());
+        block.localsLiveGen = new BitSet(method.maxLocals());
+        block.localsLiveKill = new BitSet(method.maxLocals());
 
         if (block.startBci < 0 || block.endBci < 0) {
             return;
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/FrameStateBuilder.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,14 +30,13 @@
 
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.debug.*;
-import com.oracle.graal.graph.*;
 import com.oracle.graal.graph.Node.Verbosity;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.PhiNode.PhiType;
 import com.oracle.graal.nodes.type.*;
 
 public class FrameStateBuilder {
-    private final RiResolvedMethod method;
+    private final ResolvedJavaMethod method;
     private final StructuredGraph graph;
 
     private final ValueNode[] locals;
@@ -45,7 +44,7 @@
     private int stackSize;
     private boolean rethrowException;
 
-    public FrameStateBuilder(RiResolvedMethod method, StructuredGraph graph, boolean eagerResolve) {
+    public FrameStateBuilder(ResolvedJavaMethod method, StructuredGraph graph, boolean eagerResolve) {
         assert graph != null;
         this.method = method;
         this.graph = graph;
@@ -62,18 +61,18 @@
             javaIndex = 1;
             index = 1;
         }
-        RiSignature sig = method.signature();
+        Signature sig = method.signature();
         int max = sig.argumentCount(false);
-        RiResolvedType accessingClass = method.holder();
+        ResolvedJavaType accessingClass = method.holder();
         for (int i = 0; i < max; i++) {
-            RiType type = sig.argumentTypeAt(i, accessingClass);
+            JavaType type = sig.argumentTypeAt(i, accessingClass);
             if (eagerResolve) {
                 type = type.resolve(accessingClass);
             }
             Kind kind = type.kind().stackKind();
             Stamp stamp;
-            if (kind == Kind.Object && type instanceof RiResolvedType) {
-                stamp = StampFactory.declared((RiResolvedType) type);
+            if (kind == Kind.Object && type instanceof ResolvedJavaType) {
+                stamp = StampFactory.declared((ResolvedJavaType) type);
             } else {
                 stamp = StampFactory.forKind(kind);
             }
@@ -84,7 +83,7 @@
         }
     }
 
-    private FrameStateBuilder(RiResolvedMethod method, StructuredGraph graph, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException) {
+    private FrameStateBuilder(ResolvedJavaMethod method, StructuredGraph graph, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException) {
         assert locals.length == method.maxLocals();
         assert stack.length == Math.max(1, method.maxStackSize());
 
@@ -269,11 +268,10 @@
         }
     }
 
-    public void clearNonLiveLocals(BitMap liveness) {
+    public void clearNonLiveLocals(BitSet liveness) {
         if (liveness == null) {
             return;
         }
-        assert liveness.size() == locals.length;
         for (int i = 0; i < locals.length; i++) {
             if (!liveness.get(i)) {
                 locals[i] = null;
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java	Sat Jun 09 16:52:12 2012 +0200
@@ -33,18 +33,18 @@
 
     private final ResolvePolicy resolving;
     private final PhasePlan plan;
-    private RiResolvedType[] skippedExceptionTypes;
+    private ResolvedJavaType[] skippedExceptionTypes;
 
     public GraphBuilderConfiguration(ResolvePolicy resolving, PhasePlan plan) {
         this.resolving = resolving;
         this.plan = plan;
     }
 
-    public void setSkippedExceptionTypes(RiResolvedType[] skippedExceptionTypes) {
+    public void setSkippedExceptionTypes(ResolvedJavaType[] skippedExceptionTypes) {
         this.skippedExceptionTypes = skippedExceptionTypes;
     }
 
-    public RiResolvedType[] getSkippedExceptionTypes() {
+    public ResolvedJavaType[] getSkippedExceptionTypes() {
         return skippedExceptionTypes;
     }
 
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,8 +30,8 @@
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiType.*;
-import com.oracle.graal.api.meta.RiTypeProfile.*;
+import com.oracle.graal.api.meta.JavaType.*;
+import com.oracle.graal.api.meta.JavaTypeProfile.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.phases.*;
 import com.oracle.graal.compiler.util.*;
@@ -68,10 +68,10 @@
 
     private StructuredGraph currentGraph;
 
-    private final RiRuntime runtime;
-    private RiConstantPool constantPool;
-    private RiResolvedMethod method;
-    private RiProfilingInfo profilingInfo;
+    private final CodeCacheProvider runtime;
+    private ConstantPool constantPool;
+    private ResolvedJavaMethod method;
+    private ProfilingInfo profilingInfo;
 
     private BytecodeStream stream;           // the bytecode stream
     private final LogStream log;
@@ -104,7 +104,7 @@
 
     private Block[] loopHeaders;
 
-    public GraphBuilderPhase(RiRuntime runtime, GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts) {
+    public GraphBuilderPhase(CodeCacheProvider runtime, GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts) {
         this.graphBuilderConfig = graphBuilderConfig;
         this.optimisticOpts = optimisticOpts;
         this.runtime = runtime;
@@ -233,11 +233,11 @@
         frameState.storeLocal(index, frameState.pop(kind));
     }
 
-    public static boolean covers(RiExceptionHandler handler, int bci) {
+    public static boolean covers(ExceptionHandler handler, int bci) {
         return handler.startBCI() <= bci && bci < handler.endBCI();
     }
 
-    public static boolean isCatchAll(RiExceptionHandler handler) {
+    public static boolean isCatchAll(ExceptionHandler handler) {
         return handler.catchTypeCPI() == 0;
     }
 
@@ -280,13 +280,13 @@
     private void genLoadConstant(int cpi, int opcode) {
         Object con = lookupConstant(cpi, opcode);
 
-        if (con instanceof RiType) {
+        if (con instanceof JavaType) {
             // this is a load of class constant which might be unresolved
-            RiType riType = (RiType) con;
-            if (riType instanceof RiResolvedType) {
-                frameState.push(Kind.Object, append(ConstantNode.forCiConstant(((RiResolvedType) riType).getEncoding(Representation.JavaClass), runtime, currentGraph)));
+            JavaType riType = (JavaType) con;
+            if (riType instanceof ResolvedJavaType) {
+                frameState.push(Kind.Object, append(ConstantNode.forCiConstant(((ResolvedJavaType) riType).getEncoding(Representation.JavaClass), runtime, currentGraph)));
             } else {
-                append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+                append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
                 frameState.push(Kind.Object, append(ConstantNode.forObject(null, runtime, currentGraph)));
             }
         } else if (con instanceof Constant) {
@@ -565,36 +565,36 @@
 
     private void genThrow() {
         ValueNode exception = frameState.apop();
-        FixedGuardNode node = currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(exception)), RiDeoptReason.NullCheckException, CiDeoptAction.InvalidateReprofile, true, graphId));
+        FixedGuardNode node = currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(exception)), DeoptimizationReason.NullCheckException, CiDeoptAction.InvalidateReprofile, true, graphId));
         append(node);
         append(handleException(exception, bci()));
     }
 
-    private RiType lookupType(int cpi, int bytecode) {
+    private JavaType lookupType(int cpi, int bytecode) {
         eagerResolvingForSnippets(cpi, bytecode);
-        RiType result = constantPool.lookupType(cpi, bytecode);
-        assert !graphBuilderConfig.eagerResolvingForSnippets() || result instanceof RiResolvedType;
+        JavaType result = constantPool.lookupType(cpi, bytecode);
+        assert !graphBuilderConfig.eagerResolvingForSnippets() || result instanceof ResolvedJavaType;
         return result;
     }
 
-    private RiMethod lookupMethod(int cpi, int opcode) {
+    private JavaMethod lookupMethod(int cpi, int opcode) {
         eagerResolvingForSnippets(cpi, opcode);
-        RiMethod result = constantPool.lookupMethod(cpi, opcode);
-        assert !graphBuilderConfig.eagerResolvingForSnippets() || ((result instanceof RiResolvedMethod) && ((RiResolvedMethod) result).holder().isInitialized());
+        JavaMethod result = constantPool.lookupMethod(cpi, opcode);
+        assert !graphBuilderConfig.eagerResolvingForSnippets() || ((result instanceof ResolvedJavaMethod) && ((ResolvedJavaMethod) result).holder().isInitialized());
         return result;
     }
 
-    private RiField lookupField(int cpi, int opcode) {
+    private JavaField lookupField(int cpi, int opcode) {
         eagerResolvingForSnippets(cpi, opcode);
-        RiField result = constantPool.lookupField(cpi, opcode);
-        assert !graphBuilderConfig.eagerResolvingForSnippets() || (result instanceof RiResolvedField && ((RiResolvedField) result).holder().isInitialized());
+        JavaField result = constantPool.lookupField(cpi, opcode);
+        assert !graphBuilderConfig.eagerResolvingForSnippets() || (result instanceof ResolvedJavaField && ((ResolvedJavaField) result).holder().isInitialized());
         return result;
     }
 
     private Object lookupConstant(int cpi, int opcode) {
         eagerResolving(cpi, opcode);
         Object result = constantPool.lookupConstant(cpi);
-        assert !graphBuilderConfig.eagerResolving() || !(result instanceof RiType) || (result instanceof RiResolvedType);
+        assert !graphBuilderConfig.eagerResolving() || !(result instanceof JavaType) || (result instanceof ResolvedJavaType);
         return result;
     }
 
@@ -610,13 +610,13 @@
         }
     }
 
-    private RiTypeProfile getProfileForTypeCheck(RiResolvedType type) {
+    private JavaTypeProfile getProfileForTypeCheck(ResolvedJavaType type) {
         if (!optimisticOpts.useTypeCheckHints() || TypeCheckHints.isFinalClass(type)) {
             return null;
         } else {
-            RiResolvedType uniqueSubtype = type.uniqueConcreteSubtype();
+            ResolvedJavaType uniqueSubtype = type.uniqueConcreteSubtype();
             if (uniqueSubtype != null) {
-                return new RiTypeProfile(0.0D, new ProfiledType(uniqueSubtype, 1.0D));
+                return new JavaTypeProfile(0.0D, new ProfiledType(uniqueSubtype, 1.0D));
             } else {
                 return profilingInfo.getTypeProfile(bci());
             }
@@ -625,33 +625,33 @@
 
     private void genCheckCast() {
         int cpi = stream().readCPI();
-        RiType type = lookupType(cpi, CHECKCAST);
-        boolean initialized = type instanceof RiResolvedType;
+        JavaType type = lookupType(cpi, CHECKCAST);
+        boolean initialized = type instanceof ResolvedJavaType;
         if (initialized) {
-            ConstantNode typeInstruction = genTypeOrDeopt(RiType.Representation.ObjectHub, type, true);
+            ConstantNode typeInstruction = genTypeOrDeopt(JavaType.Representation.ObjectHub, type, true);
             ValueNode object = frameState.apop();
-            CheckCastNode checkCast = currentGraph.add(new CheckCastNode(typeInstruction, (RiResolvedType) type, object, getProfileForTypeCheck((RiResolvedType) type)));
+            CheckCastNode checkCast = currentGraph.add(new CheckCastNode(typeInstruction, (ResolvedJavaType) type, object, getProfileForTypeCheck((ResolvedJavaType) type)));
             append(checkCast);
             frameState.apush(checkCast);
         } else {
             ValueNode object = frameState.apop();
-            append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(object)), RiDeoptReason.Unresolved, CiDeoptAction.InvalidateRecompile, graphId)));
+            append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(object)), DeoptimizationReason.Unresolved, CiDeoptAction.InvalidateRecompile, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
 
     private void genInstanceOf() {
         int cpi = stream().readCPI();
-        RiType type = lookupType(cpi, INSTANCEOF);
+        JavaType type = lookupType(cpi, INSTANCEOF);
         ValueNode object = frameState.apop();
-        if (type instanceof RiResolvedType) {
-            RiResolvedType resolvedType = (RiResolvedType) type;
-            ConstantNode hub = appendConstant(resolvedType.getEncoding(RiType.Representation.ObjectHub));
-            InstanceOfNode instanceOfNode = new InstanceOfNode(hub, (RiResolvedType) type, object, getProfileForTypeCheck(resolvedType));
+        if (type instanceof ResolvedJavaType) {
+            ResolvedJavaType resolvedType = (ResolvedJavaType) type;
+            ConstantNode hub = appendConstant(resolvedType.getEncoding(JavaType.Representation.ObjectHub));
+            InstanceOfNode instanceOfNode = new InstanceOfNode(hub, (ResolvedJavaType) type, object, getProfileForTypeCheck(resolvedType));
             frameState.ipush(append(MaterializeNode.create(currentGraph.unique(instanceOfNode), currentGraph)));
         } else {
             BlockPlaceholderNode successor = currentGraph.add(new BlockPlaceholderNode());
-            DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId));
+            DeoptimizeNode deopt = currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId));
             IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new IsNullNode(object)), successor, deopt, 0));
             append(ifNode);
             lastInstr = successor;
@@ -660,12 +660,12 @@
     }
 
     void genNewInstance(int cpi) {
-        RiType type = lookupType(cpi, NEW);
-        if (type instanceof RiResolvedType) {
-            NewInstanceNode n = currentGraph.add(new NewInstanceNode((RiResolvedType) type));
+        JavaType type = lookupType(cpi, NEW);
+        if (type instanceof ResolvedJavaType) {
+            NewInstanceNode n = currentGraph.add(new NewInstanceNode((ResolvedJavaType) type));
             frameState.apush(append(n));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
@@ -694,50 +694,50 @@
 
     private void genNewTypeArray(int typeCode) {
         Kind kind = arrayTypeCodeToKind(typeCode);
-        RiResolvedType elementType = runtime.asRiType(kind);
+        ResolvedJavaType elementType = runtime.getResolvedJavaType(kind);
         NewTypeArrayNode nta = currentGraph.add(new NewTypeArrayNode(frameState.ipop(), elementType));
         frameState.apush(append(nta));
     }
 
     private void genNewObjectArray(int cpi) {
-        RiType type = lookupType(cpi, ANEWARRAY);
+        JavaType type = lookupType(cpi, ANEWARRAY);
         ValueNode length = frameState.ipop();
-        if (type instanceof RiResolvedType) {
-            NewArrayNode n = currentGraph.add(new NewObjectArrayNode((RiResolvedType) type, length));
+        if (type instanceof ResolvedJavaType) {
+            NewArrayNode n = currentGraph.add(new NewObjectArrayNode((ResolvedJavaType) type, length));
             frameState.apush(append(n));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
 
     }
 
     private void genNewMultiArray(int cpi) {
-        RiType type = lookupType(cpi, MULTIANEWARRAY);
+        JavaType type = lookupType(cpi, MULTIANEWARRAY);
         int rank = stream().readUByte(bci() + 3);
         ValueNode[] dims = new ValueNode[rank];
         for (int i = rank - 1; i >= 0; i--) {
             dims[i] = frameState.ipop();
         }
-        if (type instanceof RiResolvedType) {
-            FixedWithNextNode n = currentGraph.add(new NewMultiArrayNode((RiResolvedType) type, dims));
+        if (type instanceof ResolvedJavaType) {
+            FixedWithNextNode n = currentGraph.add(new NewMultiArrayNode((ResolvedJavaType) type, dims));
             frameState.apush(append(n));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
 
-    private void genGetField(RiField field) {
+    private void genGetField(JavaField field) {
         emitExplicitExceptions(frameState.peek(0), null);
 
         Kind kind = field.kind();
         ValueNode receiver = frameState.apop();
-        if ((field instanceof RiResolvedField) && ((RiResolvedField) field).holder().isInitialized()) {
-            LoadFieldNode load = currentGraph.add(new LoadFieldNode(receiver, (RiResolvedField) field, graphId));
+        if ((field instanceof ResolvedJavaField) && ((ResolvedJavaField) field).holder().isInitialized()) {
+            LoadFieldNode load = currentGraph.add(new LoadFieldNode(receiver, (ResolvedJavaField) field, graphId));
             appendOptimizedLoadField(kind, load);
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             frameState.push(kind.stackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
         }
     }
@@ -793,7 +793,7 @@
 
     private void emitExplicitExceptions(ValueNode receiver, ValueNode outOfBoundsIndex) {
         assert receiver != null;
-        if (!GraalOptions.AllowExplicitExceptionChecks || (optimisticOpts.useExceptionProbability() && profilingInfo.getExceptionSeen(bci()) == RiExceptionSeen.FALSE)) {
+        if (!GraalOptions.AllowExplicitExceptionChecks || (optimisticOpts.useExceptionProbability() && profilingInfo.getExceptionSeen(bci()) == ExceptionSeen.FALSE)) {
             return;
         }
 
@@ -805,33 +805,33 @@
         Debug.metric("ExplicitExceptions").increment();
     }
 
-    private void genPutField(RiField field) {
+    private void genPutField(JavaField field) {
         emitExplicitExceptions(frameState.peek(1), null);
 
         ValueNode value = frameState.pop(field.kind().stackKind());
         ValueNode receiver = frameState.apop();
-        if (field instanceof RiResolvedField && ((RiResolvedField) field).holder().isInitialized()) {
-            StoreFieldNode store = currentGraph.add(new StoreFieldNode(receiver, (RiResolvedField) field, value, graphId));
+        if (field instanceof ResolvedJavaField && ((ResolvedJavaField) field).holder().isInitialized()) {
+            StoreFieldNode store = currentGraph.add(new StoreFieldNode(receiver, (ResolvedJavaField) field, value, graphId));
             appendOptimizedStoreField(store);
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
         }
     }
 
-    private void genGetStatic(RiField field) {
-        RiType holder = field.holder();
-        boolean isInitialized = (field instanceof RiResolvedField) && ((RiResolvedType) holder).isInitialized();
+    private void genGetStatic(JavaField field) {
+        JavaType holder = field.holder();
+        boolean isInitialized = (field instanceof ResolvedJavaField) && ((ResolvedJavaType) holder).isInitialized();
         Constant constantValue = null;
         if (isInitialized) {
-            constantValue = ((RiResolvedField) field).constantValue(null);
+            constantValue = ((ResolvedJavaField) field).constantValue(null);
         }
         if (constantValue != null) {
             frameState.push(constantValue.kind.stackKind(), appendConstant(constantValue));
         } else {
-            ValueNode container = genTypeOrDeopt(RiType.Representation.StaticFields, holder, isInitialized);
+            ValueNode container = genTypeOrDeopt(JavaType.Representation.StaticFields, holder, isInitialized);
             Kind kind = field.kind();
             if (container != null) {
-                LoadFieldNode load = currentGraph.add(new LoadFieldNode(container, (RiResolvedField) field, graphId));
+                LoadFieldNode load = currentGraph.add(new LoadFieldNode(container, (ResolvedJavaField) field, graphId));
                 appendOptimizedLoadField(kind, load);
             } else {
                 // deopt will be generated by genTypeOrDeopt, not needed here
@@ -840,23 +840,23 @@
         }
     }
 
-    private void genPutStatic(RiField field) {
-        RiType holder = field.holder();
-        ValueNode container = genTypeOrDeopt(RiType.Representation.StaticFields, holder, field instanceof RiResolvedField && ((RiResolvedType) holder).isInitialized());
+    private void genPutStatic(JavaField field) {
+        JavaType holder = field.holder();
+        ValueNode container = genTypeOrDeopt(JavaType.Representation.StaticFields, holder, field instanceof ResolvedJavaField && ((ResolvedJavaType) holder).isInitialized());
         ValueNode value = frameState.pop(field.kind().stackKind());
         if (container != null) {
-            StoreFieldNode store = currentGraph.add(new StoreFieldNode(container, (RiResolvedField) field, value, graphId));
+            StoreFieldNode store = currentGraph.add(new StoreFieldNode(container, (ResolvedJavaField) field, value, graphId));
             appendOptimizedStoreField(store);
         } else {
             // deopt will be generated by genTypeOrDeopt, not needed here
         }
     }
 
-    private ConstantNode genTypeOrDeopt(RiType.Representation representation, RiType holder, boolean initialized) {
+    private ConstantNode genTypeOrDeopt(JavaType.Representation representation, JavaType holder, boolean initialized) {
         if (initialized) {
-            return appendConstant(((RiResolvedType) holder).getEncoding(representation));
+            return appendConstant(((ResolvedJavaType) holder).getEncoding(representation));
         } else {
-            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+            append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
             return null;
         }
     }
@@ -871,10 +871,10 @@
         frameState.push(kind.stackKind(), optimized);
     }
 
-    private void genInvokeStatic(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
-            RiResolvedMethod resolvedTarget = (RiResolvedMethod) target;
-            RiResolvedType holder = resolvedTarget.holder();
+    private void genInvokeStatic(JavaMethod target) {
+        if (target instanceof ResolvedJavaMethod) {
+            ResolvedJavaMethod resolvedTarget = (ResolvedJavaMethod) target;
+            ResolvedJavaType holder = resolvedTarget.holder();
             if (!holder.isInitialized() && GraalOptions.ResolveClassBeforeStaticInvoke) {
                 genInvokeDeopt(target, false);
             } else {
@@ -886,38 +886,38 @@
         }
     }
 
-    private void genInvokeInterface(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
+    private void genInvokeInterface(JavaMethod target) {
+        if (target instanceof ResolvedJavaMethod) {
             ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
-            genInvokeIndirect(InvokeKind.Interface, (RiResolvedMethod) target, args);
+            genInvokeIndirect(InvokeKind.Interface, (ResolvedJavaMethod) target, args);
         } else {
             genInvokeDeopt(target, true);
         }
     }
 
-    private void genInvokeVirtual(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
+    private void genInvokeVirtual(JavaMethod target) {
+        if (target instanceof ResolvedJavaMethod) {
             ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
-            genInvokeIndirect(InvokeKind.Virtual, (RiResolvedMethod) target, args);
+            genInvokeIndirect(InvokeKind.Virtual, (ResolvedJavaMethod) target, args);
         } else {
             genInvokeDeopt(target, true);
         }
 
     }
 
-    private void genInvokeSpecial(RiMethod target) {
-        if (target instanceof RiResolvedMethod) {
+    private void genInvokeSpecial(JavaMethod target) {
+        if (target instanceof ResolvedJavaMethod) {
             assert target != null;
             assert target.signature() != null;
             ValueNode[] args = frameState.popArguments(target.signature().argumentSlots(true), target.signature().argumentCount(true));
-            invokeDirect((RiResolvedMethod) target, args);
+            invokeDirect((ResolvedJavaMethod) target, args);
         } else {
             genInvokeDeopt(target, true);
         }
     }
 
-    private void genInvokeDeopt(RiMethod unresolvedTarget, boolean withReceiver) {
-        append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
+    private void genInvokeDeopt(JavaMethod unresolvedTarget, boolean withReceiver) {
+        append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
         frameState.popArguments(unresolvedTarget.signature().argumentSlots(withReceiver), unresolvedTarget.signature().argumentCount(withReceiver));
         Kind kind = unresolvedTarget.signature().returnKind();
         if (kind != Kind.Void) {
@@ -925,10 +925,10 @@
         }
     }
 
-    private void genInvokeIndirect(InvokeKind invokeKind, RiResolvedMethod target, ValueNode[] args) {
+    private void genInvokeIndirect(InvokeKind invokeKind, ResolvedJavaMethod target, ValueNode[] args) {
         ValueNode receiver = args[0];
         // attempt to devirtualize the call
-        RiResolvedType klass = target.holder();
+        ResolvedJavaType klass = target.holder();
 
         // 0. check for trivial cases
         if (target.canBeStaticallyBound() && !isAbstract(target.accessFlags())) {
@@ -937,7 +937,7 @@
             return;
         }
         // 1. check if the exact type of the receiver can be determined
-        RiResolvedType exact = klass.exactType();
+        ResolvedJavaType exact = klass.exactType();
         if (exact == null && receiver.objectStamp().isExactType()) {
             exact = receiver.objectStamp().type();
         }
@@ -950,14 +950,14 @@
         appendInvoke(invokeKind, target, args);
     }
 
-    private void invokeDirect(RiResolvedMethod target, ValueNode[] args) {
+    private void invokeDirect(ResolvedJavaMethod target, ValueNode[] args) {
         appendInvoke(InvokeKind.Special, target, args);
     }
 
-    private void appendInvoke(InvokeKind invokeKind, RiResolvedMethod targetMethod, ValueNode[] args) {
+    private void appendInvoke(InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] args) {
         Kind resultType = targetMethod.signature().returnKind();
         if (GraalOptions.DeoptALot) {
-            DeoptimizeNode deoptimize = currentGraph.add(new DeoptimizeNode(CiDeoptAction.None, RiDeoptReason.RuntimeConstraint, graphId));
+            DeoptimizeNode deoptimize = currentGraph.add(new DeoptimizeNode(CiDeoptAction.None, DeoptimizationReason.RuntimeConstraint, graphId));
             deoptimize.setMessage("invoke " + targetMethod.name());
             append(deoptimize);
             frameState.pushReturn(resultType, ConstantNode.defaultForKind(resultType, currentGraph));
@@ -966,7 +966,7 @@
 
         MethodCallTargetNode callTarget = currentGraph.add(new MethodCallTargetNode(invokeKind, targetMethod, args, targetMethod.signature().returnType(method.holder())));
         // be conservative if information was not recorded (could result in endless recompiles otherwise)
-        if (optimisticOpts.useExceptionProbability() && profilingInfo.getExceptionSeen(bci()) == RiExceptionSeen.FALSE) {
+        if (optimisticOpts.useExceptionProbability() && profilingInfo.getExceptionSeen(bci()) == ExceptionSeen.FALSE) {
             ValueNode result = appendWithBCI(currentGraph.add(new InvokeNode(callTarget, bci(), graphId)));
             frameState.pushReturn(resultType, result);
 
@@ -1029,7 +1029,7 @@
         ValueNode local = frameState.loadLocal(localIndex);
         JsrScope scope = currentBlock.jsrScope;
         int retAddress = scope.nextReturnAddress();
-        append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IntegerEqualsNode(local, ConstantNode.forJsr(retAddress, currentGraph))), RiDeoptReason.JavaSubroutineMismatch, CiDeoptAction.InvalidateReprofile, graphId)));
+        append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IntegerEqualsNode(local, ConstantNode.forJsr(retAddress, currentGraph))), DeoptimizationReason.JavaSubroutineMismatch, CiDeoptAction.InvalidateReprofile, graphId)));
         if (!successor.jsrScope.equals(scope.pop())) {
             throw new JsrNotSupportedBailout("unstructured control flow (ret leaves more than one scope)");
         }
@@ -1186,7 +1186,7 @@
     private FixedNode createTarget(double probability, Block block, FrameStateBuilder stateAfter) {
         assert probability >= 0 && probability <= 1;
         if (probability == 0 && optimisticOpts.removeNeverExecutedCode()) {
-            return currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, RiDeoptReason.UnreachedCode, graphId));
+            return currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateReprofile, DeoptimizationReason.UnreachedCode, graphId));
         } else {
             return createTarget(block, stateAfter);
         }
@@ -1272,7 +1272,7 @@
         return begin;
     }
 
-    private ValueNode synchronizedObject(FrameStateBuilder state, RiResolvedMethod target) {
+    private ValueNode synchronizedObject(FrameStateBuilder state, ResolvedJavaMethod target) {
         if (isStatic(target.accessFlags())) {
             return append(ConstantNode.forCiConstant(target.holder().getEncoding(Representation.JavaClass), runtime, currentGraph));
         } else {
@@ -1376,14 +1376,14 @@
             return;
         }
 
-        RiType catchType = block.handler.catchType();
+        JavaType catchType = block.handler.catchType();
         if (graphBuilderConfig.eagerResolving()) {
             catchType = lookupType(block.handler.catchTypeCPI(), INSTANCEOF);
         }
-        boolean initialized = (catchType instanceof RiResolvedType);
+        boolean initialized = (catchType instanceof ResolvedJavaType);
         if (initialized && graphBuilderConfig.getSkippedExceptionTypes() != null) {
-            RiResolvedType resolvedCatchType = (RiResolvedType) catchType;
-            for (RiResolvedType skippedType : graphBuilderConfig.getSkippedExceptionTypes()) {
+            ResolvedJavaType resolvedCatchType = (ResolvedJavaType) catchType;
+            for (ResolvedJavaType skippedType : graphBuilderConfig.getSkippedExceptionTypes()) {
                 initialized &= !resolvedCatchType.isSubtypeOf(skippedType);
                 if (!initialized) {
                     break;
@@ -1391,13 +1391,13 @@
             }
         }
 
-        ConstantNode typeInstruction = genTypeOrDeopt(RiType.Representation.ObjectHub, catchType, initialized);
+        ConstantNode typeInstruction = genTypeOrDeopt(JavaType.Representation.ObjectHub, catchType, initialized);
         if (typeInstruction != null) {
             Block nextBlock = block.successors.size() == 1 ? unwindBlock(block.deoptBci) : block.successors.get(1);
             FixedNode catchSuccessor = createTarget(block.successors.get(0), frameState);
             FixedNode nextDispatch = createTarget(nextBlock, frameState);
             ValueNode exception = frameState.stackAt(0);
-            IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new InstanceOfNode(typeInstruction, (RiResolvedType) catchType, exception)), catchSuccessor, nextDispatch, 0.5));
+            IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new InstanceOfNode(typeInstruction, (ResolvedJavaType) catchType, exception)), catchSuccessor, nextDispatch, 0.5));
             append(ifNode);
         }
     }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Sat Jun 09 16:52:12 2012 +0200
@@ -71,16 +71,16 @@
  * of such a block may be greater than the size of a normal spill slot or the word size.
  * <br>
  * A runtime has two ways to reserve space in the stack frame for its own use: <ul>
- * <li>A memory block somewhere in the frame of size {@link RiRuntime#getCustomStackAreaSize()}. The offset
+ * <li>A memory block somewhere in the frame of size {@link CodeCacheProvider#getCustomStackAreaSize()}. The offset
  *     to this block is returned in {@link CiTargetMethod#customStackAreaOffset()}.
  * <li>At the beginning of the overflow argument area: The calling convention can specify that the first
  *     overflow stack argument is not at offset 0, but at a specified offset o. Use
- *     {@link RiRuntime#getMinimumOutgoingSize()} to make sure that call-free methods also have this space
+ *     {@link CodeCacheProvider#getMinimumOutgoingSize()} to make sure that call-free methods also have this space
  *     reserved. Then the VM can use memory the memory at offset 0 relative to the stack pointer.
  * </ul>
  */
 public final class FrameMap {
-    public final RiRuntime runtime;
+    public final CodeCacheProvider runtime;
     public final CiTarget target;
     public final CiRegisterConfig registerConfig;
 
@@ -125,7 +125,7 @@
     /**
      * Creates a new frame map for the specified method.
      */
-    public FrameMap(RiRuntime runtime, CiTarget target, CiRegisterConfig registerConfig) {
+    public FrameMap(CodeCacheProvider runtime, CiTarget target, CiRegisterConfig registerConfig) {
         this.runtime = runtime;
         this.target = target;
         this.registerConfig = registerConfig;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Sat Jun 09 16:52:12 2012 +0200
@@ -49,7 +49,7 @@
     public final AbstractAssembler asm;
     public final CiTargetMethod targetMethod;
     public final CiTarget target;
-    public final RiRuntime runtime;
+    public final CodeCacheProvider runtime;
     public final FrameMap frameMap;
 
     /**
@@ -66,7 +66,7 @@
     private List<ExceptionInfo> exceptionInfoList;
     private int lastSafepointPos;
 
-    public TargetMethodAssembler(CiTarget target, RiRuntime runtime, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext, List<Code> stubs) {
+    public TargetMethodAssembler(CiTarget target, CodeCacheProvider runtime, FrameMap frameMap, AbstractAssembler asm, FrameContext frameContext, List<Code> stubs) {
         this.target = target;
         this.runtime = runtime;
         this.frameMap = frameMap;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/CiLoweringTool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,8 +30,8 @@
     ExtendedRiRuntime getRuntime();
     ValueNode getGuardAnchor();
     ValueNode createNullCheckGuard(ValueNode object, long leafGraphId);
-    ValueNode createGuard(BooleanNode condition, RiDeoptReason deoptReason, CiDeoptAction action, long leafGraphId);
-    ValueNode createGuard(BooleanNode condition, RiDeoptReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId);
+    ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, long leafGraphId);
+    ValueNode createGuard(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId);
     CiAssumptions assumptions();
 }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/ExtendedRiRuntime.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/ExtendedRiRuntime.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,12 +32,12 @@
 /**
  * Graal-specific extensions for the runtime interface that must be implemented by the VM.
  */
-public interface ExtendedRiRuntime extends RiRuntime {
+public interface ExtendedRiRuntime extends CodeCacheProvider {
 
     void lower(Node n, CiLoweringTool tool);
 
-    StructuredGraph intrinsicGraph(RiResolvedMethod caller, int bci, RiResolvedMethod method, List<? extends Node> parameters);
+    StructuredGraph intrinsicGraph(ResolvedJavaMethod caller, int bci, ResolvedJavaMethod method, List<? extends Node> parameters);
 
-    CiTargetMethod compile(RiResolvedMethod method, StructuredGraph graph);
+    CiTargetMethod compile(ResolvedJavaMethod method, StructuredGraph graph);
 
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/RiGraphCache.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/cri/RiGraphCache.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,6 +30,6 @@
 
     void put(StructuredGraph graph);
 
-    StructuredGraph get(RiResolvedMethod method);
+    StructuredGraph get(ResolvedJavaMethod method);
 
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/CallTargetNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -39,7 +39,7 @@
         return arguments;
     }
 
-    public abstract RiType returnType();
+    public abstract JavaType returnType();
 
     public abstract Kind returnKind();
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -47,7 +47,7 @@
      * Constructs a new ConstantNode representing the specified constant.
      * @param value the constant
      */
-    protected ConstantNode(Constant value, RiRuntime runtime) {
+    protected ConstantNode(Constant value, CodeCacheProvider runtime) {
         super(StampFactory.forConstant(value, runtime));
         this.value = value;
     }
@@ -65,7 +65,7 @@
         return usages().filter(NodePredicates.isNotA(FrameState.class)).isEmpty();
     }
 
-    public static ConstantNode forCiConstant(Constant constant, RiRuntime runtime, Graph graph) {
+    public static ConstantNode forCiConstant(Constant constant, CodeCacheProvider runtime, Graph graph) {
         if (constant.kind == Kind.Object) {
             return graph.unique(new ConstantNode(constant, runtime));
         } else {
@@ -169,7 +169,7 @@
      * @param graph
      * @return a node representing the object
      */
-    public static ConstantNode forObject(Object o, RiRuntime runtime, Graph graph) {
+    public static ConstantNode forObject(Object o, CodeCacheProvider runtime, Graph graph) {
         return graph.unique(new ConstantNode(Constant.forObject(o), runtime));
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -33,15 +33,15 @@
 
     private String message;
     private final CiDeoptAction action;
-    private final RiDeoptReason reason;
+    private final DeoptimizationReason reason;
     private final long leafGraphId;
 
 
-    public DeoptimizeNode(CiDeoptAction action, RiDeoptReason reason) {
+    public DeoptimizeNode(CiDeoptAction action, DeoptimizationReason reason) {
         this(action, reason, -1);
     }
 
-    public DeoptimizeNode(CiDeoptAction action, RiDeoptReason reason, long leafGraphId) {
+    public DeoptimizeNode(CiDeoptAction action, DeoptimizationReason reason, long leafGraphId) {
         super(StampFactory.forVoid());
         this.action = action;
         this.reason = reason;
@@ -60,7 +60,7 @@
         return action;
     }
 
-    public RiDeoptReason reason() {
+    public DeoptimizationReason reason() {
         return reason;
     }
 
@@ -75,7 +75,7 @@
 
     @SuppressWarnings("unused")
     @NodeIntrinsic
-    public static void deopt(@ConstantNodeParameter CiDeoptAction action, @ConstantNodeParameter RiDeoptReason reason) {
+    public static void deopt(@ConstantNodeParameter CiDeoptAction action, @ConstantNodeParameter DeoptimizationReason reason) {
         throw new UnsupportedOperationException();
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,7 +32,7 @@
 public final class FixedGuardNode extends FixedWithNextNode implements Simplifiable, Lowerable, LIRLowerable, Node.IterableNodeType, Negatable {
 
     @Input private BooleanNode condition;
-    private final RiDeoptReason deoptReason;
+    private final DeoptimizationReason deoptReason;
     private final CiDeoptAction action;
     private boolean negated;
     private final long leafGraphId;
@@ -46,11 +46,11 @@
         condition = x;
     }
 
-    public FixedGuardNode(BooleanNode condition, RiDeoptReason deoptReason, CiDeoptAction action, long leafGraphId) {
+    public FixedGuardNode(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, long leafGraphId) {
         this(condition, deoptReason, action, false, leafGraphId);
     }
 
-    public FixedGuardNode(BooleanNode condition, RiDeoptReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
+    public FixedGuardNode(BooleanNode condition, DeoptimizationReason deoptReason, CiDeoptAction action, boolean negated, long leafGraphId) {
         super(StampFactory.forVoid());
         this.action = action;
         this.negated = negated;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FrameState.java	Sat Jun 09 16:52:12 2012 +0200
@@ -82,7 +82,7 @@
      */
     public final int bci;
 
-    private final RiResolvedMethod method;
+    private final ResolvedJavaMethod method;
 
     /**
      * Creates a {@code FrameState} for the given scope and maximum number of stack and local variables.
@@ -93,7 +93,7 @@
      * @param stackSize size of the stack
      * @param rethrowException if true the VM should re-throw the exception on top of the stack when deopt'ing using this framestate
      */
-    public FrameState(RiResolvedMethod method, int bci, int localsSize, int stackSize, boolean rethrowException, boolean duringCall) {
+    public FrameState(ResolvedJavaMethod method, int bci, int localsSize, int stackSize, boolean rethrowException, boolean duringCall) {
         assert stackSize >= 0;
         this.method = method;
         this.bci = bci;
@@ -106,7 +106,7 @@
         assert !rethrowException || stackSize == 1 : "must have exception on top of the stack";
     }
 
-    public FrameState(RiResolvedMethod method, int bci, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException, boolean duringCall) {
+    public FrameState(ResolvedJavaMethod method, int bci, ValueNode[] locals, ValueNode[] stack, int stackSize, boolean rethrowException, boolean duringCall) {
         this.method = method;
         this.bci = bci;
         this.localsSize = locals.length;
@@ -156,7 +156,7 @@
         this.duringCall = b;
     }
 
-    public RiResolvedMethod method() {
+    public ResolvedJavaMethod method() {
         return method;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -45,7 +45,7 @@
 
     @Input private BooleanNode condition;
     @Input(notDataflow = true) private FixedNode anchor;
-    private final RiDeoptReason reason;
+    private final DeoptimizationReason reason;
     private final CiDeoptAction action;
     private boolean negated;
     private final long leafGraphId;
@@ -75,7 +75,7 @@
         return negated;
     }
 
-    public RiDeoptReason reason() {
+    public DeoptimizationReason reason() {
         return reason;
     }
 
@@ -83,7 +83,7 @@
         return action;
     }
 
-    public GuardNode(BooleanNode condition, FixedNode anchor, RiDeoptReason reason, CiDeoptAction action, boolean negated, long leafGraphId) {
+    public GuardNode(BooleanNode condition, FixedNode anchor, DeoptimizationReason reason, CiDeoptAction action, boolean negated, long leafGraphId) {
         super(StampFactory.dependency());
         this.condition = condition;
         this.anchor = anchor;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/StructuredGraph.java	Sat Jun 09 16:52:12 2012 +0200
@@ -41,7 +41,7 @@
     public static final long INVALID_GRAPH_ID = -1;
     private static final AtomicLong uniqueGraphIds = new AtomicLong();
     private final StartNode start;
-    private final RiResolvedMethod method;
+    private final ResolvedJavaMethod method;
     private final long graphId;
 
     /**
@@ -58,18 +58,18 @@
         this(name, null);
     }
 
-    public StructuredGraph(String name, RiResolvedMethod method) {
+    public StructuredGraph(String name, ResolvedJavaMethod method) {
         this(name, method, uniqueGraphIds.incrementAndGet());
     }
 
-    private StructuredGraph(String name, RiResolvedMethod method, long graphId) {
+    private StructuredGraph(String name, ResolvedJavaMethod method, long graphId) {
         super(name);
         this.start = add(new StartNode());
         this.method = method;
         this.graphId = graphId;
     }
 
-    public StructuredGraph(RiResolvedMethod method) {
+    public StructuredGraph(ResolvedJavaMethod method) {
         this(null, method);
     }
 
@@ -98,7 +98,7 @@
         return start;
     }
 
-    public RiResolvedMethod method() {
+    public ResolvedJavaMethod method() {
         return method;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -80,7 +80,7 @@
     }
 
 
-    private ValueNode optimizeMaterialize(Constant constant, MaterializeNode materializeNode, RiRuntime runtime, Condition cond) {
+    private ValueNode optimizeMaterialize(Constant constant, MaterializeNode materializeNode, CodeCacheProvider runtime, Condition cond) {
         Constant trueConstant = materializeNode.trueValue().asConstant();
         Constant falseConstant = materializeNode.falseValue().asConstant();
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java	Sat Jun 09 16:52:12 2012 +0200
@@ -246,7 +246,7 @@
      * @return {@link Boolean#TRUE} if the comparison is known to be true,
      * {@link Boolean#FALSE} if the comparison is known to be false
      */
-    public boolean foldCondition(Constant lt, Constant rt, RiRuntime runtime) {
+    public boolean foldCondition(Constant lt, Constant rt, CodeCacheProvider runtime) {
         assert !lt.kind.isFloatOrDouble() && !rt.kind.isFloatOrDouble();
         return foldCondition(lt, rt, runtime, false);
     }
@@ -259,7 +259,7 @@
      * @param unorderedIsTrue true if an undecided float comparison should result in "true"
      * @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, RiRuntime runtime, boolean unorderedIsTrue) {
+    public boolean foldCondition(Constant lt, Constant rt, CodeCacheProvider runtime, boolean unorderedIsTrue) {
         switch (lt.kind) {
             case Boolean:
             case Byte:
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -36,7 +36,7 @@
     private int bci;
     private Kind sourceKind;
 
-    public BoxNode(ValueNode value, RiResolvedType type, Kind sourceKind, int bci) {
+    public BoxNode(ValueNode value, ResolvedJavaType type, Kind sourceKind, int bci) {
         super(StampFactory.exactNonNull(type));
         this.source = value;
         this.bci = bci;
@@ -54,7 +54,7 @@
     }
 
     public void expand(BoxingMethodPool pool) {
-        RiResolvedMethod boxingMethod = pool.getBoxingMethod(sourceKind);
+        ResolvedJavaMethod boxingMethod = pool.getBoxingMethod(sourceKind);
         MethodCallTargetNode callTarget = graph().add(new MethodCallTargetNode(InvokeKind.Static, boxingMethod, new ValueNode[]{source}, boxingMethod.signature().returnType(boxingMethod.holder())));
         InvokeNode invokeNode = graph().add(new InvokeNode(callTarget, bci, -1));
         invokeNode.setProbability(this.probability());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxingMethodPool.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/BoxingMethodPool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -29,13 +29,13 @@
 
 public class BoxingMethodPool {
 
-    private final Set<RiMethod> specialMethods = new HashSet<>();
-    private final RiRuntime runtime;
-    private final RiResolvedMethod[] boxingMethods = new RiResolvedMethod[Kind.values().length];
-    private final RiResolvedMethod[] unboxingMethods = new RiResolvedMethod[Kind.values().length];
-    private final RiResolvedField[] boxFields = new RiResolvedField[Kind.values().length];
+    private final Set<JavaMethod> specialMethods = new HashSet<>();
+    private final CodeCacheProvider runtime;
+    private final ResolvedJavaMethod[] boxingMethods = new ResolvedJavaMethod[Kind.values().length];
+    private final ResolvedJavaMethod[] unboxingMethods = new ResolvedJavaMethod[Kind.values().length];
+    private final ResolvedJavaField[] boxFields = new ResolvedJavaField[Kind.values().length];
 
-    public BoxingMethodPool(RiRuntime runtime) {
+    public BoxingMethodPool(CodeCacheProvider runtime) {
         this.runtime = runtime;
         initialize();
     }
@@ -60,43 +60,43 @@
     private void initialize(Kind kind, Class<?> type, String unboxMethod) throws SecurityException, NoSuchMethodException {
 
         // Get boxing method from runtime.
-        RiResolvedMethod boxingMethod = runtime.getRiMethod(type.getDeclaredMethod("valueOf", kind.toJavaClass()));
+        ResolvedJavaMethod boxingMethod = runtime.getResolvedJavaMethod(type.getDeclaredMethod("valueOf", kind.toJavaClass()));
         specialMethods.add(boxingMethod);
         boxingMethods[kind.ordinal()] = boxingMethod;
 
         // Get unboxing method from runtime.
-        RiResolvedMethod unboxingMethod = runtime.getRiMethod(type.getDeclaredMethod(unboxMethod));
+        ResolvedJavaMethod unboxingMethod = runtime.getResolvedJavaMethod(type.getDeclaredMethod(unboxMethod));
         unboxingMethods[kind.ordinal()] = unboxingMethod;
         specialMethods.add(unboxingMethod);
 
         // Get the field that contains the boxed value.
-        RiResolvedField[] fields = runtime.getType(type).declaredFields();
-        RiResolvedField boxField = fields[0];
+        ResolvedJavaField[] fields = runtime.getResolvedJavaType(type).declaredFields();
+        ResolvedJavaField boxField = fields[0];
         assert fields.length == 1 && boxField.kind() == kind;
         boxFields[kind.ordinal()] = boxField;
     }
 
-    public boolean isSpecialMethod(RiResolvedMethod method) {
+    public boolean isSpecialMethod(ResolvedJavaMethod method) {
         return specialMethods.contains(method);
     }
 
-    public boolean isBoxingMethod(RiResolvedMethod method) {
+    public boolean isBoxingMethod(ResolvedJavaMethod method) {
         return isSpecialMethod(method) && method.signature().returnKind() == Kind.Object;
     }
 
-    public boolean isUnboxingMethod(RiResolvedMethod method) {
+    public boolean isUnboxingMethod(ResolvedJavaMethod method) {
         return isSpecialMethod(method) && method.signature().returnKind() != Kind.Object;
     }
 
-    public RiResolvedMethod getBoxingMethod(Kind kind) {
+    public ResolvedJavaMethod getBoxingMethod(Kind kind) {
         return boxingMethods[kind.ordinal()];
     }
 
-    public RiResolvedMethod getUnboxingMethod(Kind kind) {
+    public ResolvedJavaMethod getUnboxingMethod(Kind kind) {
         return unboxingMethods[kind.ordinal()];
     }
 
-    public RiResolvedField getBoxField(Kind kind) {
+    public ResolvedJavaField getBoxField(Kind kind) {
         return boxFields[kind.ordinal()];
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -60,7 +60,7 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
-        RiRuntime runtime = tool.runtime();
+        CodeCacheProvider runtime = tool.runtime();
         if (runtime != null && object() != null && object().isConstant() && object().kind() == Kind.Object) {
             if (this.location() == LocationNode.FINAL_LOCATION && location().getClass() == LocationNode.class) {
                 Object value = object().asConstant().asObject();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadHubNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadHubNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -24,7 +24,7 @@
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiType.*;
+import com.oracle.graal.api.meta.JavaType.*;
 import com.oracle.graal.cri.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.spi.*;
@@ -50,11 +50,11 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
-        RiRuntime runtime = tool.runtime();
+        CodeCacheProvider runtime = tool.runtime();
         if (runtime != null) {
             ObjectStamp stamp = object.objectStamp();
 
-            RiResolvedType exactType;
+            ResolvedJavaType exactType;
             if (stamp.isExactType()) {
                 exactType = stamp.type();
             } else if (stamp.type() != null && tool.assumptions() != null) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -43,7 +43,7 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
-        RiRuntime runtime = tool.runtime();
+        CodeCacheProvider runtime = tool.runtime();
         if (runtime != null && object() != null && object().isConstant() && object().kind() == Kind.Object) {
             if (location() == LocationNode.FINAL_LOCATION && location().getClass() == LocationNode.class) {
                 Object value = object().asConstant().asObject();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -52,7 +52,7 @@
     }
 
     public void expand(BoxingMethodPool pool) {
-        RiResolvedField field = pool.getBoxField(kind());
+        ResolvedJavaField field = pool.getBoxField(kind());
         LoadFieldNode loadField = graph().add(new LoadFieldNode(source, field, StructuredGraph.INVALID_GRAPH_ID));
         loadField.setProbability(probability());
         ((StructuredGraph) graph()).replaceFixedWithFixed(this, loadField);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeCastNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -35,13 +35,13 @@
 public final class UnsafeCastNode extends FloatingNode implements Canonicalizable, Lowerable {
 
     @Input private ValueNode object;
-    private RiResolvedType toType;
+    private ResolvedJavaType toType;
 
     public ValueNode object() {
         return object;
     }
 
-    public UnsafeCastNode(ValueNode object, RiResolvedType toType) {
+    public UnsafeCastNode(ValueNode object, ResolvedJavaType toType) {
         super(StampFactory.declared(toType, object.stamp().nonNull()));
         this.object = object;
         this.toType = toType;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -39,7 +39,7 @@
 
     @Input private ValueNode object;
 
-    protected final RiResolvedField field;
+    protected final ResolvedJavaField field;
     private final long leafGraphId;
 
     public ValueNode object() {
@@ -53,7 +53,7 @@
      * @param field the compiler interface representation of the field
      * @param graph
      */
-    public AccessFieldNode(Stamp stamp, ValueNode object, RiResolvedField field, long leafGraphId) {
+    public AccessFieldNode(Stamp stamp, ValueNode object, ResolvedJavaField field, long leafGraphId) {
         super(stamp);
         this.object = object;
         this.field = field;
@@ -65,7 +65,7 @@
      * Gets the compiler interface field for this field access.
      * @return the compiler interface field for this field access
      */
-    public RiResolvedField field() {
+    public ResolvedJavaField field() {
         return field;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -52,7 +52,7 @@
             assert length != null;
             return length;
         }
-        RiRuntime runtime = tool.runtime();
+        CodeCacheProvider runtime = tool.runtime();
         if (runtime != null && array().isConstant() && !array().isNullConstant()) {
             Constant constantValue = array().asConstant();
             if (constantValue != null && constantValue.isNonNull()) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -38,8 +38,8 @@
 
     @Input private ValueNode object;
     @Input private ValueNode targetClassInstruction;
-    private final RiResolvedType targetClass;
-    private final RiTypeProfile profile;
+    private final ResolvedJavaType targetClass;
+    private final JavaTypeProfile profile;
 
     /**
      * Creates a new CheckCast instruction.
@@ -47,11 +47,11 @@
      * @param targetClass the class being cast to
      * @param object the instruction producing the object
      */
-    public CheckCastNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object) {
+    public CheckCastNode(ValueNode targetClassInstruction, ResolvedJavaType targetClass, ValueNode object) {
         this(targetClassInstruction, targetClass, object, null);
     }
 
-    public CheckCastNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiTypeProfile profile) {
+    public CheckCastNode(ValueNode targetClassInstruction, ResolvedJavaType targetClass, ValueNode object, JavaTypeProfile profile) {
         super(targetClass == null ? StampFactory.forKind(Kind.Object) : StampFactory.declared(targetClass));
         this.targetClassInstruction = targetClassInstruction;
         this.targetClass = targetClass;
@@ -74,7 +74,7 @@
         assert object() != null : this;
 
         if (targetClass != null) {
-            RiResolvedType objectType = object().objectStamp().type();
+            ResolvedJavaType objectType = object().objectStamp().type();
             if (objectType != null && objectType.isSubtypeOf(targetClass)) {
                 // we don't have to check for null types here because they will also pass the checkcast.
                 return object();
@@ -126,11 +126,11 @@
      *
      * @return the target class or null if not known
      */
-    public RiResolvedType targetClass() {
+    public ResolvedJavaType targetClass() {
         return targetClass;
     }
 
-    public RiTypeProfile profile() {
+    public JavaTypeProfile profile() {
         return profile;
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ExceptionObjectNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -36,8 +36,8 @@
     /**
      * Constructs a new ExceptionObject instruction.
      */
-    public ExceptionObjectNode(RiRuntime runtime) {
-        super(StampFactory.declared(runtime.getType(Throwable.class)));
+    public ExceptionObjectNode(CodeCacheProvider runtime) {
+        super(StampFactory.declared(runtime.getResolvedJavaType(Throwable.class)));
     }
 
     @Override
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -36,8 +36,8 @@
 
     @Input private ValueNode object;
     @Input private ValueNode targetClassInstruction;
-    private final RiResolvedType targetClass;
-    private final RiTypeProfile profile;
+    private final ResolvedJavaType targetClass;
+    private final JavaTypeProfile profile;
 
     /**
      * Constructs a new InstanceOfNode.
@@ -46,11 +46,11 @@
      * @param targetClass the class which is the target of the instanceof check
      * @param object the instruction producing the object input to this instruction
      */
-    public InstanceOfNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object) {
+    public InstanceOfNode(ValueNode targetClassInstruction, ResolvedJavaType targetClass, ValueNode object) {
         this(targetClassInstruction, targetClass, object, null);
     }
 
-    public InstanceOfNode(ValueNode targetClassInstruction, RiResolvedType targetClass, ValueNode object, RiTypeProfile profile) {
+    public InstanceOfNode(ValueNode targetClassInstruction, ResolvedJavaType targetClass, ValueNode object, JavaTypeProfile profile) {
         super(StampFactory.condition());
         this.targetClassInstruction = targetClassInstruction;
         this.targetClass = targetClass;
@@ -68,7 +68,7 @@
         assert object() != null : this;
 
         ObjectStamp stamp = object().objectStamp();
-        RiResolvedType type = stamp.type();
+        ResolvedJavaType type = stamp.type();
 
         if (stamp.isExactType()) {
             boolean subType = type.isSubtypeOf(targetClass());
@@ -151,11 +151,11 @@
      * Gets the target class, i.e. the class being cast to, or the class being tested against.
      * @return the target class
      */
-    public RiResolvedType targetClass() {
+    public ResolvedJavaType targetClass() {
         return targetClass;
     }
 
-    public RiTypeProfile profile() {
+    public JavaTypeProfile profile() {
         return profile;
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -23,7 +23,7 @@
 package com.oracle.graal.nodes.java;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiType.*;
+import com.oracle.graal.api.meta.JavaType.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.extended.*;
 import com.oracle.graal.nodes.spi.*;
@@ -32,7 +32,7 @@
 public final class IsTypeNode extends BooleanNode implements Canonicalizable, LIRLowerable {
 
     @Input private ValueNode objectClass;
-    private final RiResolvedType type;
+    private final ResolvedJavaType type;
 
     public ValueNode objectClass() {
         return objectClass;
@@ -44,14 +44,14 @@
      * @param object the instruction producing the object to check against the given type
      * @param type the type for this check
      */
-    public IsTypeNode(ValueNode objectClass, RiResolvedType type) {
+    public IsTypeNode(ValueNode objectClass, ResolvedJavaType type) {
         super(StampFactory.condition());
         assert objectClass == null || objectClass.kind() == Kind.Object;
         this.type = type;
         this.objectClass = objectClass;
     }
 
-    public RiResolvedType type() {
+    public ResolvedJavaType type() {
         return type;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -40,14 +40,14 @@
      * @param object the receiver object
      * @param field the compiler interface field
      */
-    public LoadFieldNode(ValueNode object, RiResolvedField field, long leafGraphId) {
+    public LoadFieldNode(ValueNode object, ResolvedJavaField field, long leafGraphId) {
         super(createStamp(field), object, field, leafGraphId);
     }
 
-    private static Stamp createStamp(RiResolvedField field) {
+    private static Stamp createStamp(ResolvedJavaField field) {
         Kind kind = field.kind();
-        if (kind == Kind.Object && field.type() instanceof RiResolvedType) {
-            return StampFactory.declared((RiResolvedType) field.type());
+        if (kind == Kind.Object && field.type() instanceof ResolvedJavaType) {
+            return StampFactory.declared((ResolvedJavaType) field.type());
         } else {
             return StampFactory.forKind(kind);
         }
@@ -55,7 +55,7 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
-        RiRuntime runtime = tool.runtime();
+        CodeCacheProvider runtime = tool.runtime();
         if (runtime != null) {
             Constant constant = null;
             if (isStatic()) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -62,7 +62,7 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
-        RiRuntime runtime = tool.runtime();
+        CodeCacheProvider runtime = tool.runtime();
         if (runtime != null && index().isConstant() && array().isConstant() && !array().isNullConstant()) {
             Constant arrayConst = array().asConstant();
             if (tool.isImmutable(arrayConst)) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -36,14 +36,14 @@
         Virtual
     }
 
-    private final RiType returnType;
-    private RiResolvedMethod targetMethod;
+    private final JavaType returnType;
+    private ResolvedJavaMethod targetMethod;
     private InvokeKind invokeKind;
 
     /**
      * @param arguments
      */
-    public MethodCallTargetNode(InvokeKind invokeKind, RiResolvedMethod targetMethod, ValueNode[] arguments, RiType returnType) {
+    public MethodCallTargetNode(InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] arguments, JavaType returnType) {
         super(arguments);
         this.invokeKind = invokeKind;
         this.returnType = returnType;
@@ -51,7 +51,7 @@
     }
 
     @Override
-    public RiType returnType() {
+    public JavaType returnType() {
         return returnType;
     }
 
@@ -59,7 +59,7 @@
      * Gets the target method for this invocation instruction.
      * @return the target method
      */
-    public RiResolvedMethod targetMethod() {
+    public ResolvedJavaMethod targetMethod() {
         return targetMethod;
     }
 
@@ -71,7 +71,7 @@
         this.invokeKind = kind;
     }
 
-    public void setTargetMethod(RiResolvedMethod method) {
+    public void setTargetMethod(ResolvedJavaMethod method) {
         targetMethod = method;
     }
 
@@ -126,7 +126,7 @@
             ValueNode receiver = receiver();
             if (receiver != null && receiver.objectStamp().isExactType()) {
                 if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) {
-                    RiResolvedMethod method = receiver.objectStamp().type().resolveMethodImpl(targetMethod);
+                    ResolvedJavaMethod method = receiver.objectStamp().type().resolveMethodImpl(targetMethod);
                     if (method != null) {
                         invokeKind = InvokeKind.Special;
                         targetMethod = method;
@@ -139,8 +139,8 @@
 
     public Stamp returnStamp() {
         Kind returnKind = targetMethod.signature().returnKind();
-        if (returnKind == Kind.Object && returnType instanceof RiResolvedType) {
-            return StampFactory.declared((RiResolvedType) returnType);
+        if (returnKind == Kind.Object && returnType instanceof ResolvedJavaType) {
+            return StampFactory.declared((ResolvedJavaType) returnType);
         } else {
             return StampFactory.forKind(returnKind);
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -74,7 +74,7 @@
      * Gets the element type of the array.
      * @return the element type of the array
      */
-    public abstract RiResolvedType elementType();
+    public abstract ResolvedJavaType elementType();
 
     @Override
     public void typeFeedback(TypeFeedbackTool tool) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewInstanceNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -36,13 +36,13 @@
  */
 public final class NewInstanceNode extends FixedWithNextNode implements EscapeAnalyzable, LIRLowerable, Node.IterableNodeType {
 
-    private final RiResolvedType instanceClass;
+    private final ResolvedJavaType instanceClass;
 
     /**
      * Constructs a NewInstanceNode.
      * @param type the class being allocated
      */
-    public NewInstanceNode(RiResolvedType type) {
+    public NewInstanceNode(ResolvedJavaType type) {
         super(StampFactory.exactNonNull(type));
         this.instanceClass = type;
     }
@@ -51,7 +51,7 @@
      * Gets the instance class being allocated by this node.
      * @return the instance class allocated
      */
-    public RiResolvedType instanceClass() {
+    public ResolvedJavaType instanceClass() {
         return instanceClass;
     }
 
@@ -78,12 +78,12 @@
             return true;
         }
 
-        private void fillEscapeFields(RiResolvedType type, List<EscapeField> escapeFields) {
+        private void fillEscapeFields(ResolvedJavaType type, List<EscapeField> escapeFields) {
             if (type != null) {
                 fillEscapeFields(type.superType(), escapeFields);
-                RiField[] declaredFields = type.declaredFields();
+                JavaField[] declaredFields = type.declaredFields();
                 assert declaredFields != null : "the runtime must specify the declared fields of that type";
-                for (RiField field : declaredFields) {
+                for (JavaField field : declaredFields) {
                     escapeFields.add(new EscapeField(field.name(), field, field.type()));
                 }
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -37,7 +37,7 @@
 public final class NewMultiArrayNode extends FixedWithNextNode implements LIRLowerable, TypeFeedbackProvider {
 
     @Input private final NodeInputList<ValueNode> dimensions;
-    private final RiResolvedType type;
+    private final ResolvedJavaType type;
 
     public ValueNode dimension(int index) {
         return dimensions.get(index);
@@ -54,7 +54,7 @@
      * @param cpi the constant pool index for resolution
      * @param riConstantPool the constant pool for resolution
      */
-    public NewMultiArrayNode(RiResolvedType type, ValueNode[] dimensions) {
+    public NewMultiArrayNode(ResolvedJavaType type, ValueNode[] dimensions) {
         super(StampFactory.exactNonNull(type));
         this.type = type;
         this.dimensions = new NodeInputList<>(this, dimensions);
@@ -66,7 +66,7 @@
         gen.visitNewMultiArray(this);
     }
 
-    public RiResolvedType type() {
+    public ResolvedJavaType type() {
         return type;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewObjectArrayNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewObjectArrayNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -33,20 +33,20 @@
  */
 public final class NewObjectArrayNode extends NewArrayNode implements LIRLowerable, Node.IterableNodeType {
 
-    private final RiResolvedType elementClass;
+    private final ResolvedJavaType elementClass;
 
     /**
      * Constructs a new NewObjectArrayNode.
      * @param elementClass the class of elements in this array
      * @param length the node producing the length of the array
      */
-    public NewObjectArrayNode(RiResolvedType elementClass, ValueNode length) {
+    public NewObjectArrayNode(ResolvedJavaType elementClass, ValueNode length) {
         super(StampFactory.exactNonNull(elementClass.arrayOf()), length);
         this.elementClass = elementClass;
     }
 
     @Override
-    public RiResolvedType elementType() {
+    public ResolvedJavaType elementType() {
         return elementClass;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewTypeArrayNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewTypeArrayNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,15 +32,15 @@
  */
 public final class NewTypeArrayNode extends NewArrayNode implements LIRLowerable {
 
-    private final RiResolvedType elementType;
+    private final ResolvedJavaType elementType;
 
-    public NewTypeArrayNode(ValueNode length, RiResolvedType elementType) {
+    public NewTypeArrayNode(ValueNode length, ResolvedJavaType elementType) {
         super(StampFactory.exactNonNull(elementType.arrayOf()), length);
         this.elementType = elementType;
     }
 
     @Override
-    public RiResolvedType elementType() {
+    public ResolvedJavaType elementType() {
         return elementType;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/StoreFieldNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -58,7 +58,7 @@
      * @param field the compiler interface field
      * @param value the node representing the value to store to the field
      */
-    public StoreFieldNode(ValueNode object, RiResolvedField field, ValueNode value, long leafGraphId) {
+    public StoreFieldNode(ValueNode object, ResolvedJavaField field, ValueNode value, long leafGraphId) {
         super(StampFactory.forVoid(), object, field, leafGraphId);
         this.value = value;
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -29,7 +29,7 @@
 public interface CanonicalizerTool {
     CiTarget target();
     CiAssumptions assumptions();
-    RiRuntime runtime();
+    CodeCacheProvider runtime();
 
     /**
      * Determines if a given constant is an object/array whose current
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeField.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeField.java	Sat Jun 09 16:52:12 2012 +0200
@@ -28,9 +28,9 @@
 
     private final String name;
     private final Object representation;
-    private final RiType type;
+    private final JavaType type;
 
-    public EscapeField(String name, Object representation, RiType type) {
+    public EscapeField(String name, Object representation, JavaType type) {
         this.name = name;
         this.representation = representation;
         this.type = type;
@@ -44,7 +44,7 @@
         return representation;
     }
 
-    public RiType type() {
+    public JavaType type() {
         return type;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -79,8 +79,8 @@
 
     public abstract Value emitConvert(ConvertNode.Op opcode, Value inputVal);
     public abstract void emitMembar(int barriers);
-    public abstract void emitDeoptimizeOnOverflow(CiDeoptAction action, RiDeoptReason reason, Object deoptInfo);
-    public abstract void emitDeoptimize(CiDeoptAction action, RiDeoptReason reason, Object deoptInfo, long leafGraphId);
+    public abstract void emitDeoptimizeOnOverflow(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo);
+    public abstract void emitDeoptimize(CiDeoptAction action, DeoptimizationReason reason, Object deoptInfo, long leafGraphId);
     public abstract Value emitCall(Object target, Kind result, Kind[] arguments, boolean canTrap, Value... args);
     public final Value emitCall(CiRuntimeCall runtimeCall, boolean canTrap, Value... args) {
         return emitCall(runtimeCall, runtimeCall.resultKind, runtimeCall.arguments, canTrap, args);
@@ -88,7 +88,7 @@
 
     public abstract void emitIf(IfNode i);
     public abstract void emitConditional(ConditionalNode i);
-    public abstract void emitGuardCheck(BooleanNode comp, RiDeoptReason deoptReason, CiDeoptAction deoptAction, boolean negated, long leafGraphId);
+    public abstract void emitGuardCheck(BooleanNode comp, DeoptimizationReason deoptReason, CiDeoptAction deoptAction, boolean negated, long leafGraphId);
 
     public abstract void emitLookupSwitch(LookupSwitchNode i);
     public abstract void emitTableSwitch(TableSwitchNode i);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackStore.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackStore.java	Sat Jun 09 16:52:12 2012 +0200
@@ -84,7 +84,7 @@
         }
 
         @Override
-        public boolean declaredType(final RiResolvedType type) {
+        public boolean declaredType(final ResolvedJavaType type) {
             return store.prove(Info.class, new BooleanPredicate<Info>() {
                 @Override
                 public boolean evaluate(Info element) {
@@ -98,7 +98,7 @@
         }
 
         @Override
-        public boolean exactType(final RiResolvedType type) {
+        public boolean exactType(final ResolvedJavaType type) {
             return store.prove(ObjectTypeExact.class, new BooleanPredicate<ObjectTypeExact>() {
                 @Override
                 public boolean evaluate(ObjectTypeExact element) {
@@ -108,12 +108,12 @@
         }
 
         @Override
-        public boolean notDeclaredType(RiResolvedType type) {
+        public boolean notDeclaredType(ResolvedJavaType type) {
             return false;
         }
 
         @Override
-        public boolean notExactType(final RiResolvedType type) {
+        public boolean notExactType(final ResolvedJavaType type) {
             return store.prove(Info.class, new BooleanPredicate<Info>() {
                 @Override
                 public boolean evaluate(Info element) {
@@ -175,16 +175,16 @@
     }
 
     private static class ObjectType extends Info {
-        public final RiResolvedType type;
+        public final ResolvedJavaType type;
 
-        public ObjectType(RiResolvedType type) {
+        public ObjectType(ResolvedJavaType type) {
             this.type = type;
         }
     }
 
     private static final class ObjectTypeDeclared extends ObjectType {
 
-        public ObjectTypeDeclared(RiResolvedType type) {
+        public ObjectTypeDeclared(ResolvedJavaType type) {
             super(type);
         }
 
@@ -196,7 +196,7 @@
 
     private static final class ObjectTypeExact extends ObjectType {
 
-        public ObjectTypeExact(RiResolvedType type) {
+        public ObjectTypeExact(ResolvedJavaType type) {
             super(type);
         }
 
@@ -346,7 +346,7 @@
     }
 
     @Override
-    public void declaredType(RiResolvedType type, boolean nonNull) {
+    public void declaredType(ResolvedJavaType type, boolean nonNull) {
         assert type != null;
 
         for (ListIterator<Info> iter = infos.listIterator(); iter.hasNext();) {
@@ -374,7 +374,7 @@
     }
 
     @Override
-    public void exactType(RiResolvedType type) {
+    public void exactType(ResolvedJavaType type) {
         assert type != null;
 
         for (ListIterator<Info> iter = infos.listIterator(); iter.hasNext();) {
@@ -398,11 +398,11 @@
     }
 
     @Override
-    public void notDeclaredType(RiResolvedType type, boolean includesNull) {
+    public void notDeclaredType(ResolvedJavaType type, boolean includesNull) {
     }
 
     @Override
-    public void notExactType(RiResolvedType type) {
+    public void notExactType(ResolvedJavaType type) {
     }
 
     public static ObjectTypeFeedbackStore meet(ObjectTypeFeedbackStore[] others) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackTool.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackTool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,11 +32,11 @@
 
     void valueBound(Condition condition, ValueNode otherValue);
 
-    void declaredType(RiResolvedType type, boolean nonNull);
+    void declaredType(ResolvedJavaType type, boolean nonNull);
 
-    void exactType(RiResolvedType type);
+    void exactType(ResolvedJavaType type);
 
-    void notDeclaredType(RiResolvedType type, boolean includesNull);
+    void notDeclaredType(ResolvedJavaType type, boolean includesNull);
 
-    void notExactType(RiResolvedType type);
+    void notExactType(ResolvedJavaType type);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeQuery.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeQuery.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,13 +32,13 @@
 
     boolean valueBound(Condition condition, ValueNode otherValue);
 
-    boolean declaredType(RiResolvedType type);
+    boolean declaredType(ResolvedJavaType type);
 
-    boolean exactType(RiResolvedType type);
+    boolean exactType(ResolvedJavaType type);
 
-    boolean notDeclaredType(RiResolvedType type);
+    boolean notDeclaredType(ResolvedJavaType type);
 
-    boolean notExactType(RiResolvedType type);
+    boolean notExactType(ResolvedJavaType type);
 
     ObjectTypeFeedbackStore store();
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/TypeFeedbackTool.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/TypeFeedbackTool.java	Sat Jun 09 16:52:12 2012 +0200
@@ -35,7 +35,7 @@
 
     ObjectTypeQuery queryObject(ValueNode value);
 
-    RiRuntime runtime();
+    CodeCacheProvider runtime();
 
     TypeFeedbackTool negate();
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java	Sat Jun 09 16:52:12 2012 +0200
@@ -27,11 +27,11 @@
 
 public class ObjectStamp extends Stamp {
 
-    private final RiResolvedType type;
+    private final ResolvedJavaType type;
     private final boolean exactType;
     private final boolean nonNull;
 
-    public ObjectStamp(RiResolvedType type, boolean exactType, boolean nonNull) {
+    public ObjectStamp(ResolvedJavaType type, boolean exactType, boolean nonNull) {
         super(Kind.Object);
         assert !exactType || type != null;
         this.type = type;
@@ -44,7 +44,7 @@
         return nonNull;
     }
 
-    public RiResolvedType type() {
+    public ResolvedJavaType type() {
         return type;
     }
 
@@ -53,12 +53,12 @@
     }
 
     @Override
-    public RiResolvedType exactType() {
+    public ResolvedJavaType exactType() {
         return exactType ? type : null;
     }
 
     @Override
-    public RiResolvedType declaredType() {
+    public ResolvedJavaType declaredType() {
         return type;
     }
 
@@ -86,7 +86,7 @@
     @Override
     public Stamp meet(Stamp otherStamp) {
         ObjectStamp other = (ObjectStamp) otherStamp;
-        RiResolvedType orType = meetTypes(type(), other.type());
+        ResolvedJavaType orType = meetTypes(type(), other.type());
         boolean meetExactType = orType == type && orType == other.type && exactType && other.exactType;
         boolean meetNonNull = nonNull && other.nonNull;
 
@@ -97,7 +97,7 @@
         }
     }
 
-    private static RiResolvedType meetTypes(RiResolvedType a, RiResolvedType b) {
+    private static ResolvedJavaType meetTypes(ResolvedJavaType a, ResolvedJavaType b) {
         if (a == b) {
             return a;
         } else if (a == null || b == null) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/Stamp.java	Sat Jun 09 16:52:12 2012 +0200
@@ -50,11 +50,11 @@
         return false;
     }
 
-    public RiResolvedType exactType() {
+    public ResolvedJavaType exactType() {
         return null;
     }
 
-    public RiResolvedType declaredType() {
+    public ResolvedJavaType declaredType() {
         return null;
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Sat Jun 09 16:52:12 2012 +0200
@@ -119,10 +119,10 @@
         }
     }
 
-    public static Stamp forConstant(Constant value, RiRuntime runtime) {
+    public static Stamp forConstant(Constant value, CodeCacheProvider runtime) {
         assert value.kind == Kind.Object;
         if (value.kind == Kind.Object) {
-            RiResolvedType type = value.isNull() ? null : runtime.getTypeOf(value);
+            ResolvedJavaType type = value.isNull() ? null : runtime.getTypeOf(value);
             return new ObjectStamp(type, value.isNonNull(), value.isNonNull());
         } else {
             throw new GraalInternalError("CiKind.Object expected, actual kind: %s", value.kind);
@@ -137,18 +137,18 @@
         return objectNonNullStamp;
     }
 
-    public static Stamp declared(RiResolvedType type) {
+    public static Stamp declared(ResolvedJavaType type) {
         return declared(type, false);
     }
 
-    public static Stamp declaredNonNull(RiResolvedType type) {
+    public static Stamp declaredNonNull(ResolvedJavaType type) {
         return declared(type, true);
     }
 
-    public static Stamp declared(RiResolvedType type, boolean nonNull) {
+    public static Stamp declared(ResolvedJavaType type, boolean nonNull) {
         assert type != null;
         assert type.kind() == Kind.Object;
-        RiResolvedType exact = type.exactType();
+        ResolvedJavaType exact = type.exactType();
         if (exact != null) {
             return new ObjectStamp(exact, true, nonNull);
         } else {
@@ -156,7 +156,7 @@
         }
     }
 
-    public static Stamp exactNonNull(RiResolvedType type) {
+    public static Stamp exactNonNull(ResolvedJavaType type) {
         return new ObjectStamp(type, true, true);
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/BoxedVirtualObjectNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/BoxedVirtualObjectNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -32,7 +32,7 @@
 
     @Input ValueNode unboxedValue;
 
-    public BoxedVirtualObjectNode(RiResolvedType type, ValueNode unboxedValue) {
+    public BoxedVirtualObjectNode(ResolvedJavaType type, ValueNode unboxedValue) {
         super(type, 1);
         this.unboxedValue = unboxedValue;
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/VirtualObjectNode.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,24 +30,24 @@
 
 public class VirtualObjectNode extends ValueNode implements LIRLowerable {
 
-    private RiResolvedType type;
+    private ResolvedJavaType type;
     private EscapeField[] fields;
     private int fieldsCount;
 
-    public VirtualObjectNode(RiResolvedType type, EscapeField[] fields) {
+    public VirtualObjectNode(ResolvedJavaType type, EscapeField[] fields) {
         super(StampFactory.virtual());
         this.type = type;
         this.fields = fields;
         this.fieldsCount = fields.length;
     }
 
-    public VirtualObjectNode(RiResolvedType type, int fieldCount) {
+    public VirtualObjectNode(ResolvedJavaType type, int fieldCount) {
         super(StampFactory.virtual());
         this.type = type;
         this.fieldsCount = fieldCount;
     }
 
-    public RiType type() {
+    public JavaType type() {
         return type;
     }
 
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/CFGPrinterObserver.java	Sat Jun 09 16:52:12 2012 +0200
@@ -46,7 +46,7 @@
 public class CFGPrinterObserver implements DebugDumpHandler {
 
     private CFGPrinter cfgPrinter;
-    private RiResolvedMethod curMethod;
+    private ResolvedJavaMethod curMethod;
     private List<String> curDecorators = Collections.emptyList();
 
     @Override
@@ -64,11 +64,11 @@
      * does not match the current method and decorator pair.
      */
     private void checkMethodScope() {
-        RiResolvedMethod method = null;
+        ResolvedJavaMethod method = null;
         ArrayList<String> decorators = new ArrayList<>();
         for (Object o : Debug.context()) {
-            if (o instanceof RiResolvedMethod) {
-                method = (RiResolvedMethod) o;
+            if (o instanceof ResolvedJavaMethod) {
+                method = (ResolvedJavaMethod) o;
                 decorators.clear();
             } else if (o instanceof StructuredGraph) {
                 StructuredGraph graph = (StructuredGraph) o;
@@ -121,7 +121,7 @@
             cfgPrinter.cfg = cfgPrinter.lir.cfg;
         }
 
-        RiRuntime runtime = compiler.runtime;
+        CodeCacheProvider runtime = compiler.runtime;
 
         if (object instanceof BciBlockMapping) {
             BciBlockMapping blockMap = (BciBlockMapping) object;
@@ -141,7 +141,7 @@
             final CiTargetMethod tm = (CiTargetMethod) object;
             final byte[] code = Arrays.copyOf(tm.targetCode(), tm.targetCodeSize());
             CodeInfo info = new CodeInfo() {
-                public RiResolvedMethod method() {
+                public ResolvedJavaMethod method() {
                     return null;
                 }
                 public long start() {
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinter.java	Sat Jun 09 16:52:12 2012 +0200
@@ -51,7 +51,7 @@
     /**
      * Starts a new group of graphs with the given name, short name and method byte code index (BCI) as properties.
      */
-    public void beginGroup(String name, String shortName, RiResolvedMethod method, int bci) {
+    public void beginGroup(String name, String shortName, ResolvedJavaMethod method, int bci) {
         beginGroup();
         beginProperties();
         printProperty("name", name);
--- a/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.printer/src/com/oracle/graal/printer/IdealGraphPrinterDumpHandler.java	Sat Jun 09 16:52:12 2012 +0200
@@ -148,8 +148,8 @@
     private static List<String> getInlineContext() {
         List<String> result = new ArrayList<>();
         for (Object o : Debug.context()) {
-            if (o instanceof RiResolvedMethod) {
-                RiResolvedMethod method = (RiResolvedMethod) o;
+            if (o instanceof ResolvedJavaMethod) {
+                ResolvedJavaMethod method = (ResolvedJavaMethod) o;
                 result.add(CiUtil.format("%H::%n(%p)", method));
             } else if (o instanceof DebugDumpScope) {
                 DebugDumpScope debugDumpScope = (DebugDumpScope) o;
@@ -165,7 +165,7 @@
 
     private void openScope(String name, boolean showThread) {
         String prefix = showThread ? Thread.currentThread().getName() + ":" : "";
-        printer.beginGroup(prefix + name, name, Debug.contextLookup(RiResolvedMethod.class), -1);
+        printer.beginGroup(prefix + name, name, Debug.contextLookup(ResolvedJavaMethod.class), -1);
     }
 
     private void closeScope() {
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java	Sat Jun 09 16:52:12 2012 +0200
@@ -58,11 +58,11 @@
      * @see Cache
      */
     public static class Key implements Iterable<Map.Entry<String, Object>> {
-        public final RiResolvedMethod method;
+        public final ResolvedJavaMethod method;
         private final HashMap<String, Object> map = new HashMap<>();
         private int hash;
 
-        public Key(RiResolvedMethod method) {
+        public Key(ResolvedJavaMethod method) {
             this.method = method;
             this.hash = method.hashCode();
         }
@@ -145,10 +145,10 @@
     public static class Cache {
 
         private final ConcurrentHashMap<SnippetTemplate.Key, SnippetTemplate> templates = new ConcurrentHashMap<>();
-        private final RiRuntime runtime;
+        private final CodeCacheProvider runtime;
 
 
-        public Cache(RiRuntime runtime) {
+        public Cache(CodeCacheProvider runtime) {
             this.runtime = runtime;
         }
 
@@ -175,10 +175,10 @@
     /**
      * Creates a snippet template.
      */
-    public SnippetTemplate(RiRuntime runtime, SnippetTemplate.Key key) {
-        RiResolvedMethod method = key.method;
+    public SnippetTemplate(CodeCacheProvider runtime, SnippetTemplate.Key key) {
+        ResolvedJavaMethod method = key.method;
         assert Modifier.isStatic(method.accessFlags()) : "snippet method must be static: " + method;
-        RiSignature signature = method.signature();
+        Signature signature = method.signature();
 
         // Copy snippet graph, replacing @Constant parameters with given arguments
         StructuredGraph snippetGraph = (StructuredGraph) method.compilerStorage().get(Graph.class);
@@ -231,7 +231,7 @@
                     Object array = ((Multiple) key.get(p.value())).array;
                     int length = Array.getLength(array);
                     LocalNode[] locals = new LocalNode[length];
-                    Stamp stamp = StampFactory.forKind(runtime.getType(array.getClass().getComponentType()).kind());
+                    Stamp stamp = StampFactory.forKind(runtime.getResolvedJavaType(array.getClass().getComponentType()).kind());
                     for (int j = 0; j < length; j++) {
                         assert (parameterCount & 0xFFFF) == parameterCount;
                         int idx = i << 16 | j;
@@ -324,7 +324,7 @@
         return true;
     }
 
-    private static boolean checkConstantArgument(final RiResolvedMethod method, RiSignature signature, int i, String name, Object arg, Kind kind) {
+    private static boolean checkConstantArgument(final ResolvedJavaMethod method, Signature signature, int i, String name, Object arg, Kind kind) {
         if (kind.isObject()) {
             Class<?> type = signature.argumentTypeAt(i, method.holder()).resolve(method.holder()).toJava();
             assert type.isInstance(arg) :
@@ -336,10 +336,10 @@
         return true;
     }
 
-    private static boolean checkMultipleArgument(final RiResolvedMethod method, RiSignature signature, int i, String name, Object multiple) {
+    private static boolean checkMultipleArgument(final ResolvedJavaMethod method, Signature signature, int i, String name, Object multiple) {
         assert multiple instanceof Multiple;
         Object arg = ((Multiple) multiple).array;
-        RiResolvedType type = (RiResolvedType) signature.argumentTypeAt(i, method.holder());
+        ResolvedJavaType type = (ResolvedJavaType) signature.argumentTypeAt(i, method.holder());
         Class< ? > javaType = type.toJava();
         assert javaType.isArray() : "multiple parameter must be an array type";
         assert javaType.isInstance(arg) : "value for " + name + " is not a " + javaType.getName() + " instance: " + arg;
@@ -372,7 +372,7 @@
      *
      * @return the map that will be used to bind arguments to parameters when inlining this template
      */
-    private IdentityHashMap<Node, Node> bind(StructuredGraph replaceeGraph, RiRuntime runtime, SnippetTemplate.Arguments args) {
+    private IdentityHashMap<Node, Node> bind(StructuredGraph replaceeGraph, CodeCacheProvider runtime, SnippetTemplate.Arguments args) {
         IdentityHashMap<Node, Node> replacements = new IdentityHashMap<>();
 
         for (Map.Entry<String, Object> e : args) {
@@ -415,7 +415,7 @@
      * @param anchor the control flow replacee
      * @param args the arguments to be bound to the flattened positional parameters of the snippet
      */
-    public void instantiate(RiRuntime runtime,
+    public void instantiate(CodeCacheProvider runtime,
                     Node replacee,
                     FixedWithNextNode anchor, SnippetTemplate.Arguments args) {
 
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippets.java	Sat Jun 09 16:52:12 2012 +0200
@@ -61,7 +61,7 @@
                 if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) {
                     throw new RuntimeException("Snippet must not be abstract or native");
                 }
-                RiResolvedMethod snippetRiMethod = runtime.getRiMethod(snippet);
+                ResolvedJavaMethod snippetRiMethod = runtime.getResolvedJavaMethod(snippet);
                 if (snippetRiMethod.compilerStorage().get(Graph.class) == null) {
                     buildSnippetGraph(snippetRiMethod, runtime, target, pool);
                 }
@@ -81,16 +81,16 @@
                 if (Modifier.isAbstract(modifiers) || Modifier.isNative(modifiers)) {
                     throw new RuntimeException("Snippet must not be abstract or native");
                 }
-                RiResolvedMethod snippetRiMethod = runtime.getRiMethod(snippet);
+                ResolvedJavaMethod snippetRiMethod = runtime.getResolvedJavaMethod(snippet);
                 StructuredGraph graph = buildSnippetGraph(snippetRiMethod, runtime, target, pool);
-                runtime.getRiMethod(method).compilerStorage().put(Graph.class, graph);
+                runtime.getResolvedJavaMethod(method).compilerStorage().put(Graph.class, graph);
             } catch (NoSuchMethodException e) {
                 throw new RuntimeException("Could not resolve method to substitute with: " + snippet.getName(), e);
             }
         }
     }
 
-    private static StructuredGraph buildSnippetGraph(final RiResolvedMethod snippetRiMethod, final ExtendedRiRuntime runtime, final CiTarget target, final BoxingMethodPool pool) {
+    private static StructuredGraph buildSnippetGraph(final ResolvedJavaMethod snippetRiMethod, final ExtendedRiRuntime runtime, final CiTarget target, final BoxingMethodPool pool) {
         final StructuredGraph graph = new StructuredGraph(snippetRiMethod);
         return Debug.scope("BuildSnippetGraph", new Object[] {snippetRiMethod, graph}, new Callable<StructuredGraph>() {
             @Override
@@ -105,8 +105,8 @@
 
                 for (Invoke invoke : graph.getInvokes()) {
                     MethodCallTargetNode callTarget = invoke.callTarget();
-                    RiResolvedMethod targetMethod = callTarget.targetMethod();
-                    RiResolvedType holder = targetMethod.holder();
+                    ResolvedJavaMethod targetMethod = callTarget.targetMethod();
+                    ResolvedJavaType holder = targetMethod.holder();
                     if (enclosedInSnippetsClass(holder)) {
                         StructuredGraph targetGraph = (StructuredGraph) targetMethod.compilerStorage().get(Graph.class);
                         if (targetGraph == null) {
@@ -140,7 +140,7 @@
                 return graph;
             }
 
-            private boolean enclosedInSnippetsClass(RiResolvedType holder) {
+            private boolean enclosedInSnippetsClass(ResolvedJavaType holder) {
                 Class enclosingClass = holder.toJava();
                 while (enclosingClass != null) {
                     if (SnippetsInterface.class.isAssignableFrom(enclosingClass)) {
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CheckCastTest.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CheckCastTest.java	Sat Jun 09 16:52:12 2012 +0200
@@ -40,10 +40,10 @@
     boolean unknown;
 
     @Override
-    protected void replaceProfile(StructuredGraph graph, RiTypeProfile profile) {
+    protected void replaceProfile(StructuredGraph graph, JavaTypeProfile profile) {
         CheckCastNode ccn = graph.getNodes(CheckCastNode.class).first();
         if (ccn != null) {
-            RiResolvedType targetClass = unknown ? null : ccn.targetClass();
+            ResolvedJavaType targetClass = unknown ? null : ccn.targetClass();
             CheckCastNode ccnNew = graph.add(new CheckCastNode(ccn.targetClassInstruction(), targetClass, ccn.object(), profile));
             graph.replaceFixedWithFixed(ccn, ccnNew);
         }
@@ -51,7 +51,7 @@
     }
 
     @Override
-    protected void test(String name, RiTypeProfile profile, Object... args) {
+    protected void test(String name, JavaTypeProfile profile, Object... args) {
         super.test(name, profile, args);
         unknown = true;
         super.test(name, profile, args);
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java	Sat Jun 09 16:52:12 2012 +0200
@@ -66,7 +66,7 @@
             }
         }
 
-        final RiResolvedMethod riMethod = runtime.getRiMethod(method);
+        final ResolvedJavaMethod riMethod = runtime.getResolvedJavaMethod(method);
         InstalledCode compiledMethod = compile(riMethod, graph);
         try {
             Object result = compiledMethod.execute("1", "2", "3");
@@ -80,7 +80,7 @@
     public void test3() {
         Method method = getMethod("testMethod");
         final StructuredGraph graph = parse(method);
-        final RiResolvedMethod riMethod = runtime.getRiMethod(method);
+        final ResolvedJavaMethod riMethod = runtime.getResolvedJavaMethod(method);
         InstalledCode compiledMethod = compile(riMethod, graph);
         try {
             Object result = compiledMethod.executeVarargs("1", "2", "3");
@@ -94,7 +94,7 @@
     public void test4() {
         Method method = getMethod("testMethodVirtual");
         final StructuredGraph graph = parse(method);
-        final RiResolvedMethod riMethod = runtime.getRiMethod(method);
+        final ResolvedJavaMethod riMethod = runtime.getResolvedJavaMethod(method);
         InstalledCode compiledMethod = compile(riMethod, graph);
         try {
             f1 = "0";
@@ -108,7 +108,7 @@
     @Test
     public void test2() throws NoSuchMethodException, SecurityException {
         Method method = CompilableObjectImpl.class.getDeclaredMethod("executeHelper", ObjectCompiler.class, String.class);
-        RiResolvedMethod riMethod = runtime.getRiMethod(method);
+        ResolvedJavaMethod riMethod = runtime.getResolvedJavaMethod(method);
         StructuredGraph graph = new StructuredGraph(riMethod);
         new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault(), OptimisticOptimizations.NONE).apply(graph);
         new CanonicalizerPhase(null, runtime, null).apply(graph);
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Sat Jun 09 16:52:12 2012 +0200
@@ -147,7 +147,7 @@
 
     private static int compilationId = 0;
 
-    protected InstalledCode compile(final RiResolvedMethod method, final StructuredGraph graph) {
+    protected InstalledCode compile(final ResolvedJavaMethod method, final StructuredGraph graph) {
         return Debug.scope("Compiling", new DebugDumpScope(String.valueOf(compilationId++), true), new Callable<InstalledCode>() {
             public InstalledCode call() throws Exception {
                 CiTargetMethod targetMethod = runtime.compile(method, graph);
@@ -156,7 +156,7 @@
         });
     }
 
-    protected InstalledCode addMethod(final RiResolvedMethod method, final CiTargetMethod tm) {
+    protected InstalledCode addMethod(final ResolvedJavaMethod method, final CiTargetMethod tm) {
         return Debug.scope("CodeInstall", new Object[] {method}, new Callable<InstalledCode>() {
             @Override
             public InstalledCode call() throws Exception {
@@ -183,7 +183,7 @@
      * Parses a Java method to produce a graph.
      */
     protected StructuredGraph parse(Method m) {
-        RiResolvedMethod riMethod = runtime.getRiMethod(m);
+        ResolvedJavaMethod riMethod = runtime.getResolvedJavaMethod(m);
         StructuredGraph graph = new StructuredGraph(riMethod);
         new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getSnippetDefault(), OptimisticOptimizations.ALL).apply(graph);
         return graph;
@@ -193,7 +193,7 @@
      * Parses a Java method to produce a graph.
      */
     protected StructuredGraph parseProfiled(Method m) {
-        RiResolvedMethod riMethod = runtime.getRiMethod(m);
+        ResolvedJavaMethod riMethod = runtime.getResolvedJavaMethod(m);
         StructuredGraph graph = new StructuredGraph(riMethod);
         new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.ALL).apply(graph);
         return graph;
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InstanceOfTest.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/InstanceOfTest.java	Sat Jun 09 16:52:12 2012 +0200
@@ -37,7 +37,7 @@
 public class InstanceOfTest extends TypeCheckTest {
 
     @Override
-    protected void replaceProfile(StructuredGraph graph, RiTypeProfile profile) {
+    protected void replaceProfile(StructuredGraph graph, JavaTypeProfile profile) {
         InstanceOfNode ion = graph.getNodes().filter(InstanceOfNode.class).first();
         if (ion != null) {
             InstanceOfNode ionNew = graph.add(new InstanceOfNode(ion.targetClassInstruction(), ion.targetClass(), ion.object(), profile));
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeCheckTest.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeCheckTest.java	Sat Jun 09 16:52:12 2012 +0200
@@ -27,7 +27,7 @@
 import org.junit.*;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiTypeProfile.*;
+import com.oracle.graal.api.meta.JavaTypeProfile.*;
 import com.oracle.graal.nodes.*;
 
 /**
@@ -35,26 +35,26 @@
  */
 public abstract class TypeCheckTest extends GraphTest {
 
-    protected abstract void replaceProfile(StructuredGraph graph, RiTypeProfile profile);
+    protected abstract void replaceProfile(StructuredGraph graph, JavaTypeProfile profile);
 
-    private InstalledCode compile(Method method, RiTypeProfile profile) {
+    private InstalledCode compile(Method method, JavaTypeProfile profile) {
         final StructuredGraph graph = parse(method);
         replaceProfile(graph, profile);
-        return compile(runtime.getRiMethod(method), graph);
+        return compile(runtime.getResolvedJavaMethod(method), graph);
     }
 
-    protected RiTypeProfile profile(Class... types) {
+    protected JavaTypeProfile profile(Class... types) {
         if (types.length == 0) {
             return null;
         }
         ProfiledType[] ptypes = new ProfiledType[types.length];
         for (int i = 0; i < types.length; i++) {
-            ptypes[i] = new ProfiledType(runtime.getType(types[i]), 1.0D / types.length);
+            ptypes[i] = new ProfiledType(runtime.getResolvedJavaType(types[i]), 1.0D / types.length);
         }
-        return new RiTypeProfile(0.0D, ptypes);
+        return new JavaTypeProfile(0.0D, ptypes);
     }
 
-    protected void test(String name, RiTypeProfile profile, Object... args) {
+    protected void test(String name, JavaTypeProfile profile, Object... args) {
         Method method = getMethod(name);
         Object expect = null;
         Throwable exception = null;
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/RiXirGenerator.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/RiXirGenerator.java	Sat Jun 09 16:52:12 2012 +0200
@@ -23,36 +23,36 @@
 package com.oracle.max.cri.xir;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiType.*;
+import com.oracle.graal.api.meta.JavaType.*;
 
 /**
  * Represents the interface through which the compiler requests the XIR for a given bytecode from the runtime system.
  */
 public interface RiXirGenerator {
 
-    XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, RiMethod method);
+    XirSnippet genInvokeInterface(XirSite site, XirArgument receiver, JavaMethod method);
 
-    XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, RiMethod method, boolean megamorph);
+    XirSnippet genInvokeVirtual(XirSite site, XirArgument receiver, JavaMethod method, boolean megamorph);
 
-    XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, RiMethod method);
+    XirSnippet genInvokeSpecial(XirSite site, XirArgument receiver, JavaMethod method);
 
-    XirSnippet genInvokeStatic(XirSite site, RiMethod method);
+    XirSnippet genInvokeStatic(XirSite site, JavaMethod method);
 
     XirSnippet genMonitorEnter(XirSite site, XirArgument receiver, XirArgument lockAddress);
 
     XirSnippet genMonitorExit(XirSite site, XirArgument receiver, XirArgument lockAddress);
 
-    XirSnippet genNewInstance(XirSite site, RiType type);
+    XirSnippet genNewInstance(XirSite site, JavaType type);
 
-    XirSnippet genNewArray(XirSite site, XirArgument length, Kind elementKind, RiType componentType, RiType arrayType);
+    XirSnippet genNewArray(XirSite site, XirArgument length, Kind elementKind, JavaType componentType, JavaType arrayType);
 
-    XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, RiType type);
+    XirSnippet genNewMultiArray(XirSite site, XirArgument[] lengths, JavaType type);
 
-    XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, RiResolvedType type, RiTypeProfile profile);
+    XirSnippet genCheckCast(XirSite site, XirArgument receiver, XirArgument hub, ResolvedJavaType type, JavaTypeProfile profile);
 
-    XirSnippet genInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, RiResolvedType type, RiTypeProfile profile);
+    XirSnippet genInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, ResolvedJavaType type, JavaTypeProfile profile);
 
-    XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, XirArgument trueValue, XirArgument falseValue, RiResolvedType type, RiTypeProfile profile);
+    XirSnippet genMaterializeInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, XirArgument trueValue, XirArgument falseValue, ResolvedJavaType type, JavaTypeProfile profile);
 
     /**
      * Generates code that checks that the {@linkplain Representation#ObjectHub hub} of
@@ -64,7 +64,7 @@
      * </pre>
      * This snippet should only be used when the object is guaranteed not to be null.
      */
-    XirSnippet genTypeBranch(XirSite site, XirArgument thisHub, XirArgument otherHub, RiType type);
+    XirSnippet genTypeBranch(XirSite site, XirArgument thisHub, XirArgument otherHub, JavaType type);
 
     /**
      * Initializes the XIR generator for the given XIR assembler.
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseProfilingInfo.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseProfilingInfo.java	Sat Jun 09 16:52:12 2012 +0200
@@ -30,16 +30,16 @@
  * Dummy profiling information in case that a method was not executed frequently enough so that
  * no profiling information does exist yet, or in case that the profiling information should not be used.
  */
-public final class BaseProfilingInfo implements RiProfilingInfo {
-    private static final RiProfilingInfo[] NO_PROFILING_INFO = new RiProfilingInfo[] {
-        new BaseProfilingInfo(RiExceptionSeen.TRUE),
-        new BaseProfilingInfo(RiExceptionSeen.FALSE),
-        new BaseProfilingInfo(RiExceptionSeen.NOT_SUPPORTED)
+public final class BaseProfilingInfo implements ProfilingInfo {
+    private static final ProfilingInfo[] NO_PROFILING_INFO = new ProfilingInfo[] {
+        new BaseProfilingInfo(ExceptionSeen.TRUE),
+        new BaseProfilingInfo(ExceptionSeen.FALSE),
+        new BaseProfilingInfo(ExceptionSeen.NOT_SUPPORTED)
     };
 
-    private final RiExceptionSeen exceptionSeen;
+    private final ExceptionSeen exceptionSeen;
 
-    BaseProfilingInfo(RiExceptionSeen exceptionSeen) {
+    BaseProfilingInfo(ExceptionSeen exceptionSeen) {
         this.exceptionSeen = exceptionSeen;
     }
 
@@ -49,7 +49,7 @@
     }
 
     @Override
-    public RiTypeProfile getTypeProfile(int bci) {
+    public JavaTypeProfile getTypeProfile(int bci) {
         return null;
     }
 
@@ -64,7 +64,7 @@
     }
 
     @Override
-    public RiExceptionSeen getExceptionSeen(int bci) {
+    public ExceptionSeen getExceptionSeen(int bci) {
         return exceptionSeen;
     }
 
@@ -73,12 +73,12 @@
         return -1;
     }
 
-    public static RiProfilingInfo get(RiExceptionSeen exceptionSeen) {
+    public static ProfilingInfo get(ExceptionSeen exceptionSeen) {
         return NO_PROFILING_INFO[exceptionSeen.ordinal()];
     }
 
     @Override
-    public int getDeoptimizationCount(RiDeoptReason reason) {
+    public int getDeoptimizationCount(DeoptimizationReason reason) {
         return 0;
     }
 
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedField.java	Sat Jun 09 16:52:12 2012 +0200
@@ -26,15 +26,15 @@
 import com.oracle.graal.api.meta.*;
 
 /**
- * A implementation of {@link RiField} for an unresolved field.
+ * A implementation of {@link JavaField} for an unresolved field.
  */
-public class BaseUnresolvedField implements RiField {
+public class BaseUnresolvedField implements JavaField {
 
     public final String name;
-    public final RiType holder;
-    public final RiType type;
+    public final JavaType holder;
+    public final JavaType type;
 
-    public BaseUnresolvedField(RiType holder, String name, RiType type) {
+    public BaseUnresolvedField(JavaType holder, String name, JavaType type) {
         this.name = name;
         this.type = type;
         this.holder = holder;
@@ -44,7 +44,7 @@
         return name;
     }
 
-    public RiType type() {
+    public JavaType type() {
         return type;
     }
 
@@ -52,7 +52,7 @@
         return type.kind();
     }
 
-    public RiType holder() {
+    public JavaType holder() {
         return holder;
     }
 
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/BaseUnresolvedMethod.java	Sat Jun 09 16:52:12 2012 +0200
@@ -26,15 +26,15 @@
 import com.oracle.graal.api.meta.*;
 
 /**
- * A implementation of {@link RiMethod} for an unresolved method.
+ * A implementation of {@link JavaMethod} for an unresolved method.
  */
-public class BaseUnresolvedMethod implements RiMethod {
+public class BaseUnresolvedMethod implements JavaMethod {
 
     public final String name;
-    public final RiType holder;
-    public final RiSignature signature;
+    public final JavaType holder;
+    public final Signature signature;
 
-    public BaseUnresolvedMethod(RiType holder, String name, RiSignature signature) {
+    public BaseUnresolvedMethod(JavaType holder, String name, Signature signature) {
         this.name = name;
         this.holder = holder;
         this.signature = signature;
@@ -44,11 +44,11 @@
         return name;
     }
 
-    public RiType holder() {
+    public JavaType holder() {
         return holder;
     }
 
-    public RiSignature signature() {
+    public Signature signature() {
         return signature;
     }
 
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/CompilationPrinter.java	Sat Jun 09 16:52:12 2012 +0200
@@ -95,7 +95,7 @@
      *
      * @param method the method for which a timestamp will be printed
      */
-    public void printCompilation(RiMethod method) {
+    public void printCompilation(JavaMethod method) {
         begin("compilation");
         out.print("name \" ").print(CiUtil.format("%H::%n", method)).println('"');
         out.print("method \"").print(CiUtil.format("%f %r %H.%n(%p)", method)).println('"');
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/JniMangle.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/JniMangle.java	Sat Jun 09 16:52:12 2012 +0200
@@ -78,9 +78,9 @@
      * @param splitSuffix determines if {@link #LONG_NAME_DELIMITER} should be used as described above
      * @return the symbol for the C function as described above
      */
-    public static String mangleMethod(RiResolvedType declaringClass, String name, RiSignature signature, boolean splitSuffix) {
+    public static String mangleMethod(ResolvedJavaType declaringClass, String name, Signature signature, boolean splitSuffix) {
         final StringBuilder result = new StringBuilder(100);
-        final String declaringClassName = RiUtil.toJavaName(declaringClass);
+        final String declaringClassName = MetaUtil.toJavaName(declaringClass);
         result.append("Java_").append(mangle(declaringClassName)).append('_').append(mangle(name));
         if (signature != null) {
             if (splitSuffix) {
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/SnapshotProfilingInfo.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/SnapshotProfilingInfo.java	Sat Jun 09 16:52:12 2012 +0200
@@ -29,26 +29,26 @@
 
 /**
  * A profiling info snapshot that can be {@linkplain #save(File, File) saved} to
- * and {@linkplain #load(File, RiRuntime) loaded} from a file.
+ * and {@linkplain #load(File, CodeCacheProvider) loaded} from a file.
  */
-public class SnapshotProfilingInfo implements RiProfilingInfo, Serializable {
+public class SnapshotProfilingInfo implements ProfilingInfo, Serializable {
 
     private static final long serialVersionUID = -5837615128782960391L;
     private final double[] branchTaken;
     private final double[][] switches;
-    private final RiTypeProfile[] typeProfiles;
-    private final RiExceptionSeen[] exceptions;
+    private final JavaTypeProfile[] typeProfiles;
+    private final ExceptionSeen[] exceptions;
     private final int[] executions;
     private final int[] deopts;
 
-    public SnapshotProfilingInfo(RiProfilingInfo other) {
+    public SnapshotProfilingInfo(ProfilingInfo other) {
         int codeSize = other.codeSize();
         branchTaken = new double[codeSize];
         switches = new double[codeSize][];
-        typeProfiles = new RiTypeProfile[codeSize];
-        exceptions = new RiExceptionSeen[codeSize];
+        typeProfiles = new JavaTypeProfile[codeSize];
+        exceptions = new ExceptionSeen[codeSize];
         executions = new int[codeSize];
-        deopts = new int[RiDeoptReason.values().length];
+        deopts = new int[DeoptimizationReason.values().length];
 
         for (int bci = 0; bci < codeSize; bci++) {
             executions[bci] = other.getExecutionCount(bci);
@@ -57,7 +57,7 @@
             switches[bci] = other.getSwitchProbabilities(bci);
             typeProfiles[bci] = other.getTypeProfile(bci);
         }
-        for (RiDeoptReason reason: RiDeoptReason.values()) {
+        for (DeoptimizationReason reason: DeoptimizationReason.values()) {
             deopts[reason.ordinal()] = other.getDeoptimizationCount(reason);
         }
     }
@@ -73,16 +73,16 @@
     public double[] getSwitchProbabilities(int bci) {
         return bci < switches.length ? switches[bci] : null;
     }
-    public RiTypeProfile getTypeProfile(int bci) {
+    public JavaTypeProfile getTypeProfile(int bci) {
         return bci < typeProfiles.length ? typeProfiles[bci] : null;
     }
-    public RiExceptionSeen getExceptionSeen(int bci) {
-        return bci < exceptions.length ? exceptions[bci] : RiExceptionSeen.NOT_SUPPORTED;
+    public ExceptionSeen getExceptionSeen(int bci) {
+        return bci < exceptions.length ? exceptions[bci] : ExceptionSeen.NOT_SUPPORTED;
     }
     public int getExecutionCount(int bci) {
         return bci < executions.length ? executions[bci] : -1;
     }
-    public int getDeoptimizationCount(RiDeoptReason reason) {
+    public int getDeoptimizationCount(DeoptimizationReason reason) {
         return deopts[reason.ordinal()];
     }
 
@@ -95,12 +95,12 @@
      * Deserializes a profile snapshot from a file.
      *
      * @param file a file created by {@link #save(File, File)}
-     * @param runtime the runtime used to resolve {@link RiResolvedType}s during deserialization
+     * @param runtime the runtime used to resolve {@link ResolvedJavaType}s during deserialization
      * @return
      * @throws ClassNotFoundException
      * @throws IOException
      */
-    public static SnapshotProfilingInfo load(File file, RiRuntime runtime) throws ClassNotFoundException, IOException {
+    public static SnapshotProfilingInfo load(File file, CodeCacheProvider runtime) throws ClassNotFoundException, IOException {
         SnapshotProfilingInfo.SnapshotObjectInputStream ois = new SnapshotObjectInputStream(new BufferedInputStream(new FileInputStream(file), (int) file.length()), runtime);
         try {
             return (SnapshotProfilingInfo) ois.readObject();
@@ -149,16 +149,16 @@
 
         @Override
         protected Object replaceObject(Object obj) throws IOException {
-            if (obj instanceof RiResolvedType) {
-                return new RiResolvedTypePlaceholder(((RiResolvedType) obj).toJava());
+            if (obj instanceof ResolvedJavaType) {
+                return new RiResolvedTypePlaceholder(((ResolvedJavaType) obj).toJava());
             }
             return obj;
         }
     }
 
     static class SnapshotObjectInputStream extends ObjectInputStream {
-        private final RiRuntime runtime;
-        public SnapshotObjectInputStream(InputStream in, RiRuntime runtime) throws IOException {
+        private final CodeCacheProvider runtime;
+        public SnapshotObjectInputStream(InputStream in, CodeCacheProvider runtime) throws IOException {
             super(in);
             enableResolveObject(true);
             this.runtime = runtime;
@@ -167,7 +167,7 @@
         @Override
         protected Object resolveObject(Object obj) throws IOException {
             if (obj instanceof SnapshotProfilingInfo.RiResolvedTypePlaceholder) {
-                RiResolvedType type = runtime.getType(((SnapshotProfilingInfo.RiResolvedTypePlaceholder) obj).javaMirror);
+                ResolvedJavaType type = runtime.getResolvedJavaType(((SnapshotProfilingInfo.RiResolvedTypePlaceholder) obj).javaMirror);
                 return type;
             }
             return obj;
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TypeCheckHints.java	Fri Jun 08 23:47:42 2012 +0200
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/TypeCheckHints.java	Sat Jun 09 16:52:12 2012 +0200
@@ -27,7 +27,7 @@
 
 import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiTypeProfile.*;
+import com.oracle.graal.api.meta.JavaTypeProfile.*;
 
 /**
  * Utility for deriving hint types for a type check instruction (e.g. checkcast or instanceof)
@@ -35,7 +35,7 @@
  */
 public class TypeCheckHints {
 
-    private static final RiResolvedType[] NO_TYPES = {};
+    private static final ResolvedJavaType[] NO_TYPES = {};
 
     /**
      * If true, then {@link #types} contains the only possible type that could pass the type check
@@ -46,7 +46,7 @@
     /**
      * The most likely types that the type check instruction will see.
      */
-    public final RiResolvedType[] types;
+    public final ResolvedJavaType[] types;
 
     /**
      * Derives hint information for use when generating the code for a type check instruction.
@@ -58,14 +58,14 @@
      *            {@code maxHints}) is below this value, then {@link #types} will be null
      * @param maxHints the maximum length of {@link #types}
      */
-    public TypeCheckHints(RiResolvedType type, RiTypeProfile profile, CiAssumptions assumptions, double minHintHitProbability, int maxHints) {
+    public TypeCheckHints(ResolvedJavaType type, JavaTypeProfile profile, CiAssumptions assumptions, double minHintHitProbability, int maxHints) {
         if (type != null && isFinalClass(type)) {
-            types = new RiResolvedType[] {type};
+            types = new ResolvedJavaType[] {type};
             exact = true;
         } else {
-            RiResolvedType uniqueSubtype = type == null ? null : type.uniqueConcreteSubtype();
+            ResolvedJavaType uniqueSubtype = type == null ? null : type.uniqueConcreteSubtype();
             if (uniqueSubtype != null) {
-                types = new RiResolvedType[] {uniqueSubtype};
+                types = new ResolvedJavaType[] {uniqueSubtype};
                 if (assumptions != null) {
                     assumptions.recordConcreteSubtype(type, uniqueSubtype);
                     exact = true;
@@ -74,17 +74,17 @@
                 }
             } else {
                 exact = false;
-                RiResolvedType[] hintTypes = NO_TYPES;
-                RiTypeProfile typeProfile = profile;
+                ResolvedJavaType[] hintTypes = NO_TYPES;
+                JavaTypeProfile typeProfile = profile;
                 if (typeProfile != null) {
                     double notRecordedTypes = typeProfile.getNotRecordedProbability();
                     ProfiledType[] ptypes = typeProfile.getTypes();
                     if (notRecordedTypes < (1D - minHintHitProbability) && ptypes != null && ptypes.length > 0) {
-                        hintTypes = new RiResolvedType[ptypes.length];
+                        hintTypes = new ResolvedJavaType[ptypes.length];
                         int hintCount = 0;
                         double totalHintProbability = 0.0d;
                         for (ProfiledType ptype : ptypes) {
-                            RiResolvedType hint = ptype.type;
+                            ResolvedJavaType hint = ptype.type;
                             if (type != null && hint.isSubtypeOf(type)) {
                                 hintTypes[hintCount++] = hint;
                                 totalHintProbability += ptype.probability;
@@ -105,7 +105,7 @@
         }
     }
 
-    public static boolean isFinalClass(RiResolvedType type) {
+    public static boolean isFinalClass(ResolvedJavaType type) {
         return Modifier.isFinal(type.accessFlags()) || (type.isArrayClass() && Modifier.isFinal(type.componentType().accessFlags()));
     }
 }
--- a/src/share/vm/classfile/vmSymbols.hpp	Fri Jun 08 23:47:42 2012 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Sat Jun 09 16:52:12 2012 +0200
@@ -283,11 +283,11 @@
   template(com_oracle_graal_hotspot_HotSpotExceptionHandler,      "com/oracle/graal/hotspot/ri/HotSpotExceptionHandler")          \
   template(com_oracle_graal_hotspot_HotSpotProxy,                 "com/oracle/graal/hotspot/HotSpotProxy")                        \
   template(com_oracle_graal_hotspot_CompilerImpl,                 "com/oracle/graal/hotspot/HotSpotGraalRuntime")                        \
-  template(com_oracle_max_cri_ri_RiMethod,                            "com/oracle/graal/api/meta/RiMethod")                                   \
-  template(com_oracle_max_cri_ri_RiResolvedField,                     "com/oracle/graal/api/meta/RiResolvedField")                            \
-  template(com_oracle_max_cri_ri_RiType,                              "com/oracle/graal/api/meta/RiType")                                     \
-  template(com_oracle_max_cri_ri_RiConstantPool,                      "com/oracle/graal/api/meta/RiConstantPool")                             \
-  template(com_oracle_max_cri_ri_RiExceptionHandler,                  "com/oracle/graal/api/meta/RiExceptionHandler")                         \
+  template(com_oracle_max_cri_ri_RiMethod,                            "com/oracle/graal/api/meta/JavaMethod")                                   \
+  template(com_oracle_max_cri_ri_RiResolvedField,                     "com/oracle/graal/api/meta/ResolvedJavaField")                            \
+  template(com_oracle_max_cri_ri_RiType,                              "com/oracle/graal/api/meta/JavaType")                                     \
+  template(com_oracle_max_cri_ri_RiConstantPool,                      "com/oracle/graal/api/meta/ConstantPool")                             \
+  template(com_oracle_max_cri_ri_RiExceptionHandler,                  "com/oracle/graal/api/meta/ExceptionHandler")                         \
   template(com_oracle_max_cri_ci_CiAssumptions,                       "com/oracle/graal/api/code/CiAssumptions")                              \
   template(com_oracle_max_cri_ci_CiAssumptions_MethodContents,        "com/oracle/graal/api/code/CiAssumptions$MethodContents")               \
   template(com_oracle_max_cri_ci_CiAssumptions_ConcreteSubtype,       "com/oracle/graal/api/code/CiAssumptions$ConcreteSubtype")              \
@@ -300,7 +300,6 @@
   template(com_oracle_max_cri_ci_CiTargetMethod_Safepoint,            "com/oracle/graal/api/code/CiTargetMethod$Safepoint")                   \
   template(com_oracle_max_cri_ci_CiTargetMethod_ExceptionHandler,     "com/oracle/graal/api/code/CiTargetMethod$ExceptionHandler")            \
   template(com_oracle_max_cri_ci_CiTargetMethod_Mark,                 "com/oracle/graal/api/code/CiTargetMethod$Mark")                        \
-  template(com_oracle_graal_graph_BitMap,                         "com/oracle/graal/graph/BitMap")                                \
   template(com_oracle_max_cri_ci_CiBitMap,	                          "com/oracle/graal/api/code/CiBitMap")                                   \
   template(com_oracle_max_cri_ci_CiDebugInfo,                         "com/oracle/graal/api/code/CiDebugInfo")                                \
   template(com_oracle_max_cri_ci_CiFrame,                             "com/oracle/graal/api/code/CiFrame")                                    \
@@ -323,19 +322,19 @@
   template(setDefaultOptions_name,                    "setDefaultOptions")                                              \
   template(setOption_signature,                       "(Ljava/lang/String;)Z")                                          \
   template(createRiMethodResolved_name,               "createRiMethodResolved")                                         \
-  template(createRiMethodResolved_signature,          "(JLjava/lang/String;)Lcom/oracle/graal/api/meta/RiMethod;")          \
+  template(createRiMethodResolved_signature,          "(JLjava/lang/String;)Lcom/oracle/graal/api/meta/JavaMethod;")          \
   template(createRiMethodUnresolved_name,             "createRiMethodUnresolved")                                       \
-  template(createRiMethodUnresolved_signature,        "(Ljava/lang/String;Ljava/lang/String;Lcom/oracle/graal/api/meta/RiType;)Lcom/oracle/graal/api/meta/RiMethod;") \
+  template(createRiMethodUnresolved_signature,        "(Ljava/lang/String;Ljava/lang/String;Lcom/oracle/graal/api/meta/JavaType;)Lcom/oracle/graal/api/meta/JavaMethod;") \
   template(createRiSignature_name,                    "createRiSignature")                                              \
-  template(createRiSignature_signature,               "(Ljava/lang/String;)Lcom/oracle/graal/api/meta/RiSignature;")        \
+  template(createRiSignature_signature,               "(Ljava/lang/String;)Lcom/oracle/graal/api/meta/Signature;")        \
   template(createRiField_name,                        "createRiField")                                                  \
-  template(createRiField_signature,                   "(Lcom/oracle/graal/api/meta/RiType;Ljava/lang/String;Lcom/oracle/graal/api/meta/RiType;II)Lcom/oracle/graal/api/meta/RiField;") \
+  template(createRiField_signature,                   "(Lcom/oracle/graal/api/meta/JavaType;Ljava/lang/String;Lcom/oracle/graal/api/meta/JavaType;II)Lcom/oracle/graal/api/meta/JavaField;") \
   template(createRiType_name,                         "createRiType")                                                   \
-  template(createRiType_signature,                    "(JLjava/lang/String;)Lcom/oracle/graal/api/meta/RiType;")            \
+  template(createRiType_signature,                    "(JLjava/lang/String;)Lcom/oracle/graal/api/meta/JavaType;")            \
   template(createRiTypePrimitive_name,                "createRiTypePrimitive")                                          \
-  template(createRiTypePrimitive_signature,           "(I)Lcom/oracle/graal/api/meta/RiType;")                              \
+  template(createRiTypePrimitive_signature,           "(I)Lcom/oracle/graal/api/meta/JavaType;")                              \
   template(createRiTypeUnresolved_name,               "createRiTypeUnresolved")                                         \
-  template(createRiTypeUnresolved_signature,          "(Ljava/lang/String;)Lcom/oracle/graal/api/meta/RiType;")             \
+  template(createRiTypeUnresolved_signature,          "(Ljava/lang/String;)Lcom/oracle/graal/api/meta/JavaType;")             \
   template(createCiConstant_name,                     "createCiConstant")                                               \
   template(createCiConstant_signature,                "(Lcom/oracle/graal/api/meta/Kind;J)Lcom/oracle/graal/api/meta/Constant;") \
   template(createCiConstantFloat_name,                "createCiConstantFloat")                                          \
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Fri Jun 08 23:47:42 2012 +0200
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Sat Jun 09 16:52:12 2012 +0200
@@ -667,7 +667,7 @@
   return JNIHandles::make_local(THREAD, GraalCompiler::createHotSpotTypeResolved(arr, name, THREAD)());
 }
 
-// public RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
+// public ResolvedJavaField[] RiType_fields(HotSpotTypeResolved klass);
 JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_RiType_1fields(JNIEnv *, jobject, jobject klass) {
   TRACE_graal_3("CompilerToVM::RiType_fields");
   VM_ENTRY_MARK;
@@ -1121,16 +1121,16 @@
 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(Java_com_oracle_graal_hotspot_bridge_CompilerToVMImpl_##f))
 
 #define PROXY           "J"
-#define TYPE            "Lcom/oracle/graal/api/meta/RiType;"
+#define TYPE            "Lcom/oracle/graal/api/meta/JavaType;"
 #define RESOLVED_TYPE   "Lcom/oracle/graal/hotspot/ri/HotSpotTypeResolved;"
-#define METHOD          "Lcom/oracle/graal/api/meta/RiMethod;"
+#define METHOD          "Lcom/oracle/graal/api/meta/JavaMethod;"
 #define RESOLVED_METHOD "Lcom/oracle/graal/hotspot/ri/HotSpotMethodResolved;"
 #define REFLECT_METHOD  "Ljava/lang/reflect/Method;"
-#define SIGNATURE       "Lcom/oracle/graal/api/meta/RiSignature;"
-#define FIELD           "Lcom/oracle/graal/api/meta/RiField;"
-#define RESOLVED_FIELD  "Lcom/oracle/graal/api/meta/RiResolvedField;"
-#define CONSTANT_POOL   "Lcom/oracle/graal/api/meta/RiConstantPool;"
-#define EXCEPTION_HANDLERS "[Lcom/oracle/graal/api/meta/RiExceptionHandler;"
+#define SIGNATURE       "Lcom/oracle/graal/api/meta/Signature;"
+#define FIELD           "Lcom/oracle/graal/api/meta/JavaField;"
+#define RESOLVED_FIELD  "Lcom/oracle/graal/api/meta/ResolvedJavaField;"
+#define CONSTANT_POOL   "Lcom/oracle/graal/api/meta/ConstantPool;"
+#define EXCEPTION_HANDLERS "[Lcom/oracle/graal/api/meta/ExceptionHandler;"
 #define TARGET_METHOD   "Lcom/oracle/graal/hotspot/HotSpotTargetMethod;"
 #define CONFIG          "Lcom/oracle/graal/hotspot/HotSpotVMConfig;"
 #define HS_METHOD       "Lcom/oracle/graal/hotspot/ri/HotSpotMethod;"
--- a/src/share/vm/graal/graalJavaAccess.hpp	Fri Jun 08 23:47:42 2012 +0200
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Sat Jun 09 16:52:12 2012 +0200
@@ -63,7 +63,7 @@
     end_class                                                                           \
   start_class(HotSpotMethodResolved)                                                    \
     oop_field(HotSpotMethodResolved, name, "Ljava/lang/String;")                        \
-    oop_field(HotSpotMethodResolved, holder, "Lcom/oracle/graal/api/meta/RiResolvedType;")  \
+    oop_field(HotSpotMethodResolved, holder, "Lcom/oracle/graal/api/meta/ResolvedJavaType;")  \
     oop_field(HotSpotMethodResolved, javaMirror, "Ljava/lang/Object;")                  \
     int_field(HotSpotMethodResolved, codeSize)                                          \
     int_field(HotSpotMethodResolved, accessFlags)                                       \
@@ -86,7 +86,7 @@
   end_class                                                                             \
   start_class(HotSpotCompiledMethod)                                                    \
     long_field(HotSpotCompiledMethod, nmethod)                                          \
-    oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/graal/api/meta/RiResolvedMethod;")\
+    oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;")\
   end_class                                                                             \
   start_class(HotSpotCodeInfo)                                                          \
     long_field(HotSpotCodeInfo, start)                                                  \
@@ -107,7 +107,7 @@
     int_field(HotSpotExceptionHandler, endBci)                                          \
     int_field(HotSpotExceptionHandler, handlerBci)                                      \
     int_field(HotSpotExceptionHandler, catchClassIndex)                                 \
-    oop_field(HotSpotExceptionHandler, catchClass, "Lcom/oracle/graal/api/meta/RiType;")    \
+    oop_field(HotSpotExceptionHandler, catchClass, "Lcom/oracle/graal/api/meta/JavaType;")    \
   end_class                                                                             \
   start_class(CiTargetMethod)                                                           \
     int_field(CiTargetMethod, frameSize)                                                \
@@ -120,16 +120,16 @@
     oop_field(CiAssumptions, list, "[Lcom/oracle/graal/api/code/CiAssumptions$Assumption;") \
   end_class                                                                             \
   start_class(CiAssumptions_MethodContents)                                             \
-    oop_field(CiAssumptions_MethodContents, method, "Lcom/oracle/graal/api/meta/RiResolvedMethod;") \
+    oop_field(CiAssumptions_MethodContents, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \
   end_class                                                                             \
   start_class(CiAssumptions_ConcreteSubtype)                                            \
-    oop_field(CiAssumptions_ConcreteSubtype, context, "Lcom/oracle/graal/api/meta/RiResolvedType;") \
-    oop_field(CiAssumptions_ConcreteSubtype, subtype, "Lcom/oracle/graal/api/meta/RiResolvedType;") \
+    oop_field(CiAssumptions_ConcreteSubtype, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \
+    oop_field(CiAssumptions_ConcreteSubtype, subtype, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \
   end_class                                                                             \
   start_class(CiAssumptions_ConcreteMethod)                                             \
-    oop_field(CiAssumptions_ConcreteMethod, method, "Lcom/oracle/graal/api/meta/RiResolvedMethod;") \
-    oop_field(CiAssumptions_ConcreteMethod, context, "Lcom/oracle/graal/api/meta/RiResolvedType;") \
-    oop_field(CiAssumptions_ConcreteMethod, impl, "Lcom/oracle/graal/api/meta/RiResolvedMethod;") \
+    oop_field(CiAssumptions_ConcreteMethod, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \
+    oop_field(CiAssumptions_ConcreteMethod, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \
+    oop_field(CiAssumptions_ConcreteMethod, impl, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \
   end_class                                                                             \
   start_class(CiTargetMethod_Site)                                                      \
     int_field(CiTargetMethod_Site, pcOffset)                                            \
@@ -173,7 +173,7 @@
   end_class                                                                             \
   start_class(CiCodePos)                                                                \
     oop_field(CiCodePos, caller, "Lcom/oracle/graal/api/code/CiCodePos;")                   \
-    oop_field(CiCodePos, method, "Lcom/oracle/graal/api/meta/RiResolvedMethod;")            \
+    oop_field(CiCodePos, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;")            \
     int_field(CiCodePos, bci)                                                           \
   end_class                                                                             \
   start_class(CiConstant)                                                               \
@@ -225,7 +225,7 @@
   end_class                                                                             \
   start_class(CiVirtualObject)                                                          \
     int_field(CiVirtualObject, id)                                                      \
-    oop_field(CiVirtualObject, type, "Lcom/oracle/graal/api/meta/RiType;")                  \
+    oop_field(CiVirtualObject, type, "Lcom/oracle/graal/api/meta/JavaType;")                  \
     oop_field(CiVirtualObject, values, "[Lcom/oracle/graal/api/meta/Value;")              \
   end_class                                                                             \
   start_class(CiMonitorValue)                                                           \