changeset 7084:9ba90252ce08

HotSpotResolvedJavaType is now the HotSpot implementation of ResolvedJavaType, Renamed old HotSpotResolvedJavaType to HotSpotResolvedObjectType Renamed HotSpotTypePrimitive to HotSpotResolvedPrimitiveType Renamed HotSpotTypeUnresolved to HotSpotUnresolvedJavaType
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 28 Nov 2012 14:07:25 +0100
parents fa3c8913d674
children 83ddc0026706
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeInterpreterInterface.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/meta/HotSpotConstantPool.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMirrorHolder.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSignature.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotTypePrimitive.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotTypeUnresolved.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotUnresolvedJavaType.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.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/InstanceOfSnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java src/share/vm/classfile/systemDictionary.hpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/graal/graalCodeInstaller.cpp src/share/vm/graal/graalCompiler.cpp src/share/vm/graal/graalCompiler.hpp src/share/vm/graal/graalCompilerToVM.cpp src/share/vm/graal/graalJavaAccess.hpp src/share/vm/oops/klass.hpp src/share/vm/runtime/deoptimization.cpp
diffstat 34 files changed, 928 insertions(+), 922 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java	Wed Nov 28 14:07:25 2012 +0100
@@ -174,7 +174,7 @@
         return vmToCompiler;
     }
 
-    public JavaType lookupType(String name, HotSpotResolvedJavaType accessingClass, boolean eagerResolve) {
+    public JavaType lookupType(String name, HotSpotResolvedObjectType accessingClass, boolean eagerResolve) {
         if (name.length() == 1 && vmToCompiler instanceof VMToCompilerImpl) {
             VMToCompilerImpl impl = (VMToCompilerImpl) vmToCompiler;
             Kind kind = Kind.fromPrimitiveOrVoidTypeChar(name.charAt(0));
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeInterpreterInterface.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotRuntimeInterpreterInterface.java	Wed Nov 28 14:07:25 2012 +0100
@@ -41,7 +41,7 @@
     }
 
     public Class< ? > getMirror(ResolvedJavaType type) {
-        return ((HotSpotMirrorHolder) type).mirror();
+        return ((HotSpotResolvedJavaType) type).mirror();
     }
 
     public native Object invoke(ResolvedJavaMethod method, Object... args);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Wed Nov 28 14:07:25 2012 +0100
@@ -78,7 +78,7 @@
      * @param resultHolder the holder of the result is put in element 0 of this array
      * @return the metaspace Method result or 0 is there is no unique concrete method for {@code metaspaceMethod}
      */
-    long getUniqueConcreteMethod(long metaspaceMethod, HotSpotResolvedJavaType[] resultHolder);
+    long getUniqueConcreteMethod(long metaspaceMethod, HotSpotResolvedObjectType[] resultHolder);
 
     /**
      * Gets the invocation count for a method.
@@ -115,17 +115,17 @@
      *         {@code eagerResolve == true}
      * @throws LinkageError if {@code eagerResolve == true} and the resolution failed
      */
-    JavaType lookupType(String name, HotSpotResolvedJavaType accessingClass, boolean eagerResolve);
+    JavaType lookupType(String name, HotSpotResolvedObjectType accessingClass, boolean eagerResolve);
 
-    Object lookupConstantInPool(HotSpotResolvedJavaType pool, int cpi);
+    Object lookupConstantInPool(HotSpotResolvedObjectType pool, int cpi);
 
-    JavaMethod lookupMethodInPool(HotSpotResolvedJavaType pool, int cpi, byte opcode);
+    JavaMethod lookupMethodInPool(HotSpotResolvedObjectType pool, int cpi, byte opcode);
 
-    JavaType lookupTypeInPool(HotSpotResolvedJavaType pool, int cpi);
+    JavaType lookupTypeInPool(HotSpotResolvedObjectType pool, int cpi);
 
-    JavaField lookupFieldInPool(HotSpotResolvedJavaType pool, int cpi, byte opcode);
+    JavaField lookupFieldInPool(HotSpotResolvedObjectType pool, int cpi, byte opcode);
 
-    void lookupReferencedTypeInPool(HotSpotResolvedJavaType pool, int cpi, byte opcode);
+    void lookupReferencedTypeInPool(HotSpotResolvedObjectType pool, int cpi, byte opcode);
 
     /**
      * Installs the result of a compilation into the code cache.
@@ -140,15 +140,15 @@
 
     void initializeConfiguration(HotSpotVMConfig config);
 
-    JavaMethod resolveMethod(HotSpotResolvedJavaType klass, String name, String signature);
+    JavaMethod resolveMethod(HotSpotResolvedObjectType klass, String name, String signature);
 
-    boolean isTypeInitialized(HotSpotResolvedJavaType klass);
+    boolean isTypeInitialized(HotSpotResolvedObjectType klass);
 
-    void initializeType(HotSpotResolvedJavaType klass);
+    void initializeType(HotSpotResolvedObjectType klass);
 
     ResolvedJavaType getResolvedType(Class<?> javaClass);
 
-    HotSpotResolvedJavaField[] getInstanceFields(HotSpotResolvedJavaType klass);
+    HotSpotResolvedJavaField[] getInstanceFields(HotSpotResolvedObjectType klass);
 
     /**
      * Gets the compiled code size for a method.
@@ -165,8 +165,8 @@
      * @param resultHolder the holder of the result is put in element 0 of this array
      * @return the metaspace Method result for {@code reflectionMethod}
      */
-    long getMetaspaceMethod(Method reflectionMethod, HotSpotResolvedJavaType[] resultHolder);
-    long getMetaspaceConstructor(Constructor reflectionConstructor, HotSpotResolvedJavaType[] resultHolder);
+    long getMetaspaceMethod(Method reflectionMethod, HotSpotResolvedObjectType[] resultHolder);
+    long getMetaspaceConstructor(Constructor reflectionConstructor, HotSpotResolvedObjectType[] resultHolder);
 
     HotSpotResolvedJavaField getJavaField(Field reflectionField);
 
@@ -186,5 +186,5 @@
 
     String decodePC(long pc);
 
-    long getPrototypeMarkWord(HotSpotResolvedJavaType hotSpotResolvedJavaType);
+    long getPrototypeMarkWord(HotSpotResolvedObjectType hotSpotResolvedJavaType);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Wed Nov 28 14:07:25 2012 +0100
@@ -35,10 +35,10 @@
 public class CompilerToVMImpl implements CompilerToVM {
 
     @Override
-    public native long getMetaspaceMethod(Method reflectionMethod, HotSpotResolvedJavaType[] resultHolder);
+    public native long getMetaspaceMethod(Method reflectionMethod, HotSpotResolvedObjectType[] resultHolder);
 
     @Override
-    public native long getMetaspaceConstructor(Constructor reflectionConstructor, HotSpotResolvedJavaType[] resultHolder);
+    public native long getMetaspaceConstructor(Constructor reflectionConstructor, HotSpotResolvedObjectType[] resultHolder);
 
     @Override
     public native HotSpotResolvedJavaField getJavaField(Field reflectionMethod);
@@ -59,28 +59,28 @@
     public native boolean isMethodCompilable(long metaspaceMethod);
 
     @Override
-    public native long getUniqueConcreteMethod(long metaspaceMethod, HotSpotResolvedJavaType[] resultHolder);
+    public native long getUniqueConcreteMethod(long metaspaceMethod, HotSpotResolvedObjectType[] resultHolder);
 
     @Override
     public native int getInvocationCount(long metaspaceMethod);
 
     @Override
-    public native JavaType lookupType(String name, HotSpotResolvedJavaType accessingClass, boolean eagerResolve);
+    public native JavaType lookupType(String name, HotSpotResolvedObjectType accessingClass, boolean eagerResolve);
 
     @Override
-    public native Object lookupConstantInPool(HotSpotResolvedJavaType pool, int cpi);
+    public native Object lookupConstantInPool(HotSpotResolvedObjectType pool, int cpi);
 
     @Override
-    public native JavaMethod lookupMethodInPool(HotSpotResolvedJavaType pool, int cpi, byte opcode);
+    public native JavaMethod lookupMethodInPool(HotSpotResolvedObjectType pool, int cpi, byte opcode);
 
     @Override
-    public native JavaType lookupTypeInPool(HotSpotResolvedJavaType pool, int cpi);
+    public native JavaType lookupTypeInPool(HotSpotResolvedObjectType pool, int cpi);
 
     @Override
-    public native void lookupReferencedTypeInPool(HotSpotResolvedJavaType pool, int cpi, byte opcode);
+    public native void lookupReferencedTypeInPool(HotSpotResolvedObjectType pool, int cpi, byte opcode);
 
     @Override
-    public native JavaField lookupFieldInPool(HotSpotResolvedJavaType pool, int cpi, byte opcode);
+    public native JavaField lookupFieldInPool(HotSpotResolvedObjectType pool, int cpi, byte opcode);
 
     @Override
     public native HotSpotInstalledCode installCode(HotSpotCompilationResult comp, HotSpotInstalledCode code, HotSpotCodeInfo info);
@@ -89,13 +89,13 @@
     public native void initializeConfiguration(HotSpotVMConfig config);
 
     @Override
-    public native JavaMethod resolveMethod(HotSpotResolvedJavaType klass, String name, String signature);
+    public native JavaMethod resolveMethod(HotSpotResolvedObjectType klass, String name, String signature);
 
     @Override
-    public native boolean isTypeInitialized(HotSpotResolvedJavaType klass);
+    public native boolean isTypeInitialized(HotSpotResolvedObjectType klass);
 
     @Override
-    public native void initializeType(HotSpotResolvedJavaType klass);
+    public native void initializeType(HotSpotResolvedObjectType klass);
 
     @Override
     public native void initializeMethod(long metaspaceMethod, HotSpotResolvedJavaMethod method);
@@ -107,7 +107,7 @@
     public native ResolvedJavaType getResolvedType(Class<?> javaClass);
 
     @Override
-    public native HotSpotResolvedJavaField[] getInstanceFields(HotSpotResolvedJavaType klass);
+    public native HotSpotResolvedJavaField[] getInstanceFields(HotSpotResolvedObjectType klass);
 
     @Override
     public native int getCompiledCodeSize(long metaspaceMethod);
@@ -137,5 +137,5 @@
     public native String decodePC(long pc);
 
     @Override
-    public native long getPrototypeMarkWord(HotSpotResolvedJavaType type);
+    public native long getPrototypeMarkWord(HotSpotResolvedObjectType type);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Wed Nov 28 14:07:25 2012 +0100
@@ -33,7 +33,7 @@
  */
 public interface VMToCompiler {
 
-    boolean compileMethod(long metaspaceMethod, HotSpotResolvedJavaType holder, int entryBCI, boolean blocking, int priority) throws Throwable;
+    boolean compileMethod(long metaspaceMethod, HotSpotResolvedObjectType holder, int entryBCI, boolean blocking, int priority) throws Throwable;
 
     void shutdownCompiler() throws Throwable;
 
@@ -61,7 +61,7 @@
      * @param simpleName a simple, unqualified name for the type
      * @param javaMirror the {@link Class} mirror
      * @param hasFinalizableSubclass specifies if the type has a finalizable subtype
-     * @param sizeOrSpecies the size of an instance of the type, or {@link HotSpotResolvedJavaType#INTERFACE_SPECIES_VALUE} or {@link HotSpotResolvedJavaType#ARRAY_SPECIES_VALUE}
+     * @param sizeOrSpecies the size of an instance of the type, or {@link HotSpotResolvedObjectType#INTERFACE_SPECIES_VALUE} or {@link HotSpotResolvedObjectType#ARRAY_SPECIES_VALUE}
      * @return the resolved type associated with {@code javaMirror} which may not be the type instantiated by this call
      *         in the case of another thread racing to create the same type
      */
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Wed Nov 28 14:07:25 2012 +0100
@@ -52,15 +52,15 @@
 
     private final HotSpotGraalRuntime graalRuntime;
 
-    public final HotSpotTypePrimitive typeBoolean;
-    public final HotSpotTypePrimitive typeChar;
-    public final HotSpotTypePrimitive typeFloat;
-    public final HotSpotTypePrimitive typeDouble;
-    public final HotSpotTypePrimitive typeByte;
-    public final HotSpotTypePrimitive typeShort;
-    public final HotSpotTypePrimitive typeInt;
-    public final HotSpotTypePrimitive typeLong;
-    public final HotSpotTypePrimitive typeVoid;
+    public final HotSpotResolvedPrimitiveType typeBoolean;
+    public final HotSpotResolvedPrimitiveType typeChar;
+    public final HotSpotResolvedPrimitiveType typeFloat;
+    public final HotSpotResolvedPrimitiveType typeDouble;
+    public final HotSpotResolvedPrimitiveType typeByte;
+    public final HotSpotResolvedPrimitiveType typeShort;
+    public final HotSpotResolvedPrimitiveType typeInt;
+    public final HotSpotResolvedPrimitiveType typeLong;
+    public final HotSpotResolvedPrimitiveType typeVoid;
 
     private ThreadPoolExecutor compileQueue;
     private ThreadPoolExecutor slowCompileQueue;
@@ -73,18 +73,18 @@
     public VMToCompilerImpl(HotSpotGraalRuntime compiler) {
         this.graalRuntime = compiler;
 
-        typeBoolean = new HotSpotTypePrimitive(Kind.Boolean);
-        typeChar = new HotSpotTypePrimitive(Kind.Char);
-        typeFloat = new HotSpotTypePrimitive(Kind.Float);
-        typeDouble = new HotSpotTypePrimitive(Kind.Double);
-        typeByte = new HotSpotTypePrimitive(Kind.Byte);
-        typeShort = new HotSpotTypePrimitive(Kind.Short);
-        typeInt = new HotSpotTypePrimitive(Kind.Int);
-        typeLong = new HotSpotTypePrimitive(Kind.Long);
-        typeVoid = new HotSpotTypePrimitive(Kind.Void);
+        typeBoolean = new HotSpotResolvedPrimitiveType(Kind.Boolean);
+        typeChar = new HotSpotResolvedPrimitiveType(Kind.Char);
+        typeFloat = new HotSpotResolvedPrimitiveType(Kind.Float);
+        typeDouble = new HotSpotResolvedPrimitiveType(Kind.Double);
+        typeByte = new HotSpotResolvedPrimitiveType(Kind.Byte);
+        typeShort = new HotSpotResolvedPrimitiveType(Kind.Short);
+        typeInt = new HotSpotResolvedPrimitiveType(Kind.Int);
+        typeLong = new HotSpotResolvedPrimitiveType(Kind.Long);
+        typeVoid = new HotSpotResolvedPrimitiveType(Kind.Void);
     }
 
-    private static void initMirror(HotSpotTypePrimitive type, long offset) {
+    private static void initMirror(HotSpotResolvedPrimitiveType type, long offset) {
         Class<?> mirror = type.mirror();
         unsafe.putObject(mirror, offset, type);
         assert unsafe.getObject(mirror, offset) == type;
@@ -372,7 +372,7 @@
     }
 
     @Override
-    public boolean compileMethod(long metaspaceMethod, final HotSpotResolvedJavaType holder, final int entryBCI, boolean blocking, int priority) throws Throwable {
+    public boolean compileMethod(long metaspaceMethod, final HotSpotResolvedObjectType holder, final int entryBCI, boolean blocking, int priority) throws Throwable {
         HotSpotResolvedJavaMethod method = holder.createMethod(metaspaceMethod);
         return compileMethod(method, entryBCI, blocking, priority);
     }
@@ -446,7 +446,7 @@
     @Override
     public JavaField createJavaField(JavaType holder, String name, JavaType type, int offset, int flags, boolean internal) {
         if (offset != -1) {
-            HotSpotResolvedJavaType resolved = (HotSpotResolvedJavaType) holder;
+            HotSpotResolvedObjectType resolved = (HotSpotResolvedObjectType) holder;
             return resolved.createField(name, type, offset, flags, internal);
         }
         return new HotSpotUnresolvedField(holder, name, type);
@@ -454,7 +454,7 @@
 
     @Override
     public ResolvedJavaMethod createResolvedJavaMethod(JavaType holder, long metaspaceMethod) {
-        HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) holder;
+        HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) holder;
         return type.createMethod(metaspaceMethod);
     }
 
@@ -485,7 +485,7 @@
     }
 
     @Override
-    public HotSpotTypeUnresolved createUnresolvedJavaType(String name) {
+    public HotSpotUnresolvedJavaType createUnresolvedJavaType(String name) {
         int dims = 0;
         int startIndex = 0;
         while (name.charAt(startIndex) == '[') {
@@ -496,20 +496,20 @@
         // Decode name if necessary.
         if (name.charAt(name.length() - 1) == ';') {
             assert name.charAt(startIndex) == 'L';
-            return new HotSpotTypeUnresolved(name, name.substring(startIndex + 1, name.length() - 1), dims);
+            return new HotSpotUnresolvedJavaType(name, name.substring(startIndex + 1, name.length() - 1), dims);
         } else {
-            return new HotSpotTypeUnresolved(HotSpotTypeUnresolved.getFullName(name, dims), name, dims);
+            return new HotSpotUnresolvedJavaType(HotSpotUnresolvedJavaType.getFullName(name, dims), name, dims);
         }
     }
 
     @Override
-    public HotSpotResolvedJavaType createResolvedJavaType(long metaspaceKlass,
+    public HotSpotResolvedObjectType createResolvedJavaType(long metaspaceKlass,
                     String name,
                     String simpleName,
                     Class javaMirror,
                     boolean hasFinalizableSubclass,
                     int sizeOrSpecies) {
-        HotSpotResolvedJavaType type = new HotSpotResolvedJavaType(
+        HotSpotResolvedObjectType type = new HotSpotResolvedObjectType(
                                         metaspaceKlass,
                                         name,
                                         simpleName,
@@ -520,7 +520,7 @@
         long offset = HotSpotGraalRuntime.getInstance().getConfig().graalMirrorInClassOffset;
         if (!unsafe.compareAndSwapObject(javaMirror, offset, null, type)) {
             // lost the race - return the existing value instead
-            type = (HotSpotResolvedJavaType) unsafe.getObject(javaMirror, offset);
+            type = (HotSpotResolvedObjectType) unsafe.getObject(javaMirror, offset);
         }
         return type;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java	Wed Nov 28 14:07:25 2012 +0100
@@ -32,9 +32,9 @@
 
     private static final long serialVersionUID = -5443206401485234850L;
 
-    private final HotSpotResolvedJavaType type;
+    private final HotSpotResolvedObjectType type;
 
-    public HotSpotConstantPool(HotSpotResolvedJavaType type) {
+    public HotSpotConstantPool(HotSpotResolvedObjectType type) {
         this.type = type;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMethodData.java	Wed Nov 28 14:07:25 2012 +0100
@@ -343,7 +343,7 @@
             for (int i = 0; i < typeProfileWidth; i++) {
                 long receiverKlass = data.readWord(position, getReceiverOffset(i));
                 if (receiverKlass != 0) {
-                    types[entries] = HotSpotResolvedJavaType.fromMetaspaceKlass(receiverKlass);
+                    types[entries] = HotSpotResolvedObjectType.fromMetaspaceKlass(receiverKlass);
                     long count = data.readUnsignedInt(position, getCountOffset(i));
                     totalCount += count;
                     counts[entries] = count;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotMirrorHolder.java	Wed Nov 28 12:18:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +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.hotspot.meta;
-
-
-public interface HotSpotMirrorHolder {
-    Class<?> mirror();
-}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Wed Nov 28 14:07:25 2012 +0100
@@ -40,14 +40,14 @@
     private static final int FIELD_INTERNAL_FLAG = 0x80000000;
 
     private static final long serialVersionUID = 7692985878836955683L;
-    private final HotSpotResolvedJavaType holder;
+    private final HotSpotResolvedObjectType holder;
     private final String name;
     private final JavaType type;
     private final int offset;
     private final int flags;
     private Constant constant;
 
-    public HotSpotResolvedJavaField(HotSpotResolvedJavaType holder, String name, JavaType type, int offset, int flags, boolean internal) {
+    public HotSpotResolvedJavaField(HotSpotResolvedObjectType holder, String name, JavaType type, int offset, int flags, boolean internal) {
         assert (flags & FIELD_INTERNAL_FLAG) == 0;
         this.holder = holder;
         this.name = name;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java	Wed Nov 28 14:07:25 2012 +0100
@@ -48,7 +48,7 @@
      */
     final long metaspaceMethod;
 
-    private final HotSpotResolvedJavaType holder;
+    private final HotSpotResolvedObjectType holder;
     private /*final*/ int codeSize;
     private /*final*/ int exceptionHandlerCount;
     private Signature signature;
@@ -60,7 +60,7 @@
 
     private CompilationTask currentTask;
 
-    HotSpotResolvedJavaMethod(HotSpotResolvedJavaType holder, long metaspaceMethod) {
+    HotSpotResolvedJavaMethod(HotSpotResolvedObjectType holder, long metaspaceMethod) {
         this.metaspaceMethod = metaspaceMethod;
         this.holder = holder;
         HotSpotGraalRuntime.getInstance().getCompilerToVM().initializeMethod(metaspaceMethod, this);
@@ -149,7 +149,7 @@
     }
 
     public ResolvedJavaMethod uniqueConcreteMethod() {
-        HotSpotResolvedJavaType[] resultHolder = {null};
+        HotSpotResolvedObjectType[] resultHolder = {null};
         long ucm = HotSpotGraalRuntime.getInstance().getCompilerToVM().getUniqueConcreteMethod(metaspaceMethod, resultHolder);
         if (ucm != 0L) {
             assert resultHolder[0] != null;
@@ -225,7 +225,7 @@
 
     @Override
     public ConstantPool getConstantPool() {
-        return ((HotSpotResolvedJavaType) getDeclaringClass()).constantPool();
+        return ((HotSpotResolvedObjectType) getDeclaringClass()).constantPool();
     }
 
     @Override
@@ -263,7 +263,7 @@
         int count = sig.getParameterCount(false);
         Class< ? >[] result = new Class< ? >[count];
         for (int i = 0; i < result.length; ++i) {
-            result[i] = ((HotSpotMirrorHolder) sig.getParameterType(i, holder).resolve(holder)).mirror();
+            result[i] = ((HotSpotResolvedJavaType) sig.getParameterType(i, holder).resolve(holder)).mirror();
         }
         return result;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java	Wed Nov 28 14:07:25 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * 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
@@ -22,479 +22,15 @@
  */
 package com.oracle.graal.hotspot.meta;
 
-import static com.oracle.graal.api.meta.MetaUtil.*;
-import static com.oracle.graal.graph.FieldIntrospection.*;
-import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*;
-import static java.lang.reflect.Modifier.*;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-import java.util.*;
-
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.hotspot.*;
-
-/**
- * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes.
- */
-public final class HotSpotResolvedJavaType extends HotSpotJavaType implements ResolvedJavaType, HotSpotMirrorHolder {
-
-    private static final long serialVersionUID = 3481514353553840471L;
-
-    /**
-     * Value for the {@code sizeOrSpecies} parameter in {@link HotSpotResolvedJavaType#HotSpotResolvedJavaType}
-     * denoting that the new type represents an interface class.
-     */
-    public static final int INTERFACE_SPECIES_VALUE = Integer.MIN_VALUE;
-
-    /**
-     * Value for the {@code sizeOrSpecies} parameter in {@link HotSpotResolvedJavaType#HotSpotResolvedJavaType}
-     * denoting that the new type represents an array class.
-     */
-    public static final int ARRAY_SPECIES_VALUE = Integer.MAX_VALUE;
-
-    /**
-     * Reference to the metaspace Klass object.
-     */
-    private final long metaspaceKlass;
-
-    private final Class<?> javaMirror; // this could be read directly from 'metaspaceKlass'...
-    private final String simpleName;
-    private final boolean hasFinalizableSubclass;
-
-    /**
-     * The instance size for an instance type, {@link HotSpotResolvedJavaType#INTERFACE_SPECIES_VALUE} denoting
-     * an interface type or {@link HotSpotResolvedJavaType#ARRAY_SPECIES_VALUE} denoting an array type.
-     */
-    private final int sizeOrSpecies;
-
-    private HashMap<Long, ResolvedJavaField> fieldCache;
-    private HashMap<Long, HotSpotResolvedJavaMethod> methodCache;
-    private HotSpotResolvedJavaField[] instanceFields;
-    private ResolvedJavaType[] interfaces;
-    private ConstantPool constantPool;
-    private boolean isInitialized;
-    private ResolvedJavaType arrayOfType;
 
-    /**
-     * Gets the Graal mirror from a HotSpot metaspace Klass native object.
-     *
-     * @param metaspaceKlass a metaspace Klass object boxed in a {@link Constant}
-     * @return the {@link ResolvedJavaType} corresponding to {@code klassConstant}
-     */
-    public static ResolvedJavaType fromMetaspaceKlass(Constant metaspaceKlass) {
-        assert metaspaceKlass.getKind().isLong();
-        return fromMetaspaceKlass(metaspaceKlass.asLong());
-    }
-
-    /**
-     * Gets the Graal mirror from a HotSpot metaspace Klass native object.
-     *
-     * @param metaspaceKlass a metaspace Klass object
-     * @return the {@link ResolvedJavaType} corresponding to {@code metaspaceKlass}
-     */
-    public static ResolvedJavaType fromMetaspaceKlass(long metaspaceKlass) {
-        assert metaspaceKlass != 0;
-        Class javaClass = (Class) unsafe.getObject(null, metaspaceKlass + HotSpotGraalRuntime.getInstance().getConfig().classMirrorOffset);
-        assert javaClass != null;
-        return fromClass(javaClass);
-    }
-
-    /**
-     * Gets the Graal mirror from a {@link Class} object.
-     *
-     * @return the {@link HotSpotResolvedJavaType} corresponding to {@code javaClass}
-     */
-    public static ResolvedJavaType fromClass(Class javaClass) {
-        ResolvedJavaType type = (ResolvedJavaType) unsafe.getObject(javaClass, (long) HotSpotGraalRuntime.getInstance().getConfig().graalMirrorInClassOffset);
-        if (type == null) {
-            type = HotSpotGraalRuntime.getInstance().getCompilerToVM().getResolvedType(javaClass);
-            assert type != null;
-        }
-        return type;
-    }
-
-    /**
-     * @param hasFinalizableSubclass
-     * @param sizeOrSpecies the size of an instance of the type, or {@link HotSpotResolvedJavaType#INTERFACE_SPECIES_VALUE} or {@link HotSpotResolvedJavaType#ARRAY_SPECIES_VALUE}
-     */
-    public HotSpotResolvedJavaType(long metaspaceKlass,
-                    String name,
-                    String simpleName,
-                    Class javaMirror,
-                    boolean hasFinalizableSubclass,
-                    int sizeOrSpecies) {
-        super(name);
-        this.metaspaceKlass = metaspaceKlass;
-        this.javaMirror = javaMirror;
-        this.simpleName = simpleName;
-        this.hasFinalizableSubclass = hasFinalizableSubclass;
-        this.sizeOrSpecies = sizeOrSpecies;
-        assert name.charAt(0) != '[' || sizeOrSpecies == ARRAY_SPECIES_VALUE : name + " " + Long.toHexString(sizeOrSpecies);
-        assert javaMirror.isArray() == isArray();
-        assert javaMirror.isInterface() == isInterface();
-        //System.out.println("0x" + Long.toHexString(metaspaceKlass) + ": " + name);
-    }
 
-    @Override
-    public int getModifiers() {
-        return javaMirror.getModifiers();
-    }
-
-    public int getAccessFlags() {
-        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
-        return unsafe.getInt(null, metaspaceKlass + config.klassAccessFlagsOffset);
-    }
-
-    @Override
-    public ResolvedJavaType getArrayClass() {
-        if (arrayOfType == null) {
-            arrayOfType = fromClass(Array.newInstance(javaMirror, 0).getClass());
-        }
-        return arrayOfType;
-    }
-
-    @Override
-    public ResolvedJavaType getComponentType() {
-        Class javaComponentType = javaMirror.getComponentType();
-        return javaComponentType == null ? null : fromClass(javaComponentType);
-    }
-
-    private static boolean hasSubtype(ResolvedJavaType type) {
-        assert !type.isArray() : type;
-        if (type.isPrimitive()) {
-            return false;
-        }
-        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
-        if (unsafeReadWord(((HotSpotResolvedJavaType) type).metaspaceKlass + config.subklassOffset) != 0) {
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    public ResolvedJavaType findUniqueConcreteSubtype() {
-        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
-        if (isArray()) {
-            if (hasSubtype(getElementalType(this))) {
-                return null;
-            }
-            return this;
-        } else {
-            HotSpotResolvedJavaType type = this;
-            while (isAbstract(type.getModifiers())) {
-                long subklass = unsafeReadWord(type.metaspaceKlass + config.subklassOffset);
-                if (subklass == 0 || unsafeReadWord(subklass + config.nextSiblingOffset) != 0) {
-                    return null;
-                }
-                type = (HotSpotResolvedJavaType) fromMetaspaceKlass(subklass);
-            }
-            if (unsafeReadWord(type.metaspaceKlass + config.subklassOffset) != 0) {
-                return null;
-            }
-            return type;
-        }
-    }
+public abstract class HotSpotResolvedJavaType extends HotSpotJavaType implements ResolvedJavaType {
+    private static final long serialVersionUID = -6410840212023428347L;
 
-    @Override
-    public HotSpotResolvedJavaType getSuperclass() {
-        Class javaSuperclass = javaMirror.getSuperclass();
-        return javaSuperclass == null ? null : (HotSpotResolvedJavaType) fromClass(javaSuperclass);
-    }
-
-    @Override
-    public ResolvedJavaType[] getInterfaces() {
-        if (interfaces == null) {
-            Class[] javaInterfaces = javaMirror.getInterfaces();
-            ResolvedJavaType[] result = new ResolvedJavaType[javaInterfaces.length];
-            for (int i = 0; i < javaInterfaces.length; i++) {
-                result[i] = fromClass(javaInterfaces[i]);
-            }
-            interfaces = result;
-        }
-        return interfaces;
-    }
-
-    public HotSpotResolvedJavaType getSupertype() {
-        if (isArray()) {
-            ResolvedJavaType componentType = getComponentType();
-            if (javaMirror == Object[].class || componentType.isPrimitive()) {
-                return (HotSpotResolvedJavaType) fromClass(Object.class);
-            }
-            return (HotSpotResolvedJavaType) ((HotSpotResolvedJavaType) componentType).getSupertype().getArrayClass();
-        }
-        if (isInterface()) {
-            return (HotSpotResolvedJavaType) fromClass(Object.class);
-        }
-        return getSuperclass();
-    }
-
-    @Override
-    public ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType) {
-        if (otherType.isPrimitive()) {
-            return null;
-        } else {
-            HotSpotResolvedJavaType t1 = this;
-            HotSpotResolvedJavaType t2 = (HotSpotResolvedJavaType) otherType;
-            while (true) {
-              if (t2.isAssignableTo(t1)) {
-                  return t1;
-              }
-              if (t1.isAssignableTo(t2)) {
-                  return t2;
-              }
-              t1 = t1.getSupertype();
-              t2 = t2.getSupertype();
-            }
-        }
-    }
-
-    @Override
-    public ResolvedJavaType asExactType() {
-        if (isArray()) {
-            return getComponentType().asExactType() != null ? this : null;
-        }
-        return Modifier.isFinal(getModifiers()) ? this : null;
+    public HotSpotResolvedJavaType(String name) {
+        super(name);
     }
 
-    @Override
-    public Constant getEncoding(Representation r) {
-        switch (r) {
-            case JavaClass:
-                return Constant.forObject(javaMirror);
-            case ObjectHub:
-                return klass();
-            case StaticPrimitiveFields:
-            case StaticObjectFields:
-                return Constant.forObject(javaMirror);
-            default:
-                assert false : "Should not reach here.";
-                return null;
-        }
-    }
-
-    @Override
-    public boolean hasFinalizableSubclass() {
-        return hasFinalizableSubclass;
-    }
-
-    @Override
-    public boolean hasFinalizer() {
-        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
-        return (getAccessFlags() & config.klassHasFinalizerFlag) != 0;
-    }
-
-    @Override
-    public boolean isPrimitive() {
-        return false;
-    }
-
-    @Override
-    public boolean isArray() {
-        return sizeOrSpecies == ARRAY_SPECIES_VALUE;
-    }
-
-    @Override
-    public boolean isInitialized() {
-        if (!isInitialized) {
-            isInitialized = HotSpotGraalRuntime.getInstance().getCompilerToVM().isTypeInitialized(this);
-        }
-        return isInitialized;
-    }
-
-    @Override
-    public void initialize() {
-        if (!isInitialized) {
-            HotSpotGraalRuntime.getInstance().getCompilerToVM().initializeType(this);
-        }
-        isInitialized = true;
-    }
-
-    @Override
-    public boolean isInstance(Constant obj) {
-        if (obj.getKind().isObject() && !obj.isNull()) {
-            return javaMirror.isInstance(obj.asObject());
-        }
-        return false;
-    }
-
-    @Override
-    public boolean isInstanceClass() {
-        return !isArray() && !isInterface();
-    }
-
-    @Override
-    public boolean isInterface() {
-        return sizeOrSpecies == INTERFACE_SPECIES_VALUE;
-    }
-
-    @Override
-    public boolean isAssignableTo(ResolvedJavaType other) {
-        if (other instanceof HotSpotResolvedJavaType) {
-            HotSpotResolvedJavaType otherType = (HotSpotResolvedJavaType) other;
-            return otherType.javaMirror.isAssignableFrom(javaMirror);
-        }
-        return false;
-    }
-
-    @Override
-    public Kind getKind() {
-        return Kind.Object;
-    }
-
-    @Override
-    public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method) {
-        assert method instanceof HotSpotMethod;
-        return (ResolvedJavaMethod) HotSpotGraalRuntime.getInstance().getCompilerToVM().resolveMethod(this, method.getName(), ((HotSpotSignature) method.getSignature()).asString());
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotType<" + simpleName + ", resolved>";
-    }
-
-    public ConstantPool constantPool() {
-        if (constantPool == null) {
-            constantPool = new HotSpotConstantPool(this);
-        }
-        return constantPool;
-    }
-
-    /**
-     * Gets the instance size of this type. If an instance of this type cannot
-     * be fast path allocated, then the returned value is negative (its absolute
-     * value gives the size). Must not be called if this is an array or interface type.
-     */
-    public int instanceSize() {
-        assert !isArray();
-        assert !isInterface();
-        return sizeOrSpecies;
-    }
-
-    public synchronized HotSpotResolvedJavaMethod createMethod(long metaspaceMethod) {
-        HotSpotResolvedJavaMethod method = null;
-        if (methodCache == null) {
-            methodCache = new HashMap<>(8);
-        } else {
-            method = methodCache.get(metaspaceMethod);
-        }
-        if (method == null) {
-            method = new HotSpotResolvedJavaMethod(this, metaspaceMethod);
-            methodCache.put(metaspaceMethod, method);
-        }
-        return method;
-    }
-
-    public synchronized ResolvedJavaField createField(String fieldName, JavaType type, int offset, int flags, boolean internal) {
-        ResolvedJavaField result = null;
-
-        long id = offset + ((long) flags << 32);
-
-        // (thomaswue) Must cache the fields, because the local load elimination only works if the objects from two field lookups are identical.
-        if (fieldCache == null) {
-            fieldCache = new HashMap<>(8);
-        } else {
-            result = fieldCache.get(id);
-        }
-
-        if (result == null) {
-            result = new HotSpotResolvedJavaField(this, fieldName, type, offset, flags, internal);
-            fieldCache.put(id, result);
-        } else {
-            assert result.getName().equals(fieldName);
-            assert result.getModifiers() == (Modifier.fieldModifiers() & flags);
-        }
-
-        return result;
-    }
-
-    @Override
-    public ResolvedJavaMethod findUniqueConcreteMethod(ResolvedJavaMethod method) {
-        return ((HotSpotResolvedJavaMethod) method).uniqueConcreteMethod();
-    }
-
-    @Override
-    public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) {
-        if (instanceFields == null) {
-            if (isArray() || isInterface()) {
-                instanceFields = new HotSpotResolvedJavaField[0];
-            } else {
-                HotSpotResolvedJavaField[] myFields = HotSpotGraalRuntime.getInstance().getCompilerToVM().getInstanceFields(this);
-                if (javaMirror != Object.class) {
-                    HotSpotResolvedJavaField[] superFields = (HotSpotResolvedJavaField[]) getSuperclass().getInstanceFields(true);
-                    HotSpotResolvedJavaField[] fields = Arrays.copyOf(superFields, superFields.length + myFields.length);
-                    System.arraycopy(myFields, 0, fields, superFields.length, myFields.length);
-                    instanceFields = fields;
-                } else {
-                    assert myFields.length == 0 : "java.lang.Object has fields!";
-                    instanceFields = myFields;
-                }
-            }
-        }
-        if (!includeSuperclasses) {
-            int myFieldsStart = 0;
-            while (myFieldsStart < instanceFields.length && instanceFields[myFieldsStart].getDeclaringClass() != this) {
-                myFieldsStart++;
-            }
-            if (myFieldsStart == 0) {
-                return instanceFields;
-            }
-            if (myFieldsStart == instanceFields.length) {
-                return new HotSpotResolvedJavaField[0];
-            }
-            return Arrays.copyOfRange(instanceFields, myFieldsStart, instanceFields.length);
-        }
-        return instanceFields;
-    }
-
-    @Override
-    public Class<?> mirror() {
-        return javaMirror;
-    }
-
-    @Override
-    public boolean isClass(Class c) {
-        return c == javaMirror;
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return javaMirror.getAnnotation(annotationClass);
-    }
-
-    @Override
-    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
-        return this;
-    }
-
-    /**
-     * Gets the address of the C++ Klass object for this type.
-     */
-    public Constant klass() {
-        return new Constant(HotSpotGraalRuntime.getInstance().getTarget().wordKind, metaspaceKlass, this);
-    }
-
-    public boolean isPrimaryType() {
-        return HotSpotGraalRuntime.getInstance().getConfig().secondarySuperCacheOffset != superCheckOffset();
-    }
-
-    public int superCheckOffset() {
-        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
-        return unsafe.getInt(null, metaspaceKlass + config.superCheckOffsetOffset);
-    }
-
-    public long prototypeMarkWord() {
-        return HotSpotGraalRuntime.getInstance().getCompilerToVM().getPrototypeMarkWord(this);
-    }
-
-    @Override
-    public ResolvedJavaField findInstanceFieldWithOffset(long offset) {
-        ResolvedJavaField[] declaredFields = getInstanceFields(true);
-        for (ResolvedJavaField field : declaredFields) {
-            if (((HotSpotResolvedJavaField) field).offset() == offset) {
-                return field;
-            }
-        }
-        return null;
-    }
+    public abstract Class<?> mirror();
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Wed Nov 28 14:07:25 2012 +0100
@@ -0,0 +1,500 @@
+/*
+ * 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.hotspot.meta;
+
+import static com.oracle.graal.api.meta.MetaUtil.*;
+import static com.oracle.graal.graph.FieldIntrospection.*;
+import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*;
+import static java.lang.reflect.Modifier.*;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+import java.util.*;
+
+import com.oracle.graal.api.meta.*;
+import com.oracle.graal.hotspot.*;
+
+/**
+ * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes.
+ */
+public final class HotSpotResolvedObjectType extends HotSpotResolvedJavaType {
+
+    private static final long serialVersionUID = 3481514353553840471L;
+
+    /**
+     * Value for the {@code sizeOrSpecies} parameter in {@link HotSpotResolvedObjectType#HotSpotResolvedObjectType}
+     * denoting that the new type represents an interface class.
+     */
+    public static final int INTERFACE_SPECIES_VALUE = Integer.MIN_VALUE;
+
+    /**
+     * Value for the {@code sizeOrSpecies} parameter in {@link HotSpotResolvedObjectType#HotSpotResolvedObjectType}
+     * denoting that the new type represents an array class.
+     */
+    public static final int ARRAY_SPECIES_VALUE = Integer.MAX_VALUE;
+
+    /**
+     * Reference to the metaspace Klass object.
+     */
+    private final long metaspaceKlass;
+
+    private final Class<?> javaMirror; // this could be read directly from 'metaspaceKlass'...
+    private final String simpleName;
+    private final boolean hasFinalizableSubclass;
+
+    /**
+     * The instance size for an instance type, {@link HotSpotResolvedObjectType#INTERFACE_SPECIES_VALUE} denoting
+     * an interface type or {@link HotSpotResolvedObjectType#ARRAY_SPECIES_VALUE} denoting an array type.
+     */
+    private final int sizeOrSpecies;
+
+    private HashMap<Long, ResolvedJavaField> fieldCache;
+    private HashMap<Long, HotSpotResolvedJavaMethod> methodCache;
+    private HotSpotResolvedJavaField[] instanceFields;
+    private ResolvedJavaType[] interfaces;
+    private ConstantPool constantPool;
+    private boolean isInitialized;
+    private ResolvedJavaType arrayOfType;
+
+    /**
+     * Gets the Graal mirror from a HotSpot metaspace Klass native object.
+     *
+     * @param metaspaceKlass a metaspace Klass object boxed in a {@link Constant}
+     * @return the {@link ResolvedJavaType} corresponding to {@code klassConstant}
+     */
+    public static ResolvedJavaType fromMetaspaceKlass(Constant metaspaceKlass) {
+        assert metaspaceKlass.getKind().isLong();
+        return fromMetaspaceKlass(metaspaceKlass.asLong());
+    }
+
+    /**
+     * Gets the Graal mirror from a HotSpot metaspace Klass native object.
+     *
+     * @param metaspaceKlass a metaspace Klass object
+     * @return the {@link ResolvedJavaType} corresponding to {@code metaspaceKlass}
+     */
+    public static ResolvedJavaType fromMetaspaceKlass(long metaspaceKlass) {
+        assert metaspaceKlass != 0;
+        Class javaClass = (Class) unsafe.getObject(null, metaspaceKlass + HotSpotGraalRuntime.getInstance().getConfig().classMirrorOffset);
+        assert javaClass != null;
+        return fromClass(javaClass);
+    }
+
+    /**
+     * Gets the Graal mirror from a {@link Class} object.
+     *
+     * @return the {@link HotSpotResolvedObjectType} corresponding to {@code javaClass}
+     */
+    public static ResolvedJavaType fromClass(Class javaClass) {
+        ResolvedJavaType type = (ResolvedJavaType) unsafe.getObject(javaClass, (long) HotSpotGraalRuntime.getInstance().getConfig().graalMirrorInClassOffset);
+        if (type == null) {
+            type = HotSpotGraalRuntime.getInstance().getCompilerToVM().getResolvedType(javaClass);
+            assert type != null;
+        }
+        return type;
+    }
+
+    /**
+     * @param hasFinalizableSubclass
+     * @param sizeOrSpecies the size of an instance of the type, or {@link HotSpotResolvedObjectType#INTERFACE_SPECIES_VALUE} or {@link HotSpotResolvedObjectType#ARRAY_SPECIES_VALUE}
+     */
+    public HotSpotResolvedObjectType(long metaspaceKlass,
+                    String name,
+                    String simpleName,
+                    Class javaMirror,
+                    boolean hasFinalizableSubclass,
+                    int sizeOrSpecies) {
+        super(name);
+        this.metaspaceKlass = metaspaceKlass;
+        this.javaMirror = javaMirror;
+        this.simpleName = simpleName;
+        this.hasFinalizableSubclass = hasFinalizableSubclass;
+        this.sizeOrSpecies = sizeOrSpecies;
+        assert name.charAt(0) != '[' || sizeOrSpecies == ARRAY_SPECIES_VALUE : name + " " + Long.toHexString(sizeOrSpecies);
+        assert javaMirror.isArray() == isArray();
+        assert javaMirror.isInterface() == isInterface();
+        //System.out.println("0x" + Long.toHexString(metaspaceKlass) + ": " + name);
+    }
+
+    @Override
+    public int getModifiers() {
+        return javaMirror.getModifiers();
+    }
+
+    public int getAccessFlags() {
+        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
+        return unsafe.getInt(null, metaspaceKlass + config.klassAccessFlagsOffset);
+    }
+
+    @Override
+    public ResolvedJavaType getArrayClass() {
+        if (arrayOfType == null) {
+            arrayOfType = fromClass(Array.newInstance(javaMirror, 0).getClass());
+        }
+        return arrayOfType;
+    }
+
+    @Override
+    public ResolvedJavaType getComponentType() {
+        Class javaComponentType = javaMirror.getComponentType();
+        return javaComponentType == null ? null : fromClass(javaComponentType);
+    }
+
+    private static boolean hasSubtype(ResolvedJavaType type) {
+        assert !type.isArray() : type;
+        if (type.isPrimitive()) {
+            return false;
+        }
+        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
+        if (unsafeReadWord(((HotSpotResolvedObjectType) type).metaspaceKlass + config.subklassOffset) != 0) {
+            return true;
+        }
+        return false;
+    }
+
+    @Override
+    public ResolvedJavaType findUniqueConcreteSubtype() {
+        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
+        if (isArray()) {
+            if (hasSubtype(getElementalType(this))) {
+                return null;
+            }
+            return this;
+        } else {
+            HotSpotResolvedObjectType type = this;
+            while (isAbstract(type.getModifiers())) {
+                long subklass = unsafeReadWord(type.metaspaceKlass + config.subklassOffset);
+                if (subklass == 0 || unsafeReadWord(subklass + config.nextSiblingOffset) != 0) {
+                    return null;
+                }
+                type = (HotSpotResolvedObjectType) fromMetaspaceKlass(subklass);
+            }
+            if (unsafeReadWord(type.metaspaceKlass + config.subklassOffset) != 0) {
+                return null;
+            }
+            return type;
+        }
+    }
+
+    @Override
+    public HotSpotResolvedObjectType getSuperclass() {
+        Class javaSuperclass = javaMirror.getSuperclass();
+        return javaSuperclass == null ? null : (HotSpotResolvedObjectType) fromClass(javaSuperclass);
+    }
+
+    @Override
+    public ResolvedJavaType[] getInterfaces() {
+        if (interfaces == null) {
+            Class[] javaInterfaces = javaMirror.getInterfaces();
+            ResolvedJavaType[] result = new ResolvedJavaType[javaInterfaces.length];
+            for (int i = 0; i < javaInterfaces.length; i++) {
+                result[i] = fromClass(javaInterfaces[i]);
+            }
+            interfaces = result;
+        }
+        return interfaces;
+    }
+
+    public HotSpotResolvedObjectType getSupertype() {
+        if (isArray()) {
+            ResolvedJavaType componentType = getComponentType();
+            if (javaMirror == Object[].class || componentType.isPrimitive()) {
+                return (HotSpotResolvedObjectType) fromClass(Object.class);
+            }
+            return (HotSpotResolvedObjectType) ((HotSpotResolvedObjectType) componentType).getSupertype().getArrayClass();
+        }
+        if (isInterface()) {
+            return (HotSpotResolvedObjectType) fromClass(Object.class);
+        }
+        return getSuperclass();
+    }
+
+    @Override
+    public ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType) {
+        if (otherType.isPrimitive()) {
+            return null;
+        } else {
+            HotSpotResolvedObjectType t1 = this;
+            HotSpotResolvedObjectType t2 = (HotSpotResolvedObjectType) otherType;
+            while (true) {
+              if (t2.isAssignableTo(t1)) {
+                  return t1;
+              }
+              if (t1.isAssignableTo(t2)) {
+                  return t2;
+              }
+              t1 = t1.getSupertype();
+              t2 = t2.getSupertype();
+            }
+        }
+    }
+
+    @Override
+    public ResolvedJavaType asExactType() {
+        if (isArray()) {
+            return getComponentType().asExactType() != null ? this : null;
+        }
+        return Modifier.isFinal(getModifiers()) ? this : null;
+    }
+
+    @Override
+    public Constant getEncoding(Representation r) {
+        switch (r) {
+            case JavaClass:
+                return Constant.forObject(javaMirror);
+            case ObjectHub:
+                return klass();
+            case StaticPrimitiveFields:
+            case StaticObjectFields:
+                return Constant.forObject(javaMirror);
+            default:
+                assert false : "Should not reach here.";
+                return null;
+        }
+    }
+
+    @Override
+    public boolean hasFinalizableSubclass() {
+        return hasFinalizableSubclass;
+    }
+
+    @Override
+    public boolean hasFinalizer() {
+        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
+        return (getAccessFlags() & config.klassHasFinalizerFlag) != 0;
+    }
+
+    @Override
+    public boolean isPrimitive() {
+        return false;
+    }
+
+    @Override
+    public boolean isArray() {
+        return sizeOrSpecies == ARRAY_SPECIES_VALUE;
+    }
+
+    @Override
+    public boolean isInitialized() {
+        if (!isInitialized) {
+            isInitialized = HotSpotGraalRuntime.getInstance().getCompilerToVM().isTypeInitialized(this);
+        }
+        return isInitialized;
+    }
+
+    @Override
+    public void initialize() {
+        if (!isInitialized) {
+            HotSpotGraalRuntime.getInstance().getCompilerToVM().initializeType(this);
+        }
+        isInitialized = true;
+    }
+
+    @Override
+    public boolean isInstance(Constant obj) {
+        if (obj.getKind().isObject() && !obj.isNull()) {
+            return javaMirror.isInstance(obj.asObject());
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isInstanceClass() {
+        return !isArray() && !isInterface();
+    }
+
+    @Override
+    public boolean isInterface() {
+        return sizeOrSpecies == INTERFACE_SPECIES_VALUE;
+    }
+
+    @Override
+    public boolean isAssignableTo(ResolvedJavaType other) {
+        if (other instanceof HotSpotResolvedObjectType) {
+            HotSpotResolvedObjectType otherType = (HotSpotResolvedObjectType) other;
+            return otherType.javaMirror.isAssignableFrom(javaMirror);
+        }
+        return false;
+    }
+
+    @Override
+    public Kind getKind() {
+        return Kind.Object;
+    }
+
+    @Override
+    public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method) {
+        assert method instanceof HotSpotMethod;
+        return (ResolvedJavaMethod) HotSpotGraalRuntime.getInstance().getCompilerToVM().resolveMethod(this, method.getName(), ((HotSpotSignature) method.getSignature()).asString());
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotType<" + simpleName + ", resolved>";
+    }
+
+    public ConstantPool constantPool() {
+        if (constantPool == null) {
+            constantPool = new HotSpotConstantPool(this);
+        }
+        return constantPool;
+    }
+
+    /**
+     * Gets the instance size of this type. If an instance of this type cannot
+     * be fast path allocated, then the returned value is negative (its absolute
+     * value gives the size). Must not be called if this is an array or interface type.
+     */
+    public int instanceSize() {
+        assert !isArray();
+        assert !isInterface();
+        return sizeOrSpecies;
+    }
+
+    public synchronized HotSpotResolvedJavaMethod createMethod(long metaspaceMethod) {
+        HotSpotResolvedJavaMethod method = null;
+        if (methodCache == null) {
+            methodCache = new HashMap<>(8);
+        } else {
+            method = methodCache.get(metaspaceMethod);
+        }
+        if (method == null) {
+            method = new HotSpotResolvedJavaMethod(this, metaspaceMethod);
+            methodCache.put(metaspaceMethod, method);
+        }
+        return method;
+    }
+
+    public synchronized ResolvedJavaField createField(String fieldName, JavaType type, int offset, int flags, boolean internal) {
+        ResolvedJavaField result = null;
+
+        long id = offset + ((long) flags << 32);
+
+        // (thomaswue) Must cache the fields, because the local load elimination only works if the objects from two field lookups are identical.
+        if (fieldCache == null) {
+            fieldCache = new HashMap<>(8);
+        } else {
+            result = fieldCache.get(id);
+        }
+
+        if (result == null) {
+            result = new HotSpotResolvedJavaField(this, fieldName, type, offset, flags, internal);
+            fieldCache.put(id, result);
+        } else {
+            assert result.getName().equals(fieldName);
+            assert result.getModifiers() == (Modifier.fieldModifiers() & flags);
+        }
+
+        return result;
+    }
+
+    @Override
+    public ResolvedJavaMethod findUniqueConcreteMethod(ResolvedJavaMethod method) {
+        return ((HotSpotResolvedJavaMethod) method).uniqueConcreteMethod();
+    }
+
+    @Override
+    public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) {
+        if (instanceFields == null) {
+            if (isArray() || isInterface()) {
+                instanceFields = new HotSpotResolvedJavaField[0];
+            } else {
+                HotSpotResolvedJavaField[] myFields = HotSpotGraalRuntime.getInstance().getCompilerToVM().getInstanceFields(this);
+                if (javaMirror != Object.class) {
+                    HotSpotResolvedJavaField[] superFields = (HotSpotResolvedJavaField[]) getSuperclass().getInstanceFields(true);
+                    HotSpotResolvedJavaField[] fields = Arrays.copyOf(superFields, superFields.length + myFields.length);
+                    System.arraycopy(myFields, 0, fields, superFields.length, myFields.length);
+                    instanceFields = fields;
+                } else {
+                    assert myFields.length == 0 : "java.lang.Object has fields!";
+                    instanceFields = myFields;
+                }
+            }
+        }
+        if (!includeSuperclasses) {
+            int myFieldsStart = 0;
+            while (myFieldsStart < instanceFields.length && instanceFields[myFieldsStart].getDeclaringClass() != this) {
+                myFieldsStart++;
+            }
+            if (myFieldsStart == 0) {
+                return instanceFields;
+            }
+            if (myFieldsStart == instanceFields.length) {
+                return new HotSpotResolvedJavaField[0];
+            }
+            return Arrays.copyOfRange(instanceFields, myFieldsStart, instanceFields.length);
+        }
+        return instanceFields;
+    }
+
+    @Override
+    public Class<?> mirror() {
+        return javaMirror;
+    }
+
+    @Override
+    public boolean isClass(Class c) {
+        return c == javaMirror;
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return javaMirror.getAnnotation(annotationClass);
+    }
+
+    @Override
+    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
+        return this;
+    }
+
+    /**
+     * Gets the address of the C++ Klass object for this type.
+     */
+    public Constant klass() {
+        return new Constant(HotSpotGraalRuntime.getInstance().getTarget().wordKind, metaspaceKlass, this);
+    }
+
+    public boolean isPrimaryType() {
+        return HotSpotGraalRuntime.getInstance().getConfig().secondarySuperCacheOffset != superCheckOffset();
+    }
+
+    public int superCheckOffset() {
+        HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
+        return unsafe.getInt(null, metaspaceKlass + config.superCheckOffsetOffset);
+    }
+
+    public long prototypeMarkWord() {
+        return HotSpotGraalRuntime.getInstance().getCompilerToVM().getPrototypeMarkWord(this);
+    }
+
+    @Override
+    public ResolvedJavaField findInstanceFieldWithOffset(long offset) {
+        ResolvedJavaField[] declaredFields = getInstanceFields(true);
+        for (ResolvedJavaField field : declaredFields) {
+            if (((HotSpotResolvedJavaField) field).offset() == offset) {
+                return field;
+            }
+        }
+        return null;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedPrimitiveType.java	Wed Nov 28 14:07:25 2012 +0100
@@ -0,0 +1,192 @@
+/*
+ * 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.hotspot.meta;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+import com.oracle.graal.api.meta.*;
+import com.oracle.graal.graph.*;
+
+/**
+ * Implementation of {@link JavaType} for primitive HotSpot types.
+ */
+public final class HotSpotResolvedPrimitiveType extends HotSpotResolvedJavaType {
+
+    private static final long serialVersionUID = -6208552348908071473L;
+    private final Kind kind;
+    private final Class<?> javaMirror;
+    private final Class javaArrayMirror;
+
+    public HotSpotResolvedPrimitiveType(Kind kind) {
+        super(String.valueOf(Character.toUpperCase(kind.getTypeChar())));
+        this.kind = kind;
+        this.javaMirror = kind.toJavaClass();
+        this.javaArrayMirror = kind.isVoid() ? null : Array.newInstance(javaMirror, 0).getClass();
+    }
+
+    @Override
+    public int getModifiers() {
+        return Modifier.ABSTRACT | Modifier.FINAL | Modifier.PUBLIC;
+    }
+
+    @Override
+    public ResolvedJavaType getArrayClass() {
+        return HotSpotResolvedObjectType.fromClass(javaArrayMirror);
+    }
+
+    @Override
+    public ResolvedJavaType getComponentType() {
+        return null;
+    }
+
+    @Override
+    public ResolvedJavaType asExactType() {
+        return this;
+    }
+
+    @Override
+    public ResolvedJavaType getSuperclass() {
+        assert javaMirror.getSuperclass() == null;
+        return null;
+    }
+
+    @Override
+    public ResolvedJavaType[] getInterfaces() {
+        return new ResolvedJavaType[0];
+    }
+
+    @Override
+    public ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType) {
+        return null;
+    }
+
+    @Override
+    public Constant getEncoding(Representation r) {
+        throw GraalInternalError.unimplemented("HotSpotResolvedPrimitiveType.getEncoding");
+    }
+
+    @Override
+    public boolean hasFinalizableSubclass() {
+        return false;
+    }
+
+    @Override
+    public boolean hasFinalizer() {
+        return false;
+    }
+
+    @Override
+    public boolean isArray() {
+        return false;
+    }
+
+    @Override
+    public boolean isPrimitive() {
+        return true;
+    }
+
+    @Override
+    public boolean isInitialized() {
+        return true;
+    }
+
+    @Override
+    public boolean isInstance(Constant obj) {
+        return false;
+    }
+
+    @Override
+    public boolean isInstanceClass() {
+        return false;
+    }
+
+    @Override
+    public boolean isInterface() {
+        return false;
+    }
+
+    @Override
+    public boolean isAssignableTo(ResolvedJavaType other) {
+        return other == this;
+    }
+
+    @Override
+    public Kind getKind() {
+        return kind;
+    }
+
+    @Override
+    public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method) {
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotResolvedPrimitiveType<" + kind + ">";
+    }
+
+    @Override
+    public ResolvedJavaType findUniqueConcreteSubtype() {
+        return this;
+    }
+
+    @Override
+    public ResolvedJavaMethod findUniqueConcreteMethod(ResolvedJavaMethod method) {
+        return null;
+    }
+
+    @Override
+    public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) {
+        return new ResolvedJavaField[0];
+    }
+
+    @Override
+    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
+        return javaMirror.getAnnotation(annotationClass);
+    }
+
+    @Override
+    public boolean isClass(Class c) {
+        return c == javaMirror;
+    }
+
+    @Override
+    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
+        return this;
+    }
+
+    @Override
+    public void initialize() {
+    }
+
+    @Override
+    public ResolvedJavaField findInstanceFieldWithOffset(long offset) {
+        return null;
+    }
+
+    @Override
+    public Class<?> mirror() {
+        return javaMirror;
+    }
+}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Wed Nov 28 14:07:25 2012 +0100
@@ -334,7 +334,7 @@
             return null;
         }
         Object o = constant.asObject();
-        return HotSpotResolvedJavaType.fromClass(o.getClass());
+        return HotSpotResolvedObjectType.fromClass(o.getClass());
     }
 
     @Override
@@ -607,14 +607,12 @@
                 ValueNode obj = (ValueNode) parameters.get(0);
                 ObjectStamp stamp = (ObjectStamp) obj.stamp();
                 if (stamp.nonNull() && stamp.isExactType()) {
-                    HotSpotJavaType type = (HotSpotJavaType) stamp.type();
-                    if (type instanceof HotSpotMirrorHolder) {
-                        StructuredGraph graph = new StructuredGraph();
-                        ValueNode result = ConstantNode.forObject(((HotSpotMirrorHolder) type).mirror(), this, graph);
-                        ReturnNode ret = graph.add(new ReturnNode(result));
-                        graph.start().setNext(ret);
-                        return graph;
-                    }
+                    HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) stamp.type();
+                    StructuredGraph graph = new StructuredGraph();
+                    ValueNode result = ConstantNode.forObject(type.mirror(), this, graph);
+                    ReturnNode ret = graph.add(new ReturnNode(result));
+                    graph.start().setNext(ret);
+                    return graph;
                 }
                 StructuredGraph graph = new StructuredGraph();
                 LocalNode receiver = graph.unique(new LocalNode(0, StampFactory.objectNonNull()));
@@ -657,7 +655,7 @@
     }
 
     public ResolvedJavaType lookupJavaType(Class<?> clazz) {
-        return HotSpotResolvedJavaType.fromClass(clazz);
+        return HotSpotResolvedObjectType.fromClass(clazz);
     }
 
     public Object lookupCallTarget(Object target) {
@@ -674,7 +672,7 @@
 
     public ResolvedJavaMethod lookupJavaMethod(Method reflectionMethod) {
         CompilerToVM c2vm = graalRuntime.getCompilerToVM();
-        HotSpotResolvedJavaType[] resultHolder = {null};
+        HotSpotResolvedObjectType[] resultHolder = {null};
         long metaspaceMethod = c2vm.getMetaspaceMethod(reflectionMethod, resultHolder);
         assert metaspaceMethod != 0L;
         return resultHolder[0].createMethod(metaspaceMethod);
@@ -682,7 +680,7 @@
 
     public ResolvedJavaMethod lookupJavaConstructor(Constructor reflectionConstructor) {
         CompilerToVM c2vm = graalRuntime.getCompilerToVM();
-        HotSpotResolvedJavaType[] resultHolder = {null};
+        HotSpotResolvedObjectType[] resultHolder = {null};
         long metaspaceMethod = c2vm.getMetaspaceConstructor(reflectionConstructor, resultHolder);
         assert metaspaceMethod != 0L;
         return resultHolder[0].createMethod(metaspaceMethod);
@@ -756,6 +754,6 @@
     }
 
     public boolean needsDataPatch(Constant constant) {
-        return constant.getPrimitiveAnnotation() instanceof HotSpotResolvedJavaType;
+        return constant.getPrimitiveAnnotation() instanceof HotSpotResolvedObjectType;
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSignature.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSignature.java	Wed Nov 28 14:07:25 2012 +0100
@@ -117,7 +117,7 @@
         }
         JavaType type = argumentTypes[index];
         if (type == null || !(type instanceof ResolvedJavaType)) {
-            type = HotSpotGraalRuntime.getInstance().lookupType(arguments.get(index), (HotSpotResolvedJavaType) accessingClass, false);
+            type = HotSpotGraalRuntime.getInstance().lookupType(arguments.get(index), (HotSpotResolvedObjectType) accessingClass, false);
             argumentTypes[index] = type;
         }
         return type;
@@ -135,7 +135,7 @@
     @Override
     public JavaType getReturnType(ResolvedJavaType accessingClass) {
         if (returnTypeCache == null || !(returnTypeCache instanceof ResolvedJavaType)) {
-            returnTypeCache = HotSpotGraalRuntime.getInstance().lookupType(returnType, (HotSpotResolvedJavaType) accessingClass, false);
+            returnTypeCache = HotSpotGraalRuntime.getInstance().lookupType(returnType, (HotSpotResolvedObjectType) accessingClass, false);
         }
         return returnTypeCache;
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotTypePrimitive.java	Wed Nov 28 12:18:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,192 +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.hotspot.meta;
-
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-
-import com.oracle.graal.api.meta.*;
-import com.oracle.graal.graph.*;
-
-/**
- * Implementation of {@link JavaType} for primitive HotSpot types.
- */
-public final class HotSpotTypePrimitive extends HotSpotJavaType implements ResolvedJavaType, HotSpotMirrorHolder {
-
-    private static final long serialVersionUID = -6208552348908071473L;
-    private final Kind kind;
-    private final Class<?> javaMirror;
-    private final Class javaArrayMirror;
-
-    public HotSpotTypePrimitive(Kind kind) {
-        super(String.valueOf(Character.toUpperCase(kind.getTypeChar())));
-        this.kind = kind;
-        this.javaMirror = kind.toJavaClass();
-        this.javaArrayMirror = kind.isVoid() ? null : Array.newInstance(javaMirror, 0).getClass();
-    }
-
-    @Override
-    public int getModifiers() {
-        return Modifier.ABSTRACT | Modifier.FINAL | Modifier.PUBLIC;
-    }
-
-    @Override
-    public ResolvedJavaType getArrayClass() {
-        return HotSpotResolvedJavaType.fromClass(javaArrayMirror);
-    }
-
-    @Override
-    public ResolvedJavaType getComponentType() {
-        return null;
-    }
-
-    @Override
-    public ResolvedJavaType asExactType() {
-        return this;
-    }
-
-    @Override
-    public ResolvedJavaType getSuperclass() {
-        assert javaMirror.getSuperclass() == null;
-        return null;
-    }
-
-    @Override
-    public ResolvedJavaType[] getInterfaces() {
-        return new ResolvedJavaType[0];
-    }
-
-    @Override
-    public ResolvedJavaType findLeastCommonAncestor(ResolvedJavaType otherType) {
-        return null;
-    }
-
-    @Override
-    public Constant getEncoding(Representation r) {
-        throw GraalInternalError.unimplemented("HotSpotTypePrimitive.getEncoding");
-    }
-
-    @Override
-    public boolean hasFinalizableSubclass() {
-        return false;
-    }
-
-    @Override
-    public boolean hasFinalizer() {
-        return false;
-    }
-
-    @Override
-    public boolean isArray() {
-        return false;
-    }
-
-    @Override
-    public boolean isPrimitive() {
-        return true;
-    }
-
-    @Override
-    public boolean isInitialized() {
-        return true;
-    }
-
-    @Override
-    public boolean isInstance(Constant obj) {
-        return false;
-    }
-
-    @Override
-    public boolean isInstanceClass() {
-        return false;
-    }
-
-    @Override
-    public boolean isInterface() {
-        return false;
-    }
-
-    @Override
-    public boolean isAssignableTo(ResolvedJavaType other) {
-        return other == this;
-    }
-
-    @Override
-    public Kind getKind() {
-        return kind;
-    }
-
-    @Override
-    public ResolvedJavaMethod resolveMethod(ResolvedJavaMethod method) {
-        return null;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotTypePrimitive<" + kind + ">";
-    }
-
-    @Override
-    public ResolvedJavaType findUniqueConcreteSubtype() {
-        return this;
-    }
-
-    @Override
-    public ResolvedJavaMethod findUniqueConcreteMethod(ResolvedJavaMethod method) {
-        return null;
-    }
-
-    @Override
-    public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) {
-        return new ResolvedJavaField[0];
-    }
-
-    @Override
-    public <T extends Annotation> T getAnnotation(Class<T> annotationClass) {
-        return javaMirror.getAnnotation(annotationClass);
-    }
-
-    @Override
-    public boolean isClass(Class c) {
-        return c == javaMirror;
-    }
-
-    @Override
-    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
-        return this;
-    }
-
-    @Override
-    public void initialize() {
-    }
-
-    @Override
-    public ResolvedJavaField findInstanceFieldWithOffset(long offset) {
-        return null;
-    }
-
-    @Override
-    public Class<?> mirror() {
-        return javaMirror;
-    }
-}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotTypeUnresolved.java	Wed Nov 28 12:18:34 2012 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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.hotspot.meta;
-
-import com.oracle.graal.api.meta.*;
-import com.oracle.graal.hotspot.*;
-
-/**
- * Implementation of {@link JavaType} for unresolved HotSpot classes.
- */
-public class HotSpotTypeUnresolved extends HotSpotJavaType {
-
-    private static final long serialVersionUID = -2320936267633521314L;
-    public final String simpleName;
-    public final int dimensions;
-
-    public HotSpotTypeUnresolved(String name, String simpleName, int dimensions) {
-        super(name);
-        assert dimensions >= 0;
-        this.simpleName = simpleName;
-        this.dimensions = dimensions;
-    }
-
-    public static String getFullName(String name, int dimensions) {
-        StringBuilder str = new StringBuilder(name.length() + dimensions + 2);
-        for (int i = 0; i < dimensions; i++) {
-            str.append('[');
-        }
-        str.append('L').append(name).append(';');
-        return str.toString();
-    }
-
-    @Override
-    public JavaType getComponentType() {
-        assert dimensions > 0 : "no array class" + getName();
-        String name = getFullName(getName(), dimensions - 1);
-        return new HotSpotTypeUnresolved(name, simpleName, dimensions - 1);
-    }
-
-    @Override
-    public JavaType getArrayClass() {
-        String name = getFullName(getName(), dimensions + 1);
-        return new HotSpotTypeUnresolved(name, simpleName, dimensions + 1);
-    }
-
-    @Override
-    public Kind getKind() {
-        return Kind.Object;
-    }
-
-    @Override
-    public int hashCode() {
-        return simpleName.hashCode();
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        return o == this;
-    }
-
-    @Override
-    public String toString() {
-        return "HotSpotType<" + simpleName + ", unresolved>";
-    }
-
-    @Override
-    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
-        return (ResolvedJavaType) HotSpotGraalRuntime.getInstance().lookupType(getName(), (HotSpotResolvedJavaType) accessingClass, true);
-    }
-}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotUnresolvedJavaType.java	Wed Nov 28 14:07:25 2012 +0100
@@ -0,0 +1,90 @@
+/*
+ * 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.hotspot.meta;
+
+import com.oracle.graal.api.meta.*;
+import com.oracle.graal.hotspot.*;
+
+/**
+ * Implementation of {@link JavaType} for unresolved HotSpot classes.
+ */
+public class HotSpotUnresolvedJavaType extends HotSpotJavaType {
+
+    private static final long serialVersionUID = -2320936267633521314L;
+    public final String simpleName;
+    public final int dimensions;
+
+    public HotSpotUnresolvedJavaType(String name, String simpleName, int dimensions) {
+        super(name);
+        assert dimensions >= 0;
+        this.simpleName = simpleName;
+        this.dimensions = dimensions;
+    }
+
+    public static String getFullName(String name, int dimensions) {
+        StringBuilder str = new StringBuilder(name.length() + dimensions + 2);
+        for (int i = 0; i < dimensions; i++) {
+            str.append('[');
+        }
+        str.append('L').append(name).append(';');
+        return str.toString();
+    }
+
+    @Override
+    public JavaType getComponentType() {
+        assert dimensions > 0 : "no array class" + getName();
+        String name = getFullName(getName(), dimensions - 1);
+        return new HotSpotUnresolvedJavaType(name, simpleName, dimensions - 1);
+    }
+
+    @Override
+    public JavaType getArrayClass() {
+        String name = getFullName(getName(), dimensions + 1);
+        return new HotSpotUnresolvedJavaType(name, simpleName, dimensions + 1);
+    }
+
+    @Override
+    public Kind getKind() {
+        return Kind.Object;
+    }
+
+    @Override
+    public int hashCode() {
+        return simpleName.hashCode();
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        return o == this;
+    }
+
+    @Override
+    public String toString() {
+        return "HotSpotType<" + simpleName + ", unresolved>";
+    }
+
+    @Override
+    public ResolvedJavaType resolve(ResolvedJavaType accessingClass) {
+        return (ResolvedJavaType) HotSpotGraalRuntime.getInstance().lookupType(getName(), (HotSpotResolvedObjectType) accessingClass, true);
+    }
+}
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewArrayStubCall.java	Wed Nov 28 14:07:25 2012 +0100
@@ -60,7 +60,7 @@
     @Override
     public boolean inferStamp() {
         if (stamp() == defaultStamp && hub.isConstant()) {
-            updateStamp(StampFactory.exactNonNull(HotSpotResolvedJavaType.fromMetaspaceKlass(hub.asConstant())));
+            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asConstant())));
             return true;
         }
         return false;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewInstanceStubCall.java	Wed Nov 28 14:07:25 2012 +0100
@@ -54,7 +54,7 @@
     @Override
     public boolean inferStamp() {
         if (stamp() == defaultStamp && hub.isConstant()) {
-            updateStamp(StampFactory.exactNonNull(HotSpotResolvedJavaType.fromMetaspaceKlass(hub.asConstant())));
+            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asConstant())));
             return true;
         }
         return false;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/NewMultiArrayStubCall.java	Wed Nov 28 14:07:25 2012 +0100
@@ -58,7 +58,7 @@
     @Override
     public boolean inferStamp() {
         if (stamp() == defaultStamp && hub.isConstant()) {
-            updateStamp(StampFactory.exactNonNull(HotSpotResolvedJavaType.fromMetaspaceKlass(hub.asConstant())));
+            updateStamp(StampFactory.exactNonNull(HotSpotResolvedObjectType.fromMetaspaceKlass(hub.asConstant())));
             return true;
         }
         return false;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Wed Nov 28 14:07:25 2012 +0100
@@ -250,7 +250,7 @@
         public void lower(CheckCastNode checkcast, LoweringTool tool) {
             StructuredGraph graph = (StructuredGraph) checkcast.graph();
             ValueNode object = checkcast.object();
-            final HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) checkcast.type();
+            final HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) checkcast.type();
             TypeCheckHints hintInfo = new TypeCheckHints(checkcast.type(), checkcast.profile(), tool.assumptions(), GraalOptions.CheckcastMinHintHitProbability, GraalOptions.CheckcastMaxHints);
             ValueNode hub = ConstantNode.forConstant(type.klass(), runtime, checkcast.graph());
             boolean checkNull = !object.stamp().nonNull();
@@ -297,7 +297,7 @@
         static ConstantNode[] createHints(TypeCheckHints hints, MetaAccessProvider runtime, Graph graph) {
             ConstantNode[] hintHubs = new ConstantNode[hints.types.length];
             for (int i = 0; i < hintHubs.length; i++) {
-                hintHubs[i] = ConstantNode.forConstant(((HotSpotResolvedJavaType) hints.types[i]).klass(), runtime, graph);
+                hintHubs[i] = ConstantNode.forConstant(((HotSpotResolvedObjectType) hints.types[i]).klass(), runtime, graph);
             }
             return hintHubs;
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/InstanceOfSnippets.java	Wed Nov 28 14:07:25 2012 +0100
@@ -179,7 +179,7 @@
             ValueNode falseValue = replacer.falseValue;
             ValueNode object = instanceOf.object();
             TypeCheckHints hintInfo = new TypeCheckHints(instanceOf.type(), instanceOf.profile(), tool.assumptions(), GraalOptions.InstanceOfMinHintHitProbability, GraalOptions.InstanceOfMaxHints);
-            final HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) instanceOf.type();
+            final HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) instanceOf.type();
             ConstantNode hub = ConstantNode.forConstant(type.klass(), runtime, instanceOf.graph());
             boolean checkNull = !object.stamp().nonNull();
             Arguments arguments;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java	Wed Nov 28 12:18:34 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java	Wed Nov 28 14:07:25 2012 +0100
@@ -265,7 +265,7 @@
         @SuppressWarnings("unused")
         public void lower(NewInstanceNode newInstanceNode, LoweringTool tool) {
             StructuredGraph graph = (StructuredGraph) newInstanceNode.graph();
-            HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) newInstanceNode.instanceClass();
+            HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) newInstanceNode.instanceClass();
             ConstantNode hub = ConstantNode.forConstant(type.klass(), runtime, graph);
             int size = type.instanceSize();
             assert (size % wordSize()) == 0;
@@ -341,7 +341,7 @@
         @SuppressWarnings("unused")
         public void lower(InitializeObjectNode initializeNode, LoweringTool tool) {
             StructuredGraph graph = (StructuredGraph) initializeNode.graph();
-            HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) initializeNode.type();
+            HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) initializeNode.type();
             assert !type.isArray();
             ConstantNode hub = ConstantNode.forConstant(type.klass(), runtime, graph);
             int size = type.instanceSize();
@@ -358,7 +358,7 @@
         @SuppressWarnings("unused")
         public void lower(InitializeArrayNode initializeNode, LoweringTool tool) {
             StructuredGraph graph = (StructuredGraph) initializeNode.graph();
-            HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) initializeNode.type();
+            HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) initializeNode.type();
             ResolvedJavaType elementType = type.getComponentType();
             assert elementType != null;
             ConstantNode hub = ConstantNode.forConstant(type.klass(), runtime, graph);
@@ -380,7 +380,7 @@
             for (int i = 0; i < newmultiarrayNode.dimensionCount(); i++) {
                 dims[i] = newmultiarrayNode.dimension(i);
             }
-            HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) newmultiarrayNode.type();
+            HotSpotResolvedObjectType type = (HotSpotResolvedObjectType) newmultiarrayNode.type();
             ConstantNode hub = ConstantNode.forConstant(type.klass(), runtime, graph);
             Key key = new Key(newmultiarray).add("dimensions", vargargs(new int[rank], StampFactory.forKind(Kind.Int))).add("rank", rank);
             Arguments arguments = arguments("dimensions", dims).add("hub", hub);
--- a/src/share/vm/classfile/systemDictionary.hpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/classfile/systemDictionary.hpp	Wed Nov 28 14:07:25 2012 +0100
@@ -191,7 +191,7 @@
   do_klass(HotSpotMethodData_klass,               com_oracle_graal_hotspot_meta_HotSpotMethodData,              Opt) \
   do_klass(HotSpotResolvedJavaField_klass,        com_oracle_graal_hotspot_meta_HotSpotResolvedJavaField,       Opt) \
   do_klass(HotSpotResolvedJavaMethod_klass,       com_oracle_graal_hotspot_meta_HotSpotResolvedJavaMethod,      Opt) \
-  do_klass(HotSpotResolvedJavaType_klass,         com_oracle_graal_hotspot_meta_HotSpotResolvedJavaType,        Opt) \
+  do_klass(HotSpotResolvedObjectType_klass,       com_oracle_graal_hotspot_meta_HotSpotResolvedObjectType,      Opt) \
   /* graal.api.code */                                                                                               \
   do_klass(Assumptions_klass,                     com_oracle_graal_api_code_Assumptions,                        Opt) \
   do_klass(Assumptions_ConcreteMethod_klass,      com_oracle_graal_api_code_Assumptions_ConcreteMethod,         Opt) \
--- a/src/share/vm/classfile/vmSymbols.hpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/classfile/vmSymbols.hpp	Wed Nov 28 14:07:25 2012 +0100
@@ -290,7 +290,7 @@
   template(com_oracle_graal_hotspot_meta_HotSpotMethodData,          "com/oracle/graal/hotspot/meta/HotSpotMethodData")               \
   template(com_oracle_graal_hotspot_meta_HotSpotResolvedJavaField,   "com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField")        \
   template(com_oracle_graal_hotspot_meta_HotSpotResolvedJavaMethod,  "com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod")       \
-  template(com_oracle_graal_hotspot_meta_HotSpotResolvedJavaType,    "com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType")         \
+  template(com_oracle_graal_hotspot_meta_HotSpotResolvedObjectType,  "com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType")       \
   AMD64_ONLY(template(com_oracle_graal_hotspot_amd64_AMD64HotSpotGraalRuntime,"com/oracle/graal/hotspot/amd64/AMD64HotSpotGraalRuntime"))\
   /* graal.api.meta */                                                                                                                \
   template(com_oracle_graal_api_meta_Constant,                       "com/oracle/graal/api/meta/Constant")                            \
@@ -325,7 +325,7 @@
   template(bootstrap_name,                        "bootstrap")                                                                        \
   template(shutdownCompiler_name,                 "shutdownCompiler")                                                                 \
   template(compileMethod_name,                    "compileMethod")                                                                    \
-  template(compileMethod_signature,               "(JLcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaType;IZI)Z")                   \
+  template(compileMethod_signature,               "(JLcom/oracle/graal/hotspot/meta/HotSpotResolvedObjectType;IZI)Z")                 \
   template(setOption_name,                        "setOption")                                                                        \
   template(setDefaultOptions_name,                "setDefaultOptions")                                                                \
   template(setOption_signature,                   "(Ljava/lang/String;)Z")                                                            \
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Wed Nov 28 14:07:25 2012 +0100
@@ -102,7 +102,7 @@
   return map;
 }
 
-// Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedJavaType.klass()).
+// Records any Metadata values embedded in a Constant (e.g., the value returned by HotSpotResolvedObjectType.klass()).
 static void record_metadata_in_constant(oop constant, OopRecorder* oop_recorder) {
   char kind = Kind::typeChar(Constant::kind(constant));
   char wordKind = 'j';
@@ -110,8 +110,8 @@
     oop obj = Constant::object(constant);
     jlong prim = Constant::primitive(constant);
     if (obj != NULL) {
-      if (obj->is_a(HotSpotResolvedJavaType::klass())) {
-        Klass* klass = (Klass*) (address) HotSpotResolvedJavaType::metaspaceKlass(obj);
+      if (obj->is_a(HotSpotResolvedObjectType::klass())) {
+        Klass* klass = (Klass*) (address) HotSpotResolvedObjectType::metaspaceKlass(obj);
         assert((Klass*) prim == klass, err_msg("%s @ %p != %p", klass->name()->as_C_string(), klass, prim));
         int index = oop_recorder->find_index(klass);
         TRACE_graal_3("metadata[%d of %d] = %s", index, oop_recorder->metadata_count(), klass->name()->as_C_string());
@@ -199,7 +199,7 @@
   } else if (value->is_a(VirtualObject::klass())) {
     oop type = VirtualObject::type(value);
     int id = VirtualObject::id(value);
-    oop javaMirror = HotSpotResolvedJavaType::javaMirror(type);
+    oop javaMirror = HotSpotResolvedObjectType::javaMirror(type);
     Klass* klass = java_lang_Class::as_Klass(javaMirror);
     bool isLongArray = klass == Universe::longArrayKlassObj();
 
@@ -412,10 +412,10 @@
 
 void CodeInstaller::assumption_ConcreteSubtype(Handle assumption) {
   Handle context_handle = Assumptions_ConcreteSubtype::context(assumption());
-  ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(context_handle)));
+  ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(context_handle)));
 
   Handle type_handle = Assumptions_ConcreteSubtype::subtype(assumption());
-  ciKlass* type = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(type_handle)));
+  ciKlass* type = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(type_handle)));
 
   _dependencies->assert_leaf_type(type);
   if (context != type) {
@@ -430,7 +430,7 @@
   ciMethod* m = (ciMethod*) CURRENT_ENV->get_method(impl());
   
   Handle context_handle = Assumptions_ConcreteMethod::context(assumption());
-  ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(context_handle)));
+  ciKlass* context = (ciKlass*) CURRENT_ENV->get_klass(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(context_handle)));
   _dependencies->assert_unique_concrete_method(context, m);
 }
 
--- a/src/share/vm/graal/graalCompiler.cpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/graal/graalCompiler.cpp	Wed Nov 28 14:07:25 2012 +0100
@@ -164,7 +164,7 @@
   ciEnv* current_env = JavaThread::current()->env();
   JavaThread::current()->set_env(NULL);
   JavaThread::current()->set_compiling(true);
-  Handle holder = GraalCompiler::createHotSpotResolvedJavaType(method, CHECK);
+  Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK);
   jboolean success = VMToCompiler::compileMethod(method(), holder, entry_bci, blocking, method->graal_priority());
   JavaThread::current()->set_compiling(false);
   JavaThread::current()->set_env(current_env);
@@ -253,13 +253,13 @@
   } else {
     KlassHandle klass = java_lang_Class::as_Klass(java_class());
     Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL);
-    return GraalCompiler::createHotSpotResolvedJavaType(klass, name, CHECK_NULL);
+    return GraalCompiler::createHotSpotResolvedObjectType(klass, name, CHECK_NULL);
   }
 }
 
 Handle GraalCompiler::get_JavaType(KlassHandle klass, TRAPS) {
   Handle name = VmIds::toString<Handle>(klass->name(), THREAD);
-  return createHotSpotResolvedJavaType(klass, name, CHECK_NULL);
+  return createHotSpotResolvedObjectType(klass, name, CHECK_NULL);
 }
 
 Handle GraalCompiler::get_JavaField(int offset, int flags, Symbol* field_name, Handle field_holder, Handle field_type, TRAPS) {
@@ -267,23 +267,23 @@
   return VMToCompiler::createJavaField(field_holder, name, field_type, offset, flags, false, CHECK_NULL);
 }
 
-Handle GraalCompiler::createHotSpotResolvedJavaType(methodHandle method, TRAPS) {
+Handle GraalCompiler::createHotSpotResolvedObjectType(methodHandle method, TRAPS) {
   KlassHandle klass = method->method_holder();
   oop java_class = klass->java_mirror();
   oop graal_mirror = java_lang_Class::graal_mirror(java_class);
   if (graal_mirror != NULL) {
-    assert(graal_mirror->is_a(HotSpotResolvedJavaType::klass()), "unexpected class...");
+    assert(graal_mirror->is_a(HotSpotResolvedObjectType::klass()), "unexpected class...");
     return graal_mirror;
   }
   Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL);
-  return GraalCompiler::createHotSpotResolvedJavaType(klass, name, CHECK_NULL);
+  return GraalCompiler::createHotSpotResolvedObjectType(klass, name, CHECK_NULL);
 }
 
-Handle GraalCompiler::createHotSpotResolvedJavaType(KlassHandle klass, Handle name, TRAPS) {
+Handle GraalCompiler::createHotSpotResolvedObjectType(KlassHandle klass, Handle name, TRAPS) {
   oop java_class = klass->java_mirror();
   oop graal_mirror = java_lang_Class::graal_mirror(java_class);
   if (graal_mirror != NULL) {
-    assert(graal_mirror->is_a(HotSpotResolvedJavaType::klass()), "unexpected class...");
+    assert(graal_mirror->is_a(HotSpotResolvedObjectType::klass()), "unexpected class...");
     return graal_mirror;
   }
 
@@ -299,9 +299,9 @@
 
   int sizeOrSpecies;
   if (klass->is_interface()) {
-    sizeOrSpecies = (int) 0x80000000; // see HotSpotResolvedJavaType.INTERFACE_SPECIES_VALUE
+    sizeOrSpecies = (int) 0x80000000; // see HotSpotResolvedObjectType.INTERFACE_SPECIES_VALUE
   } else if (klass->oop_is_array()) {
-    sizeOrSpecies = (int) 0x7fffffff; // see HotSpotResolvedJavaType.ARRAY_SPECIES_VALUE
+    sizeOrSpecies = (int) 0x7fffffff; // see HotSpotResolvedObjectType.ARRAY_SPECIES_VALUE
   } else {
     sizeOrSpecies = InstanceKlass::cast(klass())->size_helper() * HeapWordSize;
     if (!InstanceKlass::cast(klass())->can_be_fastpath_allocated()) {
--- a/src/share/vm/graal/graalCompiler.hpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/graal/graalCompiler.hpp	Wed Nov 28 14:07:25 2012 +0100
@@ -77,8 +77,8 @@
   static Handle get_JavaType(KlassHandle klass, TRAPS);
   static Handle get_JavaField(int offset, int flags, Symbol* field_name, Handle field_holder, Handle field_type, TRAPS);
 
-  static Handle createHotSpotResolvedJavaType(KlassHandle klass, Handle name, TRAPS);
-  static Handle createHotSpotResolvedJavaType(methodHandle method, TRAPS);
+  static Handle createHotSpotResolvedObjectType(KlassHandle klass, Handle name, TRAPS);
+  static Handle createHotSpotResolvedObjectType(methodHandle method, TRAPS);
 
   void exit();
 
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Wed Nov 28 14:07:25 2012 +0100
@@ -147,7 +147,7 @@
       ConstantPool* cp = InstanceKlass::cast(method->method_holder())->constants();
       KlassHandle loading_klass = method->method_holder();
       Handle catch_class = GraalCompiler::get_JavaType(cp, catch_class_index, loading_klass, CHECK_NULL);
-      if (catch_class->klass() == HotSpotResolvedJavaType::klass() && java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(catch_class)) == SystemDictionary::Throwable_klass()) {
+      if (catch_class->klass() == HotSpotResolvedObjectType::klass() && java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(catch_class)) == SystemDictionary::Throwable_klass()) {
         ExceptionHandler::set_catchType(entry, NULL);
         ExceptionHandler::set_catchTypeCPI(entry, 0);
       } else {
@@ -190,7 +190,7 @@
   int slot = java_lang_reflect_Method::slot(reflection_method);
   Klass* holder = java_lang_Class::as_Klass(reflection_holder);
   methodHandle method = InstanceKlass::cast(holder)->method_with_idnum(slot);
-  Handle type = GraalCompiler::createHotSpotResolvedJavaType(method, CHECK_0);
+  Handle type = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK_0);
   objArrayOop(JNIHandles::resolve(resultHolder))->obj_at_put(0, type());
   return (jlong) (address) method();
 }
@@ -201,7 +201,7 @@
   int slot = java_lang_reflect_Constructor::slot(reflection_ctor);
   Klass* holder = java_lang_Class::as_Klass(reflection_holder);
   methodHandle method = InstanceKlass::cast(holder)->method_with_idnum(slot);
-  Handle type = GraalCompiler::createHotSpotResolvedJavaType(method, CHECK_0);
+  Handle type = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK_0);
   objArrayOop(JNIHandles::resolve(resultHolder))->obj_at_put(0, type());
   return (jlong) (address) method();
 }
@@ -246,7 +246,7 @@
     return 0L;
   }
 
-  Handle type = GraalCompiler::createHotSpotResolvedJavaType(ucm(), CHECK_0);
+  Handle type = GraalCompiler::createHotSpotResolvedObjectType(ucm(), CHECK_0);
   objArrayOop(JNIHandles::resolve(resultHolder))->obj_at_put(0, type());
   return (jlong) (address) ucm();
 C2V_END
@@ -338,8 +338,8 @@
     Handle classloader;
     Handle protectionDomain;
     if (JNIHandles::resolve(accessingClass) != NULL) {
-      classloader = java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(accessingClass))->class_loader();
-      protectionDomain = java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(accessingClass))->protection_domain();
+      classloader = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(accessingClass))->class_loader();
+      protectionDomain = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(accessingClass))->protection_domain();
     }
 
     if (eagerResolve) {
@@ -354,7 +354,7 @@
         Handle type = VMToCompiler::createUnresolvedJavaType(name, THREAD);
         result = type();
       } else {
-        Handle type = GraalCompiler::createHotSpotResolvedJavaType(resolved_type, name, CHECK_NULL);
+        Handle type = GraalCompiler::createHotSpotResolvedObjectType(resolved_type, name, CHECK_NULL);
         result = type();
       }
     }
@@ -365,7 +365,7 @@
 
 C2V_VMENTRY(jobject, lookupConstantInPool, (JNIEnv *env, jobject, jobject type, jint index))
 
-  ConstantPool* cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(type)))->constants();
+  ConstantPool* cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(type)))->constants();
 
   oop result = NULL;
   constantTag tag = cp->tag_at(index);
@@ -409,7 +409,7 @@
 
 C2V_VMENTRY(jobject, lookupMethodInPool, (JNIEnv *env, jobject, jobject type, jint index, jbyte opcode))
   index = GraalCompiler::to_cp_index_u2(index);
-  constantPoolHandle cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(type)))->constants();
+  constantPoolHandle cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(type)))->constants();
   instanceKlassHandle pool_holder(cp->pool_holder());
 
   Bytecodes::Code bc = (Bytecodes::Code) (((int) opcode) & 0xFF);
@@ -429,13 +429,13 @@
 
 C2V_VMENTRY(jobject, lookupTypeInPool, (JNIEnv *env, jobject, jobject type, jint index))
 
-  ConstantPool* cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(type)))->constants();
+  ConstantPool* cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(type)))->constants();
   Handle result = GraalCompiler::get_JavaType(cp, index, cp->pool_holder(), CHECK_NULL);
   return JNIHandles::make_local(THREAD, result());
 C2V_END
 
 C2V_VMENTRY(void, lookupReferencedTypeInPool, (JNIEnv *env, jobject, jobject type, jint index, jbyte op))
-  ConstantPool* cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(type)))->constants();
+  ConstantPool* cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(type)))->constants();
   int opcode = (op & 0xFF);
   if (opcode != Bytecodes::_checkcast && opcode != Bytecodes::_instanceof && opcode != Bytecodes::_new && opcode != Bytecodes::_anewarray
       && opcode != Bytecodes::_multianewarray && opcode != Bytecodes::_ldc && opcode != Bytecodes::_ldc_w && opcode != Bytecodes::_ldc2_w)
@@ -460,7 +460,7 @@
   ResourceMark rm;
 
   index = GraalCompiler::to_cp_index_u2(index);
-  constantPoolHandle cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(constantPoolHolder)))->constants();
+  constantPoolHandle cp = InstanceKlass::cast(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(constantPoolHolder)))->constants();
 
   int nt_index = cp->name_and_type_ref_index_at(index);
   int sig_index = cp->signature_ref_index_at(nt_index);
@@ -475,7 +475,7 @@
   int offset = -1;
   AccessFlags flags;
   BasicType basic_type;
-  if (holder->klass() == SystemDictionary::HotSpotResolvedJavaType_klass()) {
+  if (holder->klass() == SystemDictionary::HotSpotResolvedObjectType_klass()) {
     FieldAccessInfo result;
     LinkResolver::resolve_field(result, cp, index,
                                 Bytecodes::java_code(code),
@@ -500,7 +500,7 @@
 C2V_VMENTRY(jobject, resolveMethod, (JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature))
 
   assert(JNIHandles::resolve(resolved_type) != NULL, "");
-  Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(resolved_type));
+  Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(resolved_type));
   Symbol* name_symbol = VmIds::toSymbol(name);
   Symbol* signature_symbol = VmIds::toSymbol(signature);
   methodHandle method = klass->lookup_method(name_symbol, signature_symbol);
@@ -516,7 +516,7 @@
 C2V_END
 
 C2V_VMENTRY(jlong, getPrototypeMarkWord, (JNIEnv *, jobject, jobject klass))
-  KlassHandle klass_handle(java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(klass)));
+  KlassHandle klass_handle(java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(klass)));
   if (klass_handle->oop_is_array()) {
     return (int32_t)(intptr_t) markOopDesc::prototype();
   } else {
@@ -525,13 +525,13 @@
 C2V_END
 
 C2V_VMENTRY(jboolean, isTypeInitialized,(JNIEnv *, jobject, jobject hotspot_klass))
-  Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(hotspot_klass));
+  Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(hotspot_klass));
   assert(klass != NULL, "method must not be called for primitive types");
   return InstanceKlass::cast(klass)->is_initialized();
 C2V_END
 
 C2V_VMENTRY(void, initializeType, (JNIEnv *, jobject, jobject hotspot_klass))
-  Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(hotspot_klass));
+  Klass* klass = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(hotspot_klass));
   assert(klass != NULL, "method must not be called for primitive types");
   InstanceKlass::cast(klass)->initialize(JavaThread::current());
 C2V_END
@@ -539,7 +539,7 @@
 C2V_VMENTRY(jobject, getInstanceFields, (JNIEnv *, jobject, jobject klass))
   ResourceMark rm;
 
-  instanceKlassHandle k = java_lang_Class::as_Klass(HotSpotResolvedJavaType::javaMirror(klass));
+  instanceKlassHandle k = java_lang_Class::as_Klass(HotSpotResolvedObjectType::javaMirror(klass));
   GrowableArray<Handle> fields(k->java_fields_count());
 
   for (AllFieldStream fs(k()); !fs.done(); fs.next()) {
@@ -909,7 +909,7 @@
 #define OBJECT                "Ljava/lang/Object;"
 #define CLASS                 "Ljava/lang/Class;"
 #define STACK_TRACE_ELEMENT   "Ljava/lang/StackTraceElement;"
-#define HS_RESOLVED_TYPE      "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaType;"
+#define HS_RESOLVED_TYPE      "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedObjectType;"
 #define HS_RESOLVED_METHOD    "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod;"
 #define HS_RESOLVED_FIELD     "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaField;"
 #define HS_COMP_RESULT        "Lcom/oracle/graal/hotspot/HotSpotCompilationResult;"
--- a/src/share/vm/graal/graalJavaAccess.hpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Wed Nov 28 14:07:25 2012 +0100
@@ -48,13 +48,13 @@
  */
 
 #define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, float_field, oop_field, static_oop_field)                \
-  start_class(HotSpotResolvedJavaType)                                                                                                                         \
-    long_field(HotSpotResolvedJavaType, metaspaceKlass)                                                                                                        \
-    oop_field(HotSpotResolvedJavaType, javaMirror, "Ljava/lang/Class;")                                                                                        \
+  start_class(HotSpotResolvedObjectType)                                                                                                                         \
+    long_field(HotSpotResolvedObjectType, metaspaceKlass)                                                                                                      \
+    oop_field(HotSpotResolvedObjectType, javaMirror, "Ljava/lang/Class;")                                                                                      \
   end_class                                                                                                                                                    \
   start_class(HotSpotResolvedJavaMethod)                                                                                                                       \
     oop_field(HotSpotResolvedJavaMethod, name, "Ljava/lang/String;")                                                                                           \
-    oop_field(HotSpotResolvedJavaMethod, holder, "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaType;")                                                    \
+    oop_field(HotSpotResolvedJavaMethod, holder, "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedObjectType;")                                                  \
     long_field(HotSpotResolvedJavaMethod, metaspaceMethod)                                                                                                     \
     int_field(HotSpotResolvedJavaMethod, codeSize)                                                                                                             \
     int_field(HotSpotResolvedJavaMethod, exceptionHandlerCount)                                                                                                \
--- a/src/share/vm/oops/klass.hpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/oops/klass.hpp	Wed Nov 28 14:07:25 2012 +0100
@@ -148,7 +148,7 @@
   // java/lang/Class instance mirroring this class
   oop       _java_mirror;
 #ifdef GRAAL
-  // com/oracle/graal/hotspot/HotSpotResolvedJavaType mirroring this class
+  // com/oracle/graal/hotspot/HotSpotResolvedObjectType mirroring this class
   oop       _graal_mirror;
 #endif
   // Superclass
--- a/src/share/vm/runtime/deoptimization.cpp	Wed Nov 28 12:18:34 2012 +0100
+++ b/src/share/vm/runtime/deoptimization.cpp	Wed Nov 28 14:07:25 2012 +0100
@@ -944,7 +944,7 @@
 
 #ifdef GRAAL
 // Restore fields of an eliminated instance object using the same field order
-// returned by HotSpotResolvedJavaType.getInstanceFields(true)
+// returned by HotSpotResolvedObjectType.getInstanceFields(true)
 static int reassign_fields_by_klass(InstanceKlass* klass, frame* fr, RegisterMap* reg_map, ObjectValue* sv, int svIndex, oop obj) {
   if (klass->superklass() != NULL) {
     svIndex = reassign_fields_by_klass(klass->superklass(), fr, reg_map, sv, svIndex, obj);