changeset 1422:3483ec571caf

* using reflected objects instead of oops * removed scratch from allocatable registers * instanceof xir snippet * arraylength xir snippet * exceptionobject xir snippet * VMEntries and VMExits as interfaces * calls to VMEntries and VMExits are routet through logging proxies
author Lukas Stadler <lukas.stadler@oracle.com>
date Mon, 02 Aug 2010 15:44:38 -0700
parents 6223633ce7dd
children 760213a60e8b
files .cproject .project .settings/org.eclipse.cdt.ui.prefs c1x4hotspotsrc/HotSpotVM/.settings/org.eclipse.jdt.core.prefs c1x4hotspotsrc/HotSpotVM/.settings/org.eclipse.jdt.ui.prefs c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotConstantPool.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotField.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethod.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotSignature.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTargetMethod.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotType.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotVMConfig.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Logger.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/LoggingProxy.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExits.java c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java src/cpu/x86/vm/assembler_x86.cpp src/share/vm/c1x/c1x_Compiler.cpp src/share/vm/c1x/c1x_Compiler.hpp src/share/vm/c1x/c1x_VMEntries.cpp src/share/vm/c1x/c1x_VMEntries.hpp src/share/vm/c1x/c1x_VMExits.cpp src/share/vm/c1x/c1x_VMExits.hpp src/share/vm/ci/ciInstanceKlass.cpp src/share/vm/ci/ciObject.cpp src/share/vm/classfile/vmSymbols.hpp src/share/vm/includeDB_compiler1
diffstat 33 files changed, 682 insertions(+), 472 deletions(-) [+]
line wrap: on
line diff
--- a/.cproject	Fri Jul 23 15:53:02 2010 -0700
+++ b/.cproject	Mon Aug 02 15:44:38 2010 -0700
@@ -79,6 +79,7 @@
 			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
 			<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
 			<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+			<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
 			<storageModule moduleId="scannerConfiguration">
 				<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
 				<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
@@ -327,7 +328,7 @@
 						</scannerInfoProvider>
 					</profile>
 				</scannerConfigBuildInfo>
-				<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.solaris.base.945602881;cdt.managedbuild.toolchain.gnu.solaris.base.945602881.388217325;cdt.managedbuild.tool.gnu.solaris.c.compiler.base.212558466;cdt.managedbuild.tool.gnu.c.compiler.input.1115218695">
+				<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.solaris.base.945602881;cdt.managedbuild.toolchain.gnu.solaris.base.945602881.305678577;cdt.managedbuild.tool.gnu.solaris.c.compiler.base.351149667;cdt.managedbuild.tool.gnu.c.compiler.input.820447325">
 					<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
 					<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
 						<buildOutputProvider>
@@ -410,7 +411,7 @@
 						</scannerInfoProvider>
 					</profile>
 				</scannerConfigBuildInfo>
-				<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.solaris.base.945602881;cdt.managedbuild.toolchain.gnu.solaris.base.945602881.305678577;cdt.managedbuild.tool.gnu.solaris.c.compiler.base.351149667;cdt.managedbuild.tool.gnu.c.compiler.input.820447325">
+				<scannerConfigBuildInfo instanceId="cdt.managedbuild.toolchain.gnu.solaris.base.945602881;cdt.managedbuild.toolchain.gnu.solaris.base.945602881.388217325;cdt.managedbuild.tool.gnu.solaris.c.compiler.base.212558466;cdt.managedbuild.tool.gnu.c.compiler.input.1115218695">
 					<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
 					<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
 						<buildOutputProvider>
--- a/.project	Fri Jul 23 15:53:02 2010 -0700
+++ b/.project	Mon Aug 02 15:44:38 2010 -0700
@@ -3,9 +3,6 @@
 	<name>c1x4hotspot</name>
 	<comment></comment>
 	<projects>
-		<project>C1X</project>
-		<project>CRI</project>
-		<project>HotSpotVM</project>
 	</projects>
 	<buildSpec>
 		<buildCommand>
--- a/.settings/org.eclipse.cdt.ui.prefs	Fri Jul 23 15:53:02 2010 -0700
+++ b/.settings/org.eclipse.cdt.ui.prefs	Mon Aug 02 15:44:38 2010 -0700
@@ -1,4 +1,3 @@
-#Wed Jul 21 16:31:58 PDT 2010
+#Fri Jul 23 16:07:26 PDT 2010
 eclipse.preferences.version=1
-formatter_profile=org.eclipse.cdt.ui.default.gnu_profile
 formatter_settings_version=1
--- a/c1x4hotspotsrc/HotSpotVM/.settings/org.eclipse.jdt.core.prefs	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/.settings/org.eclipse.jdt.core.prefs	Mon Aug 02 15:44:38 2010 -0700
@@ -1,4 +1,4 @@
-#Wed Jul 07 17:26:56 PDT 2010
+#Fri Jul 23 17:15:04 PDT 2010
 eclipse.preferences.version=1
 org.eclipse.jdt.core.builder.cleanOutputFolder=clean
 org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -15,6 +15,8 @@
 org.eclipse.jdt.core.codeComplete.localSuffixes=
 org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
 org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes=
+org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes=
 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
@@ -109,6 +111,7 @@
 org.eclipse.jdt.core.compiler.taskTags=TODO,FIXME,XXX
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
@@ -119,6 +122,7 @@
 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
@@ -165,10 +169,15 @@
 org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
 org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
 org.eclipse.jdt.core.formatter.comment.line_length=120
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
 org.eclipse.jdt.core.formatter.compact_else_if=true
 org.eclipse.jdt.core.formatter.continuation_indentation=4
 org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
 org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
 org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
 org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
 org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
@@ -184,6 +193,7 @@
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
@@ -254,7 +264,7 @@
 org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
 org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
@@ -340,7 +350,7 @@
 org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
-org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
@@ -366,7 +376,9 @@
 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
 org.eclipse.jdt.core.formatter.tabulation.char=space
 org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
 org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
 org.eclipse.jdt.core.formatter.wrap_before_binary_operator=false
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
 org.eclipse.jdt.core.incompatibleJDKLevel=error
 org.eclipse.jdt.core.incompleteClasspath=error
--- a/c1x4hotspotsrc/HotSpotVM/.settings/org.eclipse.jdt.ui.prefs	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/.settings/org.eclipse.jdt.ui.prefs	Mon Aug 02 15:44:38 2010 -0700
@@ -1,4 +1,4 @@
-#Thu Nov 13 14:45:16 PST 2008
+#Fri Jul 23 17:15:05 PDT 2010
 comment_clear_blank_lines=false
 comment_format_comments=true
 comment_format_header=true
@@ -11,7 +11,7 @@
 comment_separate_root_tags=true
 eclipse.preferences.version=1
 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_MaxineJavaCodeStyle
+formatter_profile=_MaxineJavaCodeStyle2
 formatter_settings_version=11
 org.eclipse.jdt.ui.exception.name=e
 org.eclipse.jdt.ui.gettersetter.use.is=true
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Compiler.java	Mon Aug 02 15:44:38 2010 -0700
@@ -47,8 +47,8 @@
         if (vmEntries == null) {
             System.out.println("getVMEntries");
             try {
-                //vmEntries = LoggingProxy.getProxy(VMEntries.class, new VMEntriesNative());
-                vmEntries = new VMEntriesNative();
+                vmEntries = LoggingProxy.getProxy(VMEntries.class, new VMEntriesNative());
+                //vmEntries = new VMEntriesNative();
             } catch (Throwable t) {
                 t.printStackTrace();
             }
@@ -62,8 +62,8 @@
         if (vmExits == null) {
             System.out.println("getVMExits");
             try {
-                //vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative());
-                vmExits = new VMExitsNative();
+                vmExits = LoggingProxy.getProxy(VMExits.class, new VMExitsNative());
+                //vmExits = new VMExitsNative();
             } catch (Throwable t) {
                 t.printStackTrace();
             }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotConstantPool.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotConstantPool.java	Mon Aug 02 15:44:38 2010 -0700
@@ -9,41 +9,41 @@
 
 public class HotSpotConstantPool implements RiConstantPool {
 
-    private final Object constantPoolOop;
+    private final Class<?> constantPoolHolder;
 
-    public HotSpotConstantPool(Object o) {
-        this.constantPoolOop = o;
+    public HotSpotConstantPool(Class<?> o) {
+        this.constantPoolHolder = o;
     }
 
     @Override
     public CiConstant encoding() {
         // TODO: Check if this is correct.
-        return CiConstant.forObject(constantPoolOop);
+        return CiConstant.forObject(constantPoolHolder);
     }
 
     @Override
     public Object lookupConstant(int cpi) {
-        return Compiler.getVMEntries().RiConstantPool_lookupConstant(constantPoolOop, cpi);
+        return Compiler.getVMEntries().RiConstantPool_lookupConstant(constantPoolHolder, cpi);
     }
 
     @Override
     public RiMethod lookupMethod(int cpi, int byteCode) {
-        return Compiler.getVMEntries().RiConstantPool_lookupMethod(constantPoolOop, cpi, (byte) byteCode);
+        return Compiler.getVMEntries().RiConstantPool_lookupMethod(constantPoolHolder, cpi, (byte) byteCode);
     }
 
     @Override
     public RiSignature lookupSignature(int cpi) {
-        return Compiler.getVMEntries().RiConstantPool_lookupSignature(constantPoolOop, cpi);
+        return Compiler.getVMEntries().RiConstantPool_lookupSignature(constantPoolHolder, cpi);
     }
 
     @Override
     public RiType lookupType(int cpi, int opcode) {
-        return Compiler.getVMEntries().RiConstantPool_lookupType(constantPoolOop, cpi);
+        return Compiler.getVMEntries().RiConstantPool_lookupType(constantPoolHolder, cpi);
     }
 
     @Override
     public RiField lookupField(int cpi, int opcode) {
-        return Compiler.getVMEntries().RiConstantPool_lookupField(constantPoolOop, cpi);
+        return Compiler.getVMEntries().RiConstantPool_lookupField(constantPoolHolder, cpi);
     }
 
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotField.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotField.java	Mon Aug 02 15:44:38 2010 -0700
@@ -8,13 +8,13 @@
 public class HotSpotField implements RiField {
 
     private final RiType holder;
-    private final Object nameSymbol;
+    private final String name;
     private final RiType type;
     private final int offset;
 
-    public HotSpotField(RiType holder, Object nameSymbol, RiType type, int offset) {
+    public HotSpotField(RiType holder, String name, RiType type, int offset) {
         this.holder = holder;
-        this.nameSymbol = nameSymbol;
+        this.name = name;
         this.type = type;
         this.offset = offset;
     }
@@ -54,7 +54,7 @@
 
     @Override
     public String name() {
-        return Compiler.getVMEntries().RiSignature_symbolToString(nameSymbol);
+        return name;
     }
 
     @Override
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethod.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotMethod.java	Mon Aug 02 15:44:38 2010 -0700
@@ -1,5 +1,7 @@
 package com.sun.hotspot.c1x;
 
+import java.lang.reflect.*;
+
 import com.sun.cri.ri.RiExceptionHandler;
 import com.sun.cri.ri.RiMethod;
 import com.sun.cri.ri.RiMethodProfile;
@@ -8,16 +10,19 @@
 
 public class HotSpotMethod implements RiMethod {
 
-    Object methodOop;
+    Method method;
     private byte[] code;
+    private int maxLocals = -1;
+    private int maxStackSize = -1;
+    private RiSignature signature;
 
-    public HotSpotMethod(Object methodOop) {
-        this.methodOop = methodOop;
+    public HotSpotMethod(Method method) {
+        this.method = method;
     }
 
     @Override
     public int accessFlags() {
-        return Compiler.getVMEntries().RiMethod_accessFlags(methodOop);
+        return Compiler.getVMEntries().RiMethod_accessFlags(method);
     }
 
     @Override
@@ -29,9 +34,8 @@
     @Override
     public byte[] code() {
         if (code == null) {
-            code = Compiler.getVMEntries().RiMethod_code(methodOop);
+            code = Compiler.getVMEntries().RiMethod_code(method);
         }
-
         return code;
     }
 
@@ -49,7 +53,7 @@
 
     @Override
     public RiType holder() {
-        return Compiler.getVMEntries().RiMethod_holder(methodOop);
+        return Compiler.getVMEntries().RiMethod_holder(method);
     }
 
     @Override
@@ -96,12 +100,16 @@
 
     @Override
     public int maxLocals() {
-        return Compiler.getVMEntries().RiMethod_maxLocals(methodOop);
+        if (maxLocals == -1)
+            maxLocals = Compiler.getVMEntries().RiMethod_maxLocals(method);
+        return maxLocals;
     }
 
     @Override
     public int maxStackSize() {
-        return Compiler.getVMEntries().RiMethod_maxStackSize(methodOop);
+        if (maxStackSize == -1)
+            maxStackSize = Compiler.getVMEntries().RiMethod_maxStackSize(method);
+        return maxStackSize;
     }
 
     @Override
@@ -112,12 +120,14 @@
 
     @Override
     public String name() {
-        return Compiler.getVMEntries().RiMethod_name(methodOop);
+        return Compiler.getVMEntries().RiMethod_name(method);
     }
 
     @Override
     public RiSignature signature() {
-        return new HotSpotSignature(Compiler.getVMEntries().RiMethod_signature(methodOop));
+        if (signature == null)
+            signature = new HotSpotSignature(Compiler.getVMEntries().RiMethod_signature(method));
+        return signature;
     }
 
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRegisterConfig.java	Mon Aug 02 15:44:38 2010 -0700
@@ -35,7 +35,7 @@
 
     @Override
     public CiRegister[] getAllocatableRegisters() {
-        return new CiRegister[] { AMD64.rax, AMD64.rbx, AMD64.rcx, AMD64.rdx, AMD64.rsi, AMD64.rdi, AMD64.r10, AMD64.r11, AMD64.xmm0, AMD64.xmm1, AMD64.xmm2, AMD64.xmm3, AMD64.xmm4, AMD64.xmm5,
+        return new CiRegister[] { AMD64.rax, AMD64.rbx, AMD64.rcx, AMD64.rdx, AMD64.rsi, AMD64.rdi, /*AMD64.r10, */AMD64.r11, AMD64.xmm0, AMD64.xmm1, AMD64.xmm2, AMD64.xmm3, AMD64.xmm4, AMD64.xmm5,
                         AMD64.xmm6, AMD64.xmm7, AMD64.xmm8, AMD64.xmm9, AMD64.xmm10, AMD64.xmm11, AMD64.xmm12, AMD64.xmm13, AMD64.xmm14, AMD64.xmm15};
     }
 
@@ -148,7 +148,7 @@
 
     @Override
     public CiRegister getScratchRegister() {
-        return AMD64.r15;
+        return AMD64.r10;
     }
 
     @Override
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotRuntime.java	Mon Aug 02 15:44:38 2010 -0700
@@ -145,7 +145,7 @@
 
     @Override
     public RiConstantPool getConstantPool(RiMethod method) {
-        return Compiler.getVMEntries().RiRuntime_getConstantPool(((HotSpotType) method.holder()).klassOop);
+        return new HotSpotConstantPool(((HotSpotType) method.holder()).klass);
     }
 
     @Override
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotSignature.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotSignature.java	Mon Aug 02 15:44:38 2010 -0700
@@ -14,7 +14,6 @@
     private final String originalString;
 
     public HotSpotSignature(String signature) {
-
         assert signature.length() > 0;
         this.originalString = signature;
 
@@ -25,6 +24,11 @@
                 arguments.add(signature.substring(cur, nextCur));
                 cur = nextCur;
             }
+            StringBuilder str = new StringBuilder();
+            for (String param : arguments) {
+                str.append(param).append(", ");
+            }
+            Logger.log("signature " + signature + ": " + str);
 
             cur++;
             int nextCur = parseSignature(signature, cur);
@@ -39,16 +43,13 @@
 
         char first = signature.charAt(cur);
         switch (first) {
-
             case '[':
                 return parseSignature(signature, cur + 1);
-
             case 'L':
                 while (signature.charAt(cur) != ';')
                     cur++;
                 cur++;
                 break;
-
             case 'V':
             case 'I':
             case 'B':
@@ -60,12 +61,9 @@
             case 'Z':
                 cur++;
                 break;
-
             default:
                 assert false;
-
         }
-
         return cur;
     }
 
@@ -94,10 +92,9 @@
 
     @Override
     public RiType argumentTypeAt(int index, RiType accessingClass) {
-        System.out.println("argument type at " + index);
-        Object accessor = null;
+        Class<?> accessor = null;
         if (accessingClass instanceof HotSpotType) {
-            accessor = ((HotSpotType) accessingClass).klassOop;
+            accessor = ((HotSpotType) accessingClass).klass;
         }
         return Compiler.getVMEntries().RiSignature_lookupType(arguments.get(index), accessor);
     }
@@ -114,7 +111,11 @@
 
     @Override
     public RiType returnType(RiType accessingClass) {
-        return Compiler.getVMEntries().RiSignature_lookupType(returnType, accessingClass);
+        Class<?> accessor = null;
+        if (accessingClass instanceof HotSpotType) {
+            accessor = ((HotSpotType) accessingClass).klass;
+        }
+        return Compiler.getVMEntries().RiSignature_lookupType(returnType, accessor);
     }
 
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTargetMethod.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotTargetMethod.java	Mon Aug 02 15:44:38 2010 -0700
@@ -1,5 +1,6 @@
 package com.sun.hotspot.c1x;
 
+import java.lang.reflect.*;
 import java.util.*;
 
 import com.sun.cri.ci.*;
@@ -8,8 +9,9 @@
 
 public class HotSpotTargetMethod {
 
-    public final Object methodOop;
+    public final Method method;
     private byte[] code;
+    private int codeSize;
     private int frameSize;
 
     public int verifiedEntrypoint;
@@ -19,8 +21,9 @@
     public Object relocationData[];
 
     private HotSpotTargetMethod(HotSpotVMConfig config, RiMethod method, CiTargetMethod targetMethod) {
-        methodOop = ((HotSpotMethod) method).methodOop;
+        this.method= ((HotSpotMethod) method).method;
         code = targetMethod.targetCode();
+        codeSize = targetMethod.targetCodeSize();
         frameSize = targetMethod.frameSize();
         verifiedEntrypoint = targetMethod.entrypointCodeOffsets.get(HotSpotRuntime.Entrypoints.VERIFIED);
         unverifiedEntrypoint = targetMethod.entrypointCodeOffsets.get(HotSpotRuntime.Entrypoints.UNVERIFIED);
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotType.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotType.java	Mon Aug 02 15:44:38 2010 -0700
@@ -6,11 +6,13 @@
 
 public class HotSpotType implements RiType {
 
-    final Object klassOop;
+    // do not query this class object directly, use the VMEntries methods instead!
+    // (otherwise this query won't be recorded correctly)
+    final Class<?> klass;
 
-    public HotSpotType(Object o) {
-        this.klassOop = o;
-        assert klassOop != null;
+    public HotSpotType(Class<?> klass) {
+        this.klass = klass;
+        assert klass != null;
     }
 
     @Override
@@ -69,7 +71,7 @@
     @Override
     public boolean isArrayClass() {
         System.out.println("Checking for array class " + name());
-        return Compiler.getVMEntries().RiType_isArrayClass(klassOop);
+        return Compiler.getVMEntries().RiType_isArrayClass(klass);
     }
 
     @Override
@@ -86,12 +88,12 @@
 
     @Override
     public boolean isInstanceClass() {
-        return Compiler.getVMEntries().RiType_isInstanceClass(klassOop);
+        return Compiler.getVMEntries().RiType_isInstanceClass(klass);
     }
 
     @Override
     public boolean isInterface() {
-        return Compiler.getVMEntries().RiType_isInterface(klassOop);
+        return Compiler.getVMEntries().RiType_isInterface(klass);
     }
 
     @Override
@@ -106,8 +108,8 @@
     }
 
     @Override
-    public Class< ? > javaClass() {
-        return Compiler.getVMEntries().RiType_javaClass(klassOop);
+    public Class<?> javaClass() {
+        return klass;
     }
 
     @Override
@@ -117,7 +119,7 @@
 
     @Override
     public String name() {
-        return Compiler.getVMEntries().RiType_name(klassOop);
+        return Compiler.getVMEntries().RiType_name(klass);
     }
 
     @Override
@@ -126,8 +128,8 @@
         return null;
     }
 
-    public Object klassOop() {
-        return klassOop;
+    public Class<?> klass() {
+        return klass;
     }
 
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotVMConfig.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotVMConfig.java	Mon Aug 02 15:44:38 2010 -0700
@@ -32,6 +32,7 @@
     public int vmPageSize;
     public int stackShadowPages;
     public int hubOffset;
+    public int arrayLengthOffset;
 
     // runtime stubs
     public long instanceofStub;
@@ -44,6 +45,7 @@
         assert instanceofStub != 0;
         assert debugStub != 0;
         System.out.println("Config::debugStub = " + Long.toHexString(debugStub));
+        System.out.println("Config::instanceofStub = " + Long.toHexString(instanceofStub));
     }
 
 }
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/HotSpotXirGenerator.java	Mon Aug 02 15:44:38 2010 -0700
@@ -46,6 +46,8 @@
     private XirTemplate prologueTemplate;
     private XirTemplate staticPrologueTemplate;
     private XirTemplate epilogueTemplate;
+    private XirTemplate arrayLengthTemplate;
+    private XirTemplate exceptionObjectTemplate;
 
     static class XirPair {
 
@@ -108,6 +110,8 @@
         prologueTemplate = buildPrologue(false);
         staticPrologueTemplate = buildPrologue(true);
         epilogueTemplate = buildEpilogue();
+        arrayLengthTemplate = buildArrayLength();
+        exceptionObjectTemplate = buildExceptionObject();
         instanceofTemplate = buildInstanceof(false);
         instanceofTemplateNonnull = buildInstanceof(true);
 
@@ -117,7 +121,7 @@
     private XirTemplate buildPrologue(boolean staticMethod) {
         asm.restart(CiKind.Void);
         XirOperand sp = asm.createRegister("stack pointer", CiKind.Word, registerConfig.getStackPointerRegister());
-        XirOperand temp = asm.createRegister("temp (rax)", CiKind.Word, AMD64.rax);
+        XirOperand temp = asm.createRegister("temp (rax)", CiKind.Int, AMD64.rax);
 
         asm.align(config.codeEntryAlignment);
         asm.entrypoint(HotSpotRuntime.Entrypoints.UNVERIFIED);
@@ -131,7 +135,7 @@
         }
         asm.entrypoint(HotSpotRuntime.Entrypoints.VERIFIED);
         // stack banging
-        asm.pload(CiKind.Word, temp, sp, asm.i(-config.stackShadowPages * config.vmPageSize), true);
+        asm.pstore(CiKind.Word, sp, asm.i(-config.stackShadowPages * config.vmPageSize), temp, true);
         asm.pushFrame();
 
         return asm.finishTemplate(staticMethod ? "static prologue" : "prologue");
@@ -144,6 +148,19 @@
         return asm.finishTemplate("epilogue");
     }
 
+    private XirTemplate buildArrayLength() {
+        XirOperand result = asm.restart(CiKind.Int);
+        XirParameter object = asm.createInputParameter("object", CiKind.Object);
+        asm.pload(CiKind.Int, result, object, asm.i(config.arrayLengthOffset), true);
+        return asm.finishTemplate("arrayLength");
+    }
+
+    private XirTemplate buildExceptionObject() {
+        asm.restart();
+        XirOperand temp = asm.createRegister("temp (rax)", CiKind.Object, AMD64.rax);
+        return asm.finishTemplate(temp, "exception object");
+    }
+
     private XirPair buildGetFieldTemplate(CiKind kind, boolean isStatic) {
         final XirTemplate resolved;
         final XirTemplate unresolved;
@@ -213,29 +230,38 @@
         XirTemplate unresolved;
         {
             XirOperand result = asm.restart(CiKind.Boolean);
-            asm.callRuntime(config.instanceofStub, result);
 
             XirParameter object = asm.createInputParameter("object", CiKind.Object);
             XirParameter hub = asm.createConstantInputParameter("hub", CiKind.Object);
             XirOperand temp = asm.createTemp("temp", CiKind.Object);
-            XirLabel pass = asm.createInlineLabel("pass");
-            XirLabel fail = asm.createInlineLabel("fail");
+            XirLabel end = asm.createInlineLabel("end");
+            XirLabel slow_path = asm.createOutOfLineLabel("slow path");
+
             asm.mov(result, asm.b(false));
             if (!nonnull) {
                 // first check for null
-                asm.jeq(fail, object, asm.o(null));
+                asm.jeq(end, object, asm.o(null));
             }
             asm.pload(CiKind.Object, temp, object, asm.i(config.hubOffset), !nonnull);
-            asm.jneq(fail, temp, hub);
-            asm.bindInline(pass);
             asm.mov(result, asm.b(true));
-            asm.bindInline(fail);
+            asm.jneq(slow_path, temp, hub);
+
+            asm.bindInline(end);
+
+            asm.bindOutOfLine(slow_path);
+            asm.push(temp);
+            asm.push(hub);
+            asm.callRuntime(config.instanceofStub, result);
+            asm.pop(hub);
+            asm.pop(result);
+            asm.jmp(end);
             resolved = asm.finishTemplate("instanceof-leaf<" + nonnull + ">");
         }
         {/*
           * // unresolved instanceof unresolved = buildUnresolvedInstanceOf(nonnull);
           */
             asm.restart(CiKind.Boolean);
+            XirParameter object = asm.createInputParameter("object", CiKind.Object);
             asm.shouldNotReachHere();
             unresolved = asm.finishTemplate("instanceof-leaf<" + nonnull + ">");
         }
@@ -244,7 +270,7 @@
 
     @Override
     public XirSnippet genArrayLength(XirSite site, XirArgument array) {
-        return new XirSnippet(emptyTemplates[CiKind.Int.ordinal()]);
+        return new XirSnippet(arrayLengthTemplate, array);
     }
 
     @Override
@@ -311,14 +337,11 @@
 
     @Override
     public XirSnippet genInstanceOf(XirSite site, XirArgument receiver, XirArgument hub, RiType type) {
-        /*
         if (type.isResolved()) {
             return new XirSnippet(instanceofTemplate.resolved, receiver, hub);
         }
         // XirArgument guard = guardFor(type, ResolveClass.SNIPPET);
         return new XirSnippet(instanceofTemplate.unresolved, receiver);
-        */
-        return new XirSnippet(emptyTemplates[CiKind.Boolean.ordinal()]);
     }
 
     @Override
@@ -378,10 +401,10 @@
         if (type.isResolved()) {
             System.out.println("resolved");
             asm.mov(result, asm.o(type));
-            return new XirSnippet(asm.finishTemplate(result, "resolve class"));
+            return new XirSnippet(asm.finishTemplate("resolve class"));
         }
         asm.shouldNotReachHere();
-        return new XirSnippet(asm.finishTemplate(result, "resolve class"));
+        return new XirSnippet(asm.finishTemplate("resolve class"));
 
     }
 
@@ -392,7 +415,7 @@
 
     @Override
     public XirSnippet genExceptionObject(XirSite site) {
-        return new XirSnippet(emptyTemplates[CiKind.Object.ordinal()]);
+        return new XirSnippet(exceptionObjectTemplate);
     }
 
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/Logger.java	Mon Aug 02 15:44:38 2010 -0700
@@ -0,0 +1,86 @@
+package com.sun.hotspot.c1x;
+
+import java.lang.reflect.*;
+import java.util.*;
+
+public class Logger {
+
+    private static final boolean ENABLED = true;
+    private static final int SPACING = 2;
+    private static Deque<Boolean> openStack = new LinkedList<Boolean>();
+    private static boolean open = false;
+    private static int level = 0;
+
+    public static void log(String message) {
+        if (ENABLED) {
+            if (open) {
+                System.out.println("...");
+                open = false;
+            }
+            System.out.print(space(level));
+            System.out.println(message);
+        }
+    }
+
+    public static void startScope(String message) {
+        if (ENABLED) {
+            if (open) {
+                System.out.println("...");
+                open = false;
+            }
+            System.out.print(space(level));
+            System.out.print(message);
+            openStack.push(open);
+            open = true;
+            level++;
+        }
+    }
+
+    public static void endScope(String message) {
+        if (ENABLED) {
+            level--;
+            if (open)
+                System.out.println(message);
+            else
+                System.out.println(space(level) + "..." + message);
+            open = openStack.pop();
+        }
+    }
+
+    private static String[] spaces = new String[50];
+
+    private static String space(int count) {
+        assert count >= 0;
+        String result;
+        if (count >= spaces.length || spaces[count] == null) {
+            StringBuilder str = new StringBuilder();
+            for (int i = 0; i < count * SPACING; i++)
+                str.append(' ');
+            result = str.toString();
+            if (count < spaces.length)
+                spaces[count] = result;
+        } else {
+            result = spaces[count];
+        }
+        return result;
+    }
+
+    public static String pretty(Object value) {
+        if (value instanceof Method) {
+            return "method \"" + ((Method) value).getName() + "\"";
+        } else if (value instanceof Class<?>) {
+            return "class \"" + ((Class<?>) value).getSimpleName() + "\"";
+        } else if (value instanceof Void) {
+            return "void";
+        } else if (value instanceof Integer) {
+            if ((Integer) value < 10)
+                return value.toString();
+            return value + " (0x" + Integer.toHexString((Integer) value) + ")";
+        } else if (value instanceof Long) {
+            if ((Long) value < 10)
+                return value + "l";
+            return value + "l (0x" + Long.toHexString((Long) value) + "l)";
+        }
+        return value == null ? "null" : value.toString();
+    }
+}
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/LoggingProxy.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/LoggingProxy.java	Mon Aug 02 15:44:38 2010 -0700
@@ -15,10 +15,22 @@
         int argCount = args == null ? 0 : args.length;
         if (method.getParameterTypes().length != argCount)
             throw new RuntimeException("wrong parameter count");
-        System.out.println("method " + method + " called with " + argCount + " args");
-        if (args == null)
-            return method.invoke(delegate);
-        return method.invoke(delegate, args);
+        StringBuilder str = new StringBuilder();
+        str.append(method.getReturnType().getSimpleName() + " " + method.getDeclaringClass().getSimpleName() + "." + method.getName() + "(");
+        for (int i = 0; i < argCount; i++) {
+            str.append(i == 0 ? "" : ", ");
+            str.append(Logger.pretty(args[i]));
+        }
+        str.append(")");
+        Logger.startScope(str.toString());
+        final Object result;
+        if (args == null) {
+            result = method.invoke(delegate);
+        } else {
+            result = method.invoke(delegate, args);
+        }
+        Logger.endScope(" = " + Logger.pretty(result));
+        return result;
     }
 
     public static <T> T getProxy(Class<T> interf, T delegate) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntries.java	Mon Aug 02 15:44:38 2010 -0700
@@ -0,0 +1,47 @@
+package com.sun.hotspot.c1x;
+
+import java.lang.reflect.*;
+
+import com.sun.cri.ri.*;
+
+public interface VMEntries {
+
+    public abstract byte[] RiMethod_code(Method methodOop);
+
+    public abstract int RiMethod_maxStackSize(Method methodOop);
+
+    public abstract int RiMethod_maxLocals(Method methodOop);
+
+    public abstract RiType RiMethod_holder(Method methodOop);
+
+    public abstract String RiMethod_signature(Method methodOop);
+
+    public abstract String RiMethod_name(Method methodOop);
+
+    public abstract int RiMethod_accessFlags(Method methodOop);
+
+    public abstract RiType RiSignature_lookupType(String returnType, Class<?> accessingClass);
+
+    public abstract Object RiConstantPool_lookupConstant(Class<?> constantPoolHolder, int cpi);
+
+    public abstract RiMethod RiConstantPool_lookupMethod(Class<?> constantPoolHolder, int cpi, byte byteCode);
+
+    public abstract RiSignature RiConstantPool_lookupSignature(Class<?> constantPoolHolder, int cpi);
+
+    public abstract RiType RiConstantPool_lookupType(Class<?> constantPoolHolder, int cpi);
+
+    public abstract RiField RiConstantPool_lookupField(Class<?> constantPoolHolder, int cpi);
+
+    public abstract String RiType_name(Class<?> klassOop);
+
+    public abstract boolean RiType_isArrayClass(Class<?> klassOop);
+
+    public abstract boolean RiType_isInstanceClass(Class<?> klassOop);
+
+    public abstract boolean RiType_isInterface(Class<?> klassOop);
+
+    public abstract void installCode(HotSpotTargetMethod targetMethod);
+
+    public abstract HotSpotVMConfig getConfiguration();
+
+}
\ No newline at end of file
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMEntriesNative.java	Mon Aug 02 15:44:38 2010 -0700
@@ -1,75 +1,61 @@
 package com.sun.hotspot.c1x;
 
-import com.sun.cri.ri.RiConstantPool;
-import com.sun.cri.ri.RiField;
-import com.sun.cri.ri.RiMethod;
-import com.sun.cri.ri.RiSignature;
-import com.sun.cri.ri.RiType;
+import java.lang.reflect.*;
+
+import com.sun.cri.ri.*;
 
 public class VMEntriesNative implements VMEntries {
 
     @Override
-    public native byte[] RiMethod_code(Object methodOop);
+    public native byte[] RiMethod_code(Method methodOop);
 
     @Override
-    public native int RiMethod_maxStackSize(Object methodOop);
+    public native int RiMethod_maxStackSize(Method methodOop);
 
     @Override
-    public native int RiMethod_maxLocals(Object methodOop);
-
-    @Override
-    public native RiType RiMethod_holder(Object methodOop);
+    public native int RiMethod_maxLocals(Method methodOop);
 
     @Override
-    public native String RiMethod_signature(Object methodOop);
+    public native RiType RiMethod_holder(Method methodOop);
 
     @Override
-    public native String RiMethod_name(Object methodOop);
+    public native String RiMethod_signature(Method methodOop);
 
     @Override
-    public native RiType RiSignature_lookupType(String returnType, Object accessingClass);
+    public native String RiMethod_name(Method methodOop);
 
     @Override
-    public native String RiSignature_symbolToString(Object symbolOop);
+    public native int RiMethod_accessFlags(Method methodOop);
 
     @Override
-    public native Class< ? > RiType_javaClass(Object klassOop);
-
-    @Override
-    public native String RiType_name(Object klassOop);
+    public native RiType RiSignature_lookupType(String returnType, Class<?> accessingClass);
 
     @Override
-    public native Object RiConstantPool_lookupConstant(Object constantPoolOop, int cpi);
-
-    @Override
-    public native RiMethod RiConstantPool_lookupMethod(Object constantPoolOop, int cpi, byte byteCode);
+    public native Object RiConstantPool_lookupConstant(Class<?> constantPoolOop, int cpi);
 
     @Override
-    public native RiSignature RiConstantPool_lookupSignature(Object constantPoolOop, int cpi);
+    public native RiMethod RiConstantPool_lookupMethod(Class<?> constantPoolOop, int cpi, byte byteCode);
 
     @Override
-    public native RiType RiConstantPool_lookupType(Object constantPoolOop, int cpi);
+    public native RiSignature RiConstantPool_lookupSignature(Class<?> constantPoolOop, int cpi);
 
     @Override
-    public native RiField RiConstantPool_lookupField(Object constantPoolOop, int cpi);
+    public native RiType RiConstantPool_lookupType(Class<?> constantPoolOop, int cpi);
 
     @Override
-    public native RiType findRiType(Object holderKlassOop);
+    public native RiField RiConstantPool_lookupField(Class<?> constantPoolOop, int cpi);
 
     @Override
-    public native RiConstantPool RiRuntime_getConstantPool(Object klassOop);
+    public native String RiType_name(Class<?> klassOop);
 
     @Override
-    public native boolean RiType_isArrayClass(Object klassOop);
+    public native boolean RiType_isArrayClass(Class<?> klassOop);
 
     @Override
-    public native boolean RiType_isInstanceClass(Object klassOop);
+    public native boolean RiType_isInstanceClass(Class<?> klassOop);
 
     @Override
-    public native boolean RiType_isInterface(Object klassOop);
-
-    @Override
-    public native int RiMethod_accessFlags(Object methodOop);
+    public native boolean RiType_isInterface(Class<?> klassOop);
 
     @Override
     public native void installCode(HotSpotTargetMethod targetMethod);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExits.java	Mon Aug 02 15:44:38 2010 -0700
@@ -0,0 +1,36 @@
+package com.sun.hotspot.c1x;
+
+import java.lang.reflect.*;
+
+import com.sun.cri.ci.*;
+import com.sun.cri.ri.*;
+
+public interface VMExits {
+
+    public abstract void compileMethod(Method method, int entry_bci);
+
+    public abstract RiMethod createRiMethod(Method methodOop);
+
+    public abstract RiSignature createRiSignature(String signature);
+
+    public abstract RiField createRiField(RiType holder, String name, RiType type, int offset);
+
+    public abstract RiType createRiType(Class<?> klassOop);
+
+    public abstract RiType createRiTypePrimitive(int basicType);
+
+    public abstract RiType createRiTypeUnresolved(String name, Class<?> accessingKlassOop);
+
+    public abstract RiConstantPool createRiConstantPool(Class<?> constantPoolOop);
+
+    public abstract CiConstant createCiConstantInt(int value);
+
+    public abstract CiConstant createCiConstantLong(long value);
+
+    public abstract CiConstant createCiConstantFloat(float value);
+
+    public abstract CiConstant createCiConstantDouble(double value);
+
+    public abstract CiConstant createCiConstantObject(Object value);
+
+}
\ No newline at end of file
--- a/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java	Fri Jul 23 15:53:02 2010 -0700
+++ b/c1x4hotspotsrc/HotSpotVM/src/com/sun/hotspot/c1x/VMExitsNative.java	Mon Aug 02 15:44:38 2010 -0700
@@ -18,33 +18,31 @@
 
 package com.sun.hotspot.c1x;
 
+import java.lang.reflect.*;
+
 import com.sun.cri.ci.*;
 import com.sun.cri.ri.*;
 
 /**
- *
- * @author Thomas Wuerthinger
+ * Exits from the HotSpot VM into Java code.
  *
- *         Exits from the HotSpot VM into Java code.
- *
+ * @author Thomas Wuerthinger, Lukas Stadler
  */
 public class VMExitsNative implements VMExits {
 
     @Override
-    public void compileMethod(RiMethod method, int entry_bci) {
+    public void compileMethod(Method method, int entry_bci) {
         try {
-            assert method instanceof RiMethod : "And YES, this assert is necessary and a potential life saver as this method is called from the VM ;-)";
-
             Compiler compiler = Compiler.getInstance();
-            CiResult result = compiler.getCompiler().compileMethod(method, null);
+            HotSpotMethod riMethod = new HotSpotMethod(method);
+            CiResult result = compiler.getCompiler().compileMethod(riMethod, null);
 
             if (result.bailout() != null) {
                 System.out.println("Bailout:");
                 result.bailout().printStackTrace();
             } else {
-                System.out.println("Compilation result: ");
-                System.out.println(result.targetMethod());
-                HotSpotTargetMethod.installCode(compiler.getConfig(), method, result.targetMethod());
+                Logger.log("Compilation result: " + result.targetMethod());
+                HotSpotTargetMethod.installCode(compiler.getConfig(), riMethod, result.targetMethod());
             }
         } catch (Throwable t) {
             System.out.println("Compilation interrupted:");
@@ -57,36 +55,28 @@
     }
 
     @Override
-    public RiMethod createRiMethod(Object methodOop) {
-        System.out.println("creating RiMethod object");
-        RiMethod m = new HotSpotMethod(methodOop);
-        System.out.println("returning " + m);
+    public RiMethod createRiMethod(Method method) {
+        RiMethod m = new HotSpotMethod(method);
         return m;
     }
 
     @Override
-    public RiSignature createRiSignature(Object symbolOop) {
-        System.out.println("Creating RiSignature object");
-        String name = Compiler.getVMEntries().RiSignature_symbolToString(symbolOop);
-        System.out.println("Signature name: " + name);
-        return new HotSpotSignature(name);
+    public RiSignature createRiSignature(String signature) {
+        return new HotSpotSignature(signature);
     }
 
     @Override
-    public RiField createRiField(RiType holder, Object nameSymbol, RiType type, int offset) {
-        System.out.println("creating RiField object");
-        return new HotSpotField(holder, nameSymbol, type, offset);
+    public RiField createRiField(RiType holder, String name, RiType type, int offset) {
+        return new HotSpotField(holder, name, type, offset);
     }
 
     @Override
-    public RiType createRiType(Object klassOop) {
-        System.out.println("creating RiType object");
+    public RiType createRiType(Class<?> klassOop) {
         return new HotSpotType(klassOop);
     }
 
     @Override
     public RiType createRiTypePrimitive(int basicType) {
-        System.out.println("Creating primitive type with basicType " + basicType);
         CiKind kind = null;
         switch (basicType) {
             case 4:
@@ -119,21 +109,16 @@
             default:
                 throw new IllegalArgumentException("Unknown basic type: " + basicType);
         }
-        System.out.println("Chosen kind: " + kind);
         return new HotSpotTypePrimitive(kind);
     }
 
     @Override
-    public RiType createRiTypeUnresolved(Object symbolOop, Object accessingKlassOop) {
-        System.out.println("Creating unresolved RiType object");
-        String name = Compiler.getVMEntries().RiSignature_symbolToString(symbolOop);
-        System.out.println("Class name: " + name);
+    public RiType createRiTypeUnresolved(String name, Class<?> accessingKlassOop) {
         return new HotSpotTypeUnresolved(name);
     }
 
     @Override
-    public RiConstantPool createRiConstantPool(Object constantPoolOop) {
-        System.out.println("creating RiConstantPool object");
+    public RiConstantPool createRiConstantPool(Class<?> constantPoolOop) {
         return new HotSpotConstantPool(constantPoolOop);
     }
 
@@ -161,11 +146,4 @@
     public CiConstant createCiConstantObject(Object value) {
         return CiConstant.forObject(value);
     }
-
-    @Override
-    public void main(String[] args) throws InterruptedException {
-        System.out.println(C1XHotSpotTests.add(1, 2));
-        Thread.sleep(5000);
-        System.out.println(C1XHotSpotTests.add(1, 2));
-    }
 }
--- a/src/cpu/x86/vm/assembler_x86.cpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/cpu/x86/vm/assembler_x86.cpp	Mon Aug 02 15:44:38 2010 -0700
@@ -5508,6 +5508,7 @@
   lea(c_rarg1, InternalAddress(rip));
   movq(c_rarg2, rsp); // pass pointer to regs array
   andq(rsp, -16); // align stack as required by ABI
+  mov64(rax, 0);
   call(RuntimeAddress(CAST_FROM_FN_PTR(address, MacroAssembler::debug64)));
   hlt();
 }
@@ -5519,6 +5520,7 @@
 
   push_CPU_state();   // keeps alignment at 16 bytes
   lea(c_rarg0, ExternalAddress((address) msg));
+  mov64(rax, 0);
   call_VM_leaf(CAST_FROM_FN_PTR(address, warning), c_rarg0);
   pop_CPU_state();
 
--- a/src/share/vm/c1x/c1x_Compiler.cpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/c1x/c1x_Compiler.cpp	Mon Aug 02 15:44:38 2010 -0700
@@ -43,19 +43,16 @@
 
 // Compilation entry point for methods
 void C1XCompiler::compile_method(ciEnv* env, ciMethod* target, int entry_bci) {
-  
   initialize();
 
-	VM_ENTRY_MARK;
-
-	
-	ResourceMark rm;
-	HandleMark hm;
+  VM_ENTRY_MARK;
+  
+  ResourceMark rm;
+  HandleMark hm;
 
   CompilerThread::current()->set_compiling(true);
-  oop rimethod = get_RiMethod(target);
-  VMExits::compileMethod(rimethod, entry_bci);
-	CompilerThread::current()->set_compiling(false);
+  VMExits::compileMethod((methodOop)target->get_oop(), entry_bci);
+  CompilerThread::current()->set_compiling(false);
 }
 
 // Print compilation timers and statistics
@@ -63,72 +60,129 @@
 	TRACE_C1X_1("print_timers");
 }
 
-oop C1XCompiler::get_RiMethod(ciMethod *method) {
-  methodOop m = (methodOop)method->get_oop();
-  return get_RiMethod(m);
+oop C1XCompiler::get_RiType(oop name, klassOop accessingType, TRAPS) {
+  symbolOop klass = java_lang_String::as_symbol_or_null(name);
+
+  if (klass == vmSymbols::byte_signature()) {
+    return VMExits::createRiTypePrimitive((int)T_BYTE, THREAD);
+  } else if (klass == vmSymbols::char_signature()) {
+    return VMExits::createRiTypePrimitive((int)T_CHAR, THREAD);
+  } else if (klass == vmSymbols::double_signature()) {
+    return VMExits::createRiTypePrimitive((int)T_DOUBLE, THREAD);
+  } else if (klass == vmSymbols::float_signature()) {
+    return VMExits::createRiTypePrimitive((int)T_FLOAT, THREAD);
+  } else if (klass == vmSymbols::int_signature()) {
+    return VMExits::createRiTypePrimitive((int)T_INT, THREAD);
+  } else if (klass == vmSymbols::long_signature()) {
+    return VMExits::createRiTypePrimitive((int)T_LONG, THREAD);
+  } else if (klass == vmSymbols::bool_signature()) {
+    return VMExits::createRiTypePrimitive((int)T_BOOLEAN, THREAD);
+  }
+  Handle classloader;
+  if (accessingType != NULL) {
+    classloader = accessingType->klass_part()->class_loader();
+  }
+  klassOop resolved_type = SystemDictionary::resolve_or_null(klass, classloader, accessingType->klass_part()->protection_domain(), Thread::current());
+  if (resolved_type != NULL) {
+    return VMExits::createRiType(resolved_type, THREAD);
+  } else {
+    return VMExits::createRiTypeUnresolved(klass, accessingType, THREAD);
+  }
 }
 
-oop C1XCompiler::get_RiField(ciField *field) {
-  oop field_holder = get_RiType(field->holder());
-  oop field_type = get_RiType(field->type());
+oop C1XCompiler::get_RiType(ciType *type, klassOop accessor, TRAPS) {
+  if (type->is_loaded()) {
+    if (type->is_primitive_type()) {
+      return VMExits::createRiTypePrimitive((int)type->basic_type(), THREAD);
+    }
+    return VMExits::createRiType((klassOop)type->get_oop(), THREAD);
+  } else {
+    return VMExits::createRiTypeUnresolved(((ciKlass *)type)->name()->get_symbolOop(), accessor, THREAD);
+  }
+}
+
+oop C1XCompiler::get_RiField(ciField *field, TRAPS) {
+  oop field_holder = get_RiType(field->holder(), NULL, CHECK_0);
+  oop field_type = get_RiType(field->type(), NULL, CHECK_0);
   symbolOop field_name = field->name()->get_symbolOop();
   int offset = field->offset();
 
   // TODO: implement caching
-  return VMExits::createRiField(field_holder, field_name, field_type, offset);
+  return VMExits::createRiField(field_holder, field_name, field_type, offset, THREAD);
 }
 
-oop C1XCompiler::get_RiMethod(methodOop m) {
+/*
+oop C1XCompiler::get_RiMethod(ciMethod *method, TRAPS) {
+  methodOop m = (methodOop)method->get_oop();
+  return get_RiMethod(m, THREAD);
+}
+
+oop C1XCompiler::get_RiMethod(methodOop m, TRAPS) {
   // TODO: implement caching
-  return VMExits::createRiMethod(m);
+  return VMExits::createRiMethod(m, THREAD);
 }
 
-oop C1XCompiler::get_RiType(ciType *type) {
-  if (type->is_loaded()) {
-    if (type->is_primitive_type()) {
-      return VMExits::createRiTypePrimitive((int)type->basic_type());
-    }
-    return get_RiType((klassOop)type->get_oop());
+
+oop C1XCompiler::get_RiType(klassOop klass, TRAPS) {
+  // TODO: implement caching
+  return VMExits::createRiType(klass, THREAD);
+}
+
+oop C1XCompiler::get_RiConstantPool(constantPoolOop cp, TRAPS) {
+  // TODO: implement caching
+  return VMExits::createRiConstantPool(cp, THREAD);
+}
+
+oop C1XCompiler::get_unresolved_RiType(symbolOop klass, klassOop accessingType, TRAPS)  {
+  // TODO: implement caching
+  return VMExits::createRiTypeUnresolved(klass, accessingType, THREAD);
+}
+*/
+
+// conversion internal objects -> reflected objects
+
+oop C1XObjects::getReflectedMethod(methodOop method, TRAPS) {
+  if (method->is_initializer()) {
+    return Reflection::new_constructor(method, CHECK_0);
   } else {
-    return get_unresolved_RiType(((ciKlass *)type)->name()->get_symbolOop(), NULL);
+    return Reflection::new_method(method, UseNewReflection, false, CHECK_0);
   }
 }
 
-oop C1XCompiler::get_RiType(klassOop klass) {
-  // TODO: implement caching
-  return VMExits::createRiType(klass);
+oop C1XObjects::getReflectedClass(klassOop klass) {
+  return klass->klass_part()->java_mirror();
 }
 
-oop C1XCompiler::get_RiConstantPool(constantPoolOop cp) {
-  // TODO: implement caching
-  return VMExits::createRiConstantPool(cp);
+oop C1XObjects::getReflectedSymbol(symbolOop symbol, TRAPS) {
+  return java_lang_String::create_from_symbol(symbol, THREAD)();
 }
 
-oop C1XCompiler::get_RiType(symbolOop klass, klassOop accessingType) {
-  if (klass == vmSymbols::byte_signature()) {
-    return VMExits::createRiTypePrimitive((int)T_BYTE);
-  } else if (klass == vmSymbols::char_signature()) {
-    return VMExits::createRiTypePrimitive((int)T_CHAR);
-  } else if (klass == vmSymbols::double_signature()) {
-    return VMExits::createRiTypePrimitive((int)T_DOUBLE);
-  } else if (klass == vmSymbols::float_signature()) {
-    return VMExits::createRiTypePrimitive((int)T_FLOAT);
-  } else if (klass == vmSymbols::int_signature()) {
-    return VMExits::createRiTypePrimitive((int)T_INT);
-  } else if (klass == vmSymbols::long_signature()) {
-    return VMExits::createRiTypePrimitive((int)T_LONG);
-  } else if (klass == vmSymbols::bool_signature()) {
-    return VMExits::createRiTypePrimitive((int)T_BOOLEAN);
+// conversion reflected objects -> internal objects
+
+methodOop C1XObjects::getInternalMethod(oop method) {
+  // copied from JNIEnv::FromReflectedMethod
+  oop mirror     = NULL;
+  int slot       = 0;
+
+  if (method->klass() == SystemDictionary::reflect_Constructor_klass()) {
+    mirror = java_lang_reflect_Constructor::clazz(method);
+    slot   = java_lang_reflect_Constructor::slot(method);
+  } else {
+    assert(method->klass() == SystemDictionary::reflect_Method_klass(), "wrong type");
+    mirror = java_lang_reflect_Method::clazz(method);
+    slot   = java_lang_reflect_Method::slot(method);
   }
-  klassOop resolved_type = SystemDictionary::resolve_or_null(klass, accessingType->klass_part()->class_loader(), accessingType->klass_part()->protection_domain(), Thread::current());
-  if (resolved_type != NULL) {
-    return get_RiType(resolved_type);
-  } else {
-    return get_unresolved_RiType(klass, accessingType);
-  }
+  klassOop k     = java_lang_Class::as_klassOop(mirror);
+  return instanceKlass::cast(k)->method_with_idnum(slot);
 }
 
-oop C1XCompiler::get_unresolved_RiType(symbolOop klass, klassOop accessingType)  {
-  // TODO: implement caching
-  return VMExits::createRiTypeUnresolved(klass, accessingType);
+klassOop C1XObjects::getInternalClass(oop klass) {
+  return java_lang_Class::as_klassOop(klass);
 }
+
+symbolOop C1XObjects::getInternalSymbol(oop string) {
+  return java_lang_String::as_symbol_or_null(string);
+}
+
+
+
--- a/src/share/vm/c1x/c1x_Compiler.hpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/c1x/c1x_Compiler.hpp	Mon Aug 02 15:44:38 2010 -0700
@@ -32,33 +32,58 @@
 
   C1XCompiler() { _initialized = false; }
 
-	virtual const char* name() { return "C1X"; }
+  virtual const char* name() { return "C1X"; }
 
-	// Native / OSR not supported
-	virtual bool supports_native()                 { return false; }
-	virtual bool supports_osr   ()                 { return false; }
+  // Native / OSR not supported
+  virtual bool supports_native()                 { return false; }
+  virtual bool supports_osr   ()                 { return false; }
+
+  // Pretend to be C1
+  bool is_c1   ()                                { return true; }
+  bool is_c2   ()                                { return false; }
 
-	// Pretend to be C1
-	bool is_c1   ()                                { return true; }
-	bool is_c2   ()                                { return false; }
+  // Initialization
+  virtual void initialize();
+
+  // Compilation entry point for methods
+  virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
 
-	// Initialization
-	virtual void initialize();
+  // Print compilation timers and statistics
+  virtual void print_timers();
+
+  static oop get_RiType(oop klass, klassOop accessingType, TRAPS);
+  static oop get_RiType(ciType *klass, klassOop accessor, TRAPS);
+  static oop get_RiField(ciField *ciField, TRAPS);
 
-	// Compilation entry point for methods
-	virtual void compile_method(ciEnv* env, ciMethod* target, int entry_bci);
+/*
+  static oop get_RiMethod(ciMethod *ciMethod, TRAPS);
+  static oop get_RiType(klassOop klass, TRAPS);
+  static oop get_RiMethod(methodOop method, TRAPS);
+  static oop get_unresolved_RiType(oop klass, klassOop accessingType, TRAPS);
+  static oop get_RiConstantPool(constantPoolOop cpOop, TRAPS);
+*/
+};
 
-	// Print compilation timers and statistics
-	virtual void print_timers();
+class C1XObjects : public AllStatic {
 
-  static oop get_RiMethod(ciMethod *ciMethod);
-  static oop get_RiField(ciField *ciField);
-  static oop get_RiType(ciType *klass);
-  static oop get_RiType(klassOop klass);
-  static oop get_RiMethod(methodOop method);
-  static oop get_RiType(symbolOop klass, klassOop accessingType);
-  static oop get_unresolved_RiType(symbolOop klass, klassOop accessingType);
-  static oop get_RiConstantPool(constantPoolOop cpOop);
+public:
+  static oop getReflectedMethod(methodOop method, TRAPS);
+  static oop getReflectedClass(klassOop klass);
+  static oop getReflectedSymbol(symbolOop symbol, TRAPS);
+
+  static methodOop getInternalMethod(oop method);
+  static klassOop getInternalClass(oop klass);
+  static symbolOop getInternalSymbol(oop string);
+
+  static methodOop getInternalMethod(jobject method) {
+    return getInternalMethod(JNIHandles::resolve(method));
+  }
+  static klassOop getInternalClass(jobject klass) {
+    return getInternalClass(JNIHandles::resolve(klass));
+  }
+  static symbolOop getInternalSymbol(jobject string) {
+    return getInternalSymbol(JNIHandles::resolve(string));
+  }
 };
 
 // Tracing macros
--- a/src/share/vm/c1x/c1x_VMEntries.cpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/c1x/c1x_VMEntries.cpp	Mon Aug 02 15:44:38 2010 -0700
@@ -30,10 +30,10 @@
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_code
-* Signature: (Ljava/lang/Object;)[B
+* Signature: (Ljava/lang/reflect/Method;)[B
 */
 JNIEXPORT jbyteArray JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1code(JNIEnv *env, jobject, jobject method) {
-  methodOop m = (methodOop)JNIHandles::resolve(method);
+  methodOop m = C1XObjects::getInternalMethod(method);
   int code_size = m->code_size();
   jbyteArray result = env->NewByteArray(code_size);
   env->SetByteArrayRegion(result, 0, code_size, (const jbyte *)m->code_base());
@@ -43,53 +43,59 @@
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_maxStackSize
-* Signature: (Ljava/lang/Object;)I
+* Signature: (Ljava/lang/reflect/Method;)I
 */
 JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxStackSize(JNIEnv *, jobject, jobject method) {
-  methodOop m = (methodOop)JNIHandles::resolve(method);
-  return m->max_stack();
+  return C1XObjects::getInternalMethod(method)->max_stack();
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_maxLocals
-* Signature: (Ljava/lang/Object;)I
+* Signature: (Ljava/lang/reflect/Method;)I
 */
 JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxLocals(JNIEnv *, jobject, jobject method) {
-  methodOop m = (methodOop)JNIHandles::resolve(method);
-  return m->max_locals();
+  return C1XObjects::getInternalMethod(method)->max_locals();
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_holder
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;
+* Signature: (Ljava/lang/reflect/Method;)Lcom/sun/cri/ri/RiType;
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1holder(JNIEnv *, jobject, jobject method) {
   VM_ENTRY_MARK
-  methodOop m = (methodOop)JNIHandles::resolve(method);
-  klassOop k = m->method_holder();
-  return JNIHandles::make_local(Thread::current(), C1XCompiler::get_RiType(k));
+  oop holder = VMExits::createRiType(C1XObjects::getInternalMethod(method)->method_holder(), THREAD);
+  return JNIHandles::make_local(THREAD, holder);
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_signature
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiSignature;
+* Signature: (Ljava/lang/reflect/Method;)Lcom/sun/cri/ri/RiSignature;
 */
 JNIEXPORT jstring JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1signature(JNIEnv *env, jobject, jobject method) {
-  methodOop m = (methodOop)JNIHandles::resolve(method);
-  return env->NewStringUTF(m->signature()->as_utf8());
+  VM_ENTRY_MARK
+  return (jstring)JNIHandles::make_local(java_lang_String::create_from_symbol(C1XObjects::getInternalMethod(method)->signature(), Thread::current())());
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_name
-* Signature: (Ljava/lang/Object;)Ljava/lang/String;
+* Signature: (Ljava/lang/reflect/Method;)Ljava/lang/String;
 */
 JNIEXPORT jstring JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1name(JNIEnv *env, jobject, jobject method) {
-  methodOop m = (methodOop)JNIHandles::resolve(method);
-  return env->NewStringUTF(m->name()->as_utf8());
+  VM_ENTRY_MARK
+  return (jstring)JNIHandles::make_local(java_lang_String::create_from_symbol(C1XObjects::getInternalMethod(method)->name(), Thread::current())());
+}
+
+/*
+* Class:     com_sun_hotspot_c1x_VMEntries
+* Method:    RiMethod_accessFlags
+* Signature: (Ljava/lang/reflect/Method;)I
+*/
+JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags(JNIEnv *, jobject, jobject method) {
+  return C1XObjects::getInternalMethod(method)->access_flags().as_int();
 }
 
 /*
@@ -99,69 +105,36 @@
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiSignature_1lookupType(JNIEnv *, jobject, jstring name, jobject accessor) {
   VM_ENTRY_MARK
-  klassOop k = (klassOop)JNIHandles::resolve(accessor);
-  oop n = JNIHandles::resolve_external_guard(name);
+  klassOop k = C1XObjects::getInternalClass(accessor);
+  oop n = JNIHandles::resolve(name);
   if (n == NULL) {
     THROW_MSG_(vmSymbols::java_lang_NullPointerException(), "Name must not be null.", NULL);
   }
-  char* utf8 = java_lang_String::as_utf8_string(n);
-  symbolOop symbol = oopFactory::new_symbol(utf8, java_lang_String::length(n), THREAD);
-  oop result = C1XCompiler::get_RiType(symbol, k);
+  oop result = C1XCompiler::get_RiType(n, k, THREAD);
   return JNIHandles::make_local(THREAD, result);
 }
 
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    RiSignature_symbolToString
-* Signature: (Ljava/lang/Object;)Ljava/lang/String;
-*/
-JNIEXPORT jstring JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiSignature_1symbolToString(JNIEnv *env, jobject, jobject symbol) {
-  symbolOop s = (symbolOop)JNIHandles::resolve(symbol);
-  return env->NewStringUTF(s->as_utf8());
-}
-
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    RiType_javaClass
-* Signature: (Ljava/lang/Object;)Ljava/lang/Class;
-*/
-JNIEXPORT jclass JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1javaClass(JNIEnv *, jobject, jobject klass) {
-  klassOop k = (klassOop)JNIHandles::resolve(klass);
-  oop result = k->klass_part()->java_mirror();
-  return (jclass) JNIHandles::make_local(Thread::current(), result);
-}
-
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    RiType_name
-* Signature: (Ljava/lang/Object;)Ljava/lang/String;
-*/
-JNIEXPORT jstring JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1name(JNIEnv *env, jobject, jobject klass) {
-  klassOop k = (klassOop)JNIHandles::resolve(klass);
-  return env->NewStringUTF(k->klass_part()->name()->as_utf8());
-}
-
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiConstantPool_lookupConstant
-* Signature: (Ljava/lang/Object;I)Ljava/lang/Object;
+* Signature: (Ljava/lang/Class;I)Ljava/lang/Object;
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupConstant(JNIEnv *env, jobject, jobject cpHandle, jint index) {
-
   VM_ENTRY_MARK;
-  constantPoolOop cp = (constantPoolOop)JNIHandles::resolve(cpHandle);
+  klassOop klass = C1XObjects::getInternalClass(cpHandle);
+  constantPoolOop cp = instanceKlass::cast(klass)->constants();
 
   oop result = NULL;
   constantTag tag = cp->tag_at(index);
   if (tag.is_int()) {
-    result = VMExits::createCiConstantInt(cp->int_at(index));
+    result = VMExits::createCiConstantInt(cp->int_at(index), CHECK_0);
   } else if (tag.is_long()) {
-    result = VMExits::createCiConstantLong(cp->long_at(index));
+    result = VMExits::createCiConstantLong(cp->long_at(index), CHECK_0);
   } else if (tag.is_float()) {
-    result = VMExits::createCiConstantFloat(cp->float_at(index));
+    result = VMExits::createCiConstantFloat(cp->float_at(index), CHECK_0);
   } else if (tag.is_double()) {
-    result = VMExits::createCiConstantDouble(cp->double_at(index));
+    result = VMExits::createCiConstantDouble(cp->double_at(index), CHECK_0);
   } else if (tag.is_string() || tag.is_unresolved_string()) {
     oop string = NULL;
     if (cp->is_pseudo_string_at(index)) {
@@ -175,7 +148,7 @@
         return NULL;
       }
     }
-    result = VMExits::createCiConstantObject(string);
+    result = VMExits::createCiConstantObject(string, CHECK_0);
   } else if (tag.is_klass() || tag.is_unresolved_klass()) {
     
     // TODO: Return RiType object
@@ -194,7 +167,7 @@
   } else if (tag.is_object()) {
     oop obj = cp->object_at(index);
     assert(obj->is_instance(), "must be an instance");
-    result = VMExits::createCiConstantObject(obj);
+    result = VMExits::createCiConstantObject(obj, CHECK_0);
   } else {
     ShouldNotReachHere();
   }
@@ -209,11 +182,13 @@
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jobject cpHandle, jint index, jbyte byteCode) {
   VM_ENTRY_MARK;
-  constantPoolOop cp = (constantPoolOop)JNIHandles::resolve(cpHandle);
+  klassOop klass = C1XObjects::getInternalClass(cpHandle);
+  constantPoolOop cp = instanceKlass::cast(klass)->constants();
+//  assert(cp->tag_at(cp->cache() != NULL ? cp->cache()->entry_at(index)->constant_pool_index() : index).is_method(), "reading field from non-field cp index");
   Bytecodes::Code bc = (Bytecodes::Code)(((int)byteCode) & 0xFF);
   ciInstanceKlass* loading_klass = (ciInstanceKlass *)CURRENT_ENV->get_object(cp->pool_holder());
   ciMethod *method = CURRENT_ENV->get_method_by_index(cp, index, bc, loading_klass);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiMethod(method));
+  return JNIHandles::make_local(THREAD, VMExits::createRiMethod((methodOop)method->get_oop(), THREAD));
 }
 
 /*
@@ -233,11 +208,12 @@
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupType(JNIEnv *env, jobject, jobject cpHandle, jint index) {
   VM_ENTRY_MARK;
-  constantPoolOop cp = (constantPoolOop)JNIHandles::resolve(cpHandle);
-  ciInstanceKlass* loading_klass = (ciInstanceKlass *)CURRENT_ENV->get_object(cp->pool_holder());
+  klassOop cpKlass = C1XObjects::getInternalClass(cpHandle);
+  constantPoolOop cp = instanceKlass::cast(cpKlass)->constants();
+  ciInstanceKlass* loading_klass = (ciInstanceKlass *)CURRENT_ENV->get_object(cpKlass);
   bool is_accessible = false;
   ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, index, is_accessible, loading_klass);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass));
+  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass, cpKlass, THREAD));
 
 }
 
@@ -248,77 +224,55 @@
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField(JNIEnv *env, jobject, jobject cpHandle, jint index) {
   VM_ENTRY_MARK;
-  constantPoolOop cp = (constantPoolOop)JNIHandles::resolve(cpHandle);
+  klassOop klass = C1XObjects::getInternalClass(cpHandle);
+  constantPoolOop cp = instanceKlass::cast(klass)->constants();
+//  assert(cp->tag_at(cp->cache() != NULL ? cp->cache()->entry_at(index)->constant_pool_index() : index).is_field(), "reading field from non-field cp index");
   ciInstanceKlass* loading_klass = (ciInstanceKlass *)CURRENT_ENV->get_object(cp->pool_holder());
   ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiField(field));
+  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiField(field, THREAD));
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    findRiType
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;
+* Method:    RiType_name
+* Signature: (Ljava/lang/Class;)Ljava/lang/String;
 */
-JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_findRiType(JNIEnv *, jobject, jobject klass) {
-  VM_ENTRY_MARK;
-  klassOop o = (klassOop)JNIHandles::resolve(klass);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(o));
-}
-
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    RiRuntime_getConstantPool
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiConstantPool;
-*/
-JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiRuntime_1getConstantPool(JNIEnv *, jobject, jobject klass) {
-  VM_ENTRY_MARK;
-  klassOop o = (klassOop)JNIHandles::resolve(klass);
-  return JNIHandles::make_local(THREAD, C1XCompiler::get_RiConstantPool(((instanceKlass*)o->klass_part())->constants()));
+JNIEXPORT jstring JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1name(JNIEnv *env, jobject, jobject klass) {
+  VM_ENTRY_MARK
+  klassOop k = C1XObjects::getInternalClass(klass);
+  return (jstring)JNIHandles::make_local(java_lang_String::create_from_symbol(k->klass_part()->name(), Thread::current())());
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiType_isArrayClass
-* Signature: (Ljava/lang/Object;)Z
+* Signature: (Ljava/lang/Class;)Z
 */
 JNIEXPORT jboolean JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1isArrayClass(JNIEnv *, jobject, jobject klass) {
-  klassOop o = (klassOop)JNIHandles::resolve(klass);
-  o->print();
-  bool result = o->klass_part()->oop_is_array();
-  tty->print_cr("result=%d", (int)result);
-  return result;
+  klassOop o = C1XObjects::getInternalClass(klass);
+  return o->klass_part()->oop_is_array();
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiType_isInstanceClass
-* Signature: (Ljava/lang/Object;)Z
+* Signature: (Ljava/lang/Class;)Z
 */
 JNIEXPORT jboolean JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInstanceClass(JNIEnv *, jobject, jobject klass) {
-  klassOop o = (klassOop)JNIHandles::resolve(klass);
+  klassOop o = C1XObjects::getInternalClass(klass);
   return o->klass_part()->oop_is_instanceKlass();
 }
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiType_isInterface
-* Signature: (Ljava/lang/Object;)Z
+* Signature: (Ljava/lang/Class;)Z
 */
 JNIEXPORT jboolean JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInterface(JNIEnv *, jobject, jobject klass) {
-  klassOop o = (klassOop)JNIHandles::resolve(klass);
+  klassOop o = C1XObjects::getInternalClass(klass);
   return o->klass_part()->is_interface();
 }
 
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    RiMethod_accessFlags
-* Signature: (Ljava/lang/Object;)I
-*/
-JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags(JNIEnv *, jobject, jobject method) {
-  methodOop m = (methodOop)JNIHandles::resolve(method);
-  return m->access_flags().as_int();
-}
-
 
 // helpers used to set fields in the HotSpotVMConfig object
 jfieldID getFieldID(JNIEnv* env, jobject obj, const char* name, const char* sig) {
@@ -372,7 +326,7 @@
   void initialize() {
     HotSpotType = java_lang_Class::as_klassOop(JNIHandles::resolve(jniHotSpotType));
     HotSpotTargetMethod = java_lang_Class::as_klassOop(JNIHandles::resolve(jniHotSpotTargetMethod));
-    HotSpotType_klassOop = compute_offset(HotSpotType, "klassOop", "Ljava/lang/Object;");
+    HotSpotType_klassOop = compute_offset(HotSpotType, "klass", "Ljava/lang/Class;");
   }
 };
 
@@ -387,12 +341,15 @@
 JNIEXPORT void JNICALL Java_com_sun_hotspot_c1x_VMEntries_installCode(JNIEnv *jniEnv, jobject, jobject targetMethod) {
   TypeHelper types(jniEnv);
 
-  methodOop m = (methodOop)JNIHandles::resolve(get_object(jniEnv, targetMethod, "methodOop"));
+  methodOop m = C1XObjects::getInternalMethod(get_object(jniEnv, targetMethod, "method", "Ljava/lang/reflect/Method;"));
   jbyteArray code = (jbyteArray)get_object(jniEnv, targetMethod, "code", "[B");
+  jint codeSize = get_int(jniEnv, targetMethod, "codeSize");
   jintArray relocationOffsetsObj = (jintArray)get_object(jniEnv, targetMethod, "relocationOffsets", "[I");
   jobjectArray relocationDataObj = (jobjectArray)get_object(jniEnv, targetMethod, "relocationData", "[Ljava/lang/Object;");
   jint frameSize = get_int(jniEnv, targetMethod, "frameSize");
 
+  assert(codeSize > 0 && codeSize <= ((arrayOop)JNIHandles::resolve(code))->length(), "invalid codeSize");
+
   CodeOffsets offsets;
 
   // TODO: This is a hack.. Produce correct entries.
@@ -412,7 +369,6 @@
   env->set_dependencies(new Dependencies(env));
   ciMethod *ciMethodObject = (ciMethod *)env->get_object(m);
 
-  int codeSize = ((arrayOop)JNIHandles::resolve(code))->length();
   int relocationCount = relocationOffsetsObj == NULL ? 0 : ((arrayOop)JNIHandles::resolve(relocationOffsetsObj))->length();
 
   CodeBuffer buffer("c1x nmethod", codeSize, relocationCount * relocInfo::length_limit);
@@ -429,6 +385,7 @@
 
     for (int i=0; i<relocationCount; i++) {
       address inst = (address)instructions->start() + relocationOffsets[i];
+      u_char inst_byte = *inst;
       oop obj = relocationObjects[i];
       assert(obj != NULL, "NULL oop needn't be patched");
 
@@ -440,13 +397,13 @@
           *((int*)operand) = (int)disp;
 
           instructions->relocate(inst, runtime_call_Relocation::spec(), Assembler::call32_operand);
-          tty->print_cr("relocating (Long)");
+          tty->print_cr("relocating (Long) %02x at %016x/%016x", inst_byte, inst, operand);
       } else if (obj->is_a(types.HotSpotType)) {
           address operand = Assembler::locate_operand(inst, Assembler::imm_operand);
 
-          *((oop**)operand) = obj->obj_field_addr<oop>(types.HotSpotType_klassOop);
+          *((jobject*)operand) = JNIHandles::make_local(C1XObjects::getInternalClass(obj->obj_field(types.HotSpotType_klassOop)));
           instructions->relocate(inst, oop_Relocation::spec_for_immediate(), Assembler::imm_operand);
-          tty->print_cr("relocating (HotSpotType)");
+          tty->print_cr("relocating (HotSpotType) %02x at %016x/%016x", inst_byte, inst, operand);
       } else {
           tty->print_cr("unknown relocation type");
       }
@@ -455,6 +412,9 @@
 
   buffer.print();
 
+  address entry = instructions->start() + offsets.value(CodeOffsets::Verified_Entry);
+
+
   OopMapSet oop_map_set;
   ExceptionHandlerTable handler_table;
   ImplicitExceptionTable inc_table;
@@ -471,6 +431,7 @@
 * Signature: ()Lcom/sun/hotspot/c1x/HotSpotVMConfig;
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_getConfiguration(JNIEnv *env, jobject) {
+  tty->print_cr("Java_com_sun_hotspot_c1x_VMEntries_getConfiguration");
   jclass klass = env->FindClass("com/sun/hotspot/c1x/HotSpotVMConfig");
   assert(klass != NULL, "HotSpot vm config class not found");
   jobject config = env->AllocObject(klass);
@@ -483,6 +444,7 @@
   set_int(env, config, "vmPageSize", os::vm_page_size());
   set_int(env, config, "stackShadowPages", StackShadowPages);
   set_int(env, config, "hubOffset", oopDesc::klass_offset_in_bytes());
+  set_int(env, config, "arrayLengthOffset", arrayOopDesc::length_offset_in_bytes());
   set_long(env, config, "instanceofStub", (long)Runtime1::entry_for(Runtime1::slow_subtype_check_id));
   set_long(env, config, "debugStub", (long)warning);
   return config;
@@ -490,26 +452,23 @@
 
 
 JNINativeMethod VMEntries_methods[] = {
-  {CC"RiMethod_code",                   CC"(Ljava/lang/Object;)[B",                                                 FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1code)},
-  {CC"RiMethod_maxStackSize",           CC"(Ljava/lang/Object;)I",                                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxStackSize)},
-  {CC"RiMethod_maxLocals",              CC"(Ljava/lang/Object;)I",                                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxLocals)},
-  {CC"RiMethod_holder",                 CC"(Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;",                            FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1holder)},
-  {CC"RiMethod_signature",              CC"(Ljava/lang/Object;)Ljava/lang/String;",                                 FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1signature)},
-  {CC"RiMethod_name",                   CC"(Ljava/lang/Object;)Ljava/lang/String;",                                 FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1name)},
-  {CC"RiSignature_lookupType",          CC"(Ljava/lang/String;Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;",          FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiSignature_1lookupType)},
-  {CC"RiSignature_symbolToString",      CC"(Ljava/lang/Object;)Ljava/lang/String;",                                 FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiSignature_1symbolToString)},
-  {CC"RiType_javaClass",                CC"(Ljava/lang/Object;)Ljava/lang/Class;",                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1javaClass)},
-  {CC"RiType_name",                     CC"(Ljava/lang/Object;)Ljava/lang/String;",                                 FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1name)},
-  {CC"RiConstantPool_lookupConstant",   CC"(Ljava/lang/Object;I)Ljava/lang/Object;",                                FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupConstant)},
-  {CC"RiConstantPool_lookupMethod",     CC"(Ljava/lang/Object;IB)Lcom/sun/cri/ri/RiMethod;",                        FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupMethod)},
-  {CC"RiConstantPool_lookupSignature",  CC"(Ljava/lang/Object;I)Lcom/sun/cri/ri/RiSignature;",                      FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupSignature)},
-  {CC"RiConstantPool_lookupType",       CC"(Ljava/lang/Object;I)Lcom/sun/cri/ri/RiType;",                           FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupType)},
-  {CC"RiConstantPool_lookupField",      CC"(Ljava/lang/Object;I)Lcom/sun/cri/ri/RiField;",                          FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField)},
-  {CC"RiRuntime_getConstantPool",       CC"(Ljava/lang/Object;)Lcom/sun/cri/ri/RiConstantPool;",                    FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiRuntime_1getConstantPool)},
-  {CC"RiType_isArrayClass",             CC"(Ljava/lang/Object;)Z",                                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isArrayClass)},
-  {CC"RiType_isInstanceClass",          CC"(Ljava/lang/Object;)Z",                                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInstanceClass)},
-  {CC"RiType_isInterface",              CC"(Ljava/lang/Object;)Z",                                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInterface)},
-  {CC"RiMethod_accessFlags",            CC"(Ljava/lang/Object;)I",                                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags)},
+  {CC"RiMethod_code",                   CC"(Ljava/lang/reflect/Method;)[B",                                         FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1code)},
+  {CC"RiMethod_maxStackSize",           CC"(Ljava/lang/reflect/Method;)I",                                          FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxStackSize)},
+  {CC"RiMethod_maxLocals",              CC"(Ljava/lang/reflect/Method;)I",                                          FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxLocals)},
+  {CC"RiMethod_holder",                 CC"(Ljava/lang/reflect/Method;)Lcom/sun/cri/ri/RiType;",                    FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1holder)},
+  {CC"RiMethod_signature",              CC"(Ljava/lang/reflect/Method;)Ljava/lang/String;",                         FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1signature)},
+  {CC"RiMethod_name",                   CC"(Ljava/lang/reflect/Method;)Ljava/lang/String;",                         FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1name)},
+  {CC"RiMethod_accessFlags",            CC"(Ljava/lang/reflect/Method;)I",                                          FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags)},
+  {CC"RiSignature_lookupType",          CC"(Ljava/lang/String;Ljava/lang/Class;)Lcom/sun/cri/ri/RiType;",           FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiSignature_1lookupType)},
+  {CC"RiType_name",                     CC"(Ljava/lang/Class;)Ljava/lang/String;",                                  FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1name)},
+  {CC"RiConstantPool_lookupConstant",   CC"(Ljava/lang/Class;I)Ljava/lang/Object;",                                 FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupConstant)},
+  {CC"RiConstantPool_lookupMethod",     CC"(Ljava/lang/Class;IB)Lcom/sun/cri/ri/RiMethod;",                         FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupMethod)},
+  {CC"RiConstantPool_lookupSignature",  CC"(Ljava/lang/Class;I)Lcom/sun/cri/ri/RiSignature;",                       FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupSignature)},
+  {CC"RiConstantPool_lookupType",       CC"(Ljava/lang/Class;I)Lcom/sun/cri/ri/RiType;",                            FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupType)},
+  {CC"RiConstantPool_lookupField",      CC"(Ljava/lang/Class;I)Lcom/sun/cri/ri/RiField;",                           FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField)},
+  {CC"RiType_isArrayClass",             CC"(Ljava/lang/Class;)Z",                                                   FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isArrayClass)},
+  {CC"RiType_isInstanceClass",          CC"(Ljava/lang/Class;)Z",                                                   FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInstanceClass)},
+  {CC"RiType_isInterface",              CC"(Ljava/lang/Class;)Z",                                                   FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1isInterface)},
   {CC"installCode",                     CC"(Lcom/sun/hotspot/c1x/HotSpotTargetMethod;)V",                           FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_installCode)},
   {CC"getConfiguration",                CC"()Lcom/sun/hotspot/c1x/HotSpotVMConfig;",                                FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getConfiguration)}
 };
--- a/src/share/vm/c1x/c1x_VMEntries.hpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/c1x/c1x_VMEntries.hpp	Mon Aug 02 15:44:38 2010 -0700
@@ -33,7 +33,7 @@
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_code
-* Signature: (Ljava/lang/Object;)[B
+* Signature: (Ljava/lang/reflect/Method;)[B
 */
 JNIEXPORT jbyteArray JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1code
   (JNIEnv *, jobject, jobject);
@@ -41,7 +41,7 @@
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_maxStackSize
-* Signature: (Ljava/lang/Object;)I
+* Signature: (Ljava/lang/reflect/Method;)I
 */
 JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxStackSize
   (JNIEnv *, jobject, jobject);
@@ -49,16 +49,15 @@
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_maxLocals
-* Signature: (Ljava/lang/Object;)I
+* Signature: (Ljava/lang/reflect/Method;)I
 */
 JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1maxLocals
   (JNIEnv *, jobject, jobject);
 
-
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_holder
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;
+* Signature: (Ljava/lang/reflect/Method;)Lcom/sun/cri/ri/RiType;
 */
 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1holder
   (JNIEnv *, jobject, jobject);
@@ -66,7 +65,7 @@
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_signature
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiSignature;
+* Signature: (Ljava/lang/reflect/Method;)Lcom/sun/cri/ri/RiSignature;
 */
 JNIEXPORT jstring JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1signature
   (JNIEnv *, jobject, jobject);
@@ -74,13 +73,21 @@
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiMethod_name
-* Signature: (Ljava/lang/Object;)Ljava/lang/String;
+* Signature: (Ljava/lang/reflect/Method;)Ljava/lang/String;
 */
 JNIEXPORT jstring JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1name
   (JNIEnv *, jobject, jobject);
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
+* Method:    RiMethod_accessFlags
+* Signature: (Ljava/lang/reflect/Method;)I
+*/
+JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags
+(JNIEnv *, jobject, jobject);
+
+/*
+* Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiSignature_lookupType
 * Signature: (Ljava/lang/String;Lcom/sun/cri/ri/RiType;)Lcom/sun/cri/ri/RiType;
 */
@@ -154,22 +161,6 @@
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    findRiType
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;
-*/
-JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_findRiType
-(JNIEnv *, jobject, jobject);
-
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    RiRuntime_getConstantPool
-* Signature: (Ljava/lang/Object;)Lcom/sun/cri/ri/RiConstantPool;
-*/
-JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiRuntime_1getConstantPool
-(JNIEnv *, jobject, jobject);
-
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    RiType_isArrayClass
 * Signature: (Ljava/lang/Object;)Z
 */
@@ -194,14 +185,6 @@
 
 /*
 * Class:     com_sun_hotspot_c1x_VMEntries
-* Method:    RiMethod_accessFlags
-* Signature: (Ljava/lang/Object;)I
-*/
-JNIEXPORT jint JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiMethod_1accessFlags
-(JNIEnv *, jobject, jobject);
-
-/*
-* Class:     com_sun_hotspot_c1x_VMEntries
 * Method:    installCode
 * Signature: (Lcom/sun/hotspot/c1x/HotSpotTargetMethod;)V
 */
--- a/src/share/vm/c1x/c1x_VMExits.cpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/c1x/c1x_VMExits.cpp	Mon Aug 02 15:44:38 2010 -0700
@@ -24,19 +24,7 @@
 
 # include "incls/_precompiled.incl"
 # include "incls/_c1x_VMExits.cpp.incl"
-/*
-jobject         OopCache::handles = NULL;
-jobject         OopCache::mirrors = NULL;
-int             OopCache::capacity = 0;
-int             OopCache::used = 0;
 
-void initialize() {
-
-}
-  static Handle mirror(oop internal_object);
-  static Handle resolve(oop mirror);
-
-*/
 KlassHandle     VMExits::_vmExitsKlass;
 Handle          VMExits::_vmExitsObject;
 
@@ -63,146 +51,149 @@
   return _vmExitsObject;
 }
 
-void VMExits::compileMethod(oop method, int entry_bci) {
+void VMExits::compileMethod(methodOop method, int entry_bci) {
   assert(method != NULL, "just checking");
+  oop reflected_method = C1XObjects::getReflectedMethod(method, Thread::current());
   JavaValue result(T_VOID);
   JavaCallArguments args;
   args.push_oop(instance());
-  args.push_oop(method);
+  args.push_oop(reflected_method);
   args.push_int(entry_bci);
   JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, Thread::current());
   check_pending_exception("Error while calling compileMethod");
 }
 
-oop VMExits::createRiMethod(methodOop m) {
+oop VMExits::createRiMethod(methodOop m, TRAPS) {
   assert(m != NULL, "just checking");
+  oop reflected_method = C1XObjects::getReflectedMethod(m, CHECK_0);
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
-  args.push_oop(m);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethod_name(), vmSymbols::createRiMethod_signature(), &args, Thread::current());
+  args.push_oop(reflected_method);
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiMethod_name(), vmSymbols::createRiMethod_signature(), &args, THREAD);
   check_pending_exception("Error while calling createRiMethod");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createRiField(oop field_holder, symbolOop field_name, oop field_type, int index) {
+oop VMExits::createRiField(oop field_holder, symbolOop field_name, oop field_type, int index, TRAPS) {
   assert(field_holder != NULL && field_name != NULL && field_type != NULL, "just checking");
+  oop name = C1XObjects::getReflectedSymbol(field_name, CHECK_0);
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
   args.push_oop(field_holder);
-  args.push_oop(field_name);
+  args.push_oop(name);
   args.push_oop(field_type);
   args.push_int(index);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, Thread::current());
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiField_name(), vmSymbols::createRiField_signature(), &args, THREAD);
   check_pending_exception("Error while calling createRiField");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createRiType(klassOop k) {
+oop VMExits::createRiType(klassOop k, TRAPS) {
   assert(k != NULL, "just checking");
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
-  args.push_oop(k);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, Thread::current());
+  args.push_oop(C1XObjects::getReflectedClass(k));
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiType_name(), vmSymbols::createRiType_signature(), &args, THREAD);
   check_pending_exception("Error while calling createRiType");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createRiTypePrimitive(int basic_type) {
+oop VMExits::createRiTypePrimitive(int basic_type, TRAPS) {
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
   args.push_int(basic_type);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, Thread::current());
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypePrimitive_name(), vmSymbols::createRiTypePrimitive_signature(), &args, THREAD);
   check_pending_exception("Error while calling createRiTypePrimitive");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createRiTypeUnresolved(symbolOop name, klassOop accessor) {
+oop VMExits::createRiTypeUnresolved(symbolOop name, klassOop accessor, TRAPS) {
 //  assert(name != NULL && accessor != NULL, "just checking");
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
-  args.push_oop(name);
-  args.push_oop(accessor);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, Thread::current());
+  args.push_oop(C1XObjects::getReflectedSymbol(name, THREAD));
+  args.push_oop(C1XObjects::getReflectedClass(accessor));
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiTypeUnresolved_name(), vmSymbols::createRiTypeUnresolved_signature(), &args, THREAD);
   check_pending_exception("Error while calling createRiTypeUnresolved");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createRiConstantPool(constantPoolOop cp) {
+oop VMExits::createRiConstantPool(constantPoolOop cp, TRAPS) {
   assert(cp != NULL, "just checking");
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
-  args.push_oop(cp);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, Thread::current());
+  args.push_oop(C1XObjects::getReflectedClass(cp->klass()));
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiConstantPool_name(), vmSymbols::createRiConstantPool_signature(), &args, THREAD);
   check_pending_exception("Error while calling createRiConstantPool");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createRiSignature(symbolOop symbol) {
+oop VMExits::createRiSignature(symbolOop symbol, TRAPS) {
   assert(symbol != NULL, "just checking");
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
-  args.push_oop(symbol);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, Thread::current());
+  args.push_oop(C1XObjects::getReflectedSymbol(symbol, THREAD));
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createRiSignature_name(), vmSymbols::createRiSignature_signature(), &args, THREAD);
   check_pending_exception("Error while calling createRiSignature");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createCiConstantInt(jint value) {
+oop VMExits::createCiConstantInt(jint value, TRAPS) {
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
   args.push_int(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantInt_name(), vmSymbols::createCiConstantInt_signature(), &args, Thread::current());
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantInt_name(), vmSymbols::createCiConstantInt_signature(), &args, THREAD);
   check_pending_exception("Error while calling createCiConstantInt");
   return (oop)result.get_jobject();
 
 }
 
-oop VMExits::createCiConstantLong(jlong value) {
+oop VMExits::createCiConstantLong(jlong value, TRAPS) {
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
   args.push_long(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantLong_name(), vmSymbols::createCiConstantLong_signature(), &args, Thread::current());
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantLong_name(), vmSymbols::createCiConstantLong_signature(), &args, THREAD);
   check_pending_exception("Error while calling createCiConstantFloat");
   return (oop)result.get_jobject();
 
 }
 
-oop VMExits::createCiConstantFloat(jfloat value) {
+oop VMExits::createCiConstantFloat(jfloat value, TRAPS) {
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
   args.push_float(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, Thread::current());
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantFloat_name(), vmSymbols::createCiConstantFloat_signature(), &args, THREAD);
   check_pending_exception("Error while calling createCiConstantFloat");
   return (oop)result.get_jobject();
 
 }
 
-oop VMExits::createCiConstantDouble(jdouble value) {
+oop VMExits::createCiConstantDouble(jdouble value, TRAPS) {
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
   args.push_double(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, Thread::current());
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantDouble_name(), vmSymbols::createCiConstantDouble_signature(), &args, THREAD);
   check_pending_exception("Error while calling createCiConstantDouble");
   return (oop)result.get_jobject();
 }
 
-oop VMExits::createCiConstantObject(oop value) {
+oop VMExits::createCiConstantObject(oop value, TRAPS) {
   JavaValue result(T_OBJECT);
   JavaCallArguments args;
   args.push_oop(instance());
   args.push_oop(value);
-  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantObject_signature(), &args, Thread::current());
+  JavaCalls::call_interface(&result, vmExitsKlass(), vmSymbols::createCiConstantObject_name(), vmSymbols::createCiConstantObject_signature(), &args, THREAD);
   check_pending_exception("Error while calling createCiConstantObject");
   return (oop)result.get_jobject();
 }
--- a/src/share/vm/c1x/c1x_VMExits.hpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/c1x/c1x_VMExits.hpp	Mon Aug 02 15:44:38 2010 -0700
@@ -50,20 +50,20 @@
   static Handle& instance();
 
 
-  static void compileMethod(oop method, int entry_bci);
+  static void compileMethod(methodOop method, int entry_bci);
 
-  static oop createRiMethod(methodOop m);
-  static oop createRiField(oop field_holder, symbolOop field_name, oop field_type, int index);
-  static oop createRiType(klassOop k);
-  static oop createRiConstantPool(constantPoolOop cp);
-  static oop createRiTypeUnresolved(symbolOop name, klassOop accessor);
-  static oop createRiSignature(symbolOop name);
-  static oop createCiConstantInt(jint value);
-  static oop createCiConstantLong(jlong value);
-  static oop createCiConstantFloat(jfloat value);
-  static oop createCiConstantDouble(jdouble value);
-  static oop createCiConstantObject(oop value);
-  static oop createRiTypePrimitive(int basic_type);
+  static oop createRiMethod(methodOop method, TRAPS);
+  static oop createRiField(oop field_holder, symbolOop field_name, oop field_type, int index, TRAPS);
+  static oop createRiType(klassOop k, TRAPS);
+  static oop createRiConstantPool(constantPoolOop cp, TRAPS);
+  static oop createRiTypeUnresolved(symbolOop name, klassOop accessor, TRAPS);
+  static oop createRiSignature(symbolOop name, TRAPS);
+  static oop createCiConstantInt(jint value, TRAPS);
+  static oop createCiConstantLong(jlong value, TRAPS);
+  static oop createCiConstantFloat(jfloat value, TRAPS);
+  static oop createCiConstantDouble(jdouble value, TRAPS);
+  static oop createCiConstantObject(oop value, TRAPS);
+  static oop createRiTypePrimitive(int basic_type, TRAPS);
 };
 
 inline void check_pending_exception(const char* message) {
--- a/src/share/vm/ci/ciInstanceKlass.cpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/ci/ciInstanceKlass.cpp	Mon Aug 02 15:44:38 2010 -0700
@@ -57,10 +57,9 @@
   }
 
   Thread *thread = Thread::current();
-  if (ciObjectFactory::is_initialized()) {
+  if (ciObjectFactory::is_initialized() && !UseC1X) {
     _loader = JNIHandles::make_local(thread, ik->class_loader());
-    _protection_domain = JNIHandles::make_local(thread,
-                                                ik->protection_domain());
+    _protection_domain = JNIHandles::make_local(thread, ik->protection_domain());
     _is_shared = false;
   } else {
     Handle h_loader(thread, ik->class_loader());
--- a/src/share/vm/ci/ciObject.cpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/ci/ciObject.cpp	Mon Aug 02 15:44:38 2010 -0700
@@ -48,7 +48,7 @@
 // ciObject::ciObject
 ciObject::ciObject(oop o) {
   ASSERT_IN_VM;
-  if (ciObjectFactory::is_initialized()) {
+  if (ciObjectFactory::is_initialized() && !UseC1X) {
     _handle = JNIHandles::make_local(o);
   } else {
     _handle = JNIHandles::make_global(o);
@@ -63,7 +63,7 @@
 //
 ciObject::ciObject(Handle h) {
   ASSERT_IN_VM;
-  if (ciObjectFactory::is_initialized()) {
+  if (ciObjectFactory::is_initialized() && !UseC1X) {
     _handle = JNIHandles::make_local(h());
   } else {
     _handle = JNIHandles::make_global(h);
--- a/src/share/vm/classfile/vmSymbols.hpp	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/classfile/vmSymbols.hpp	Mon Aug 02 15:44:38 2010 -0700
@@ -251,21 +251,21 @@
   template(com_sun_cri_ri_RiType,                     "com/sun/cri/ri/RiType")                                          \
   template(com_sun_cri_ri_RiConstantPool,             "com/sun/cri/ri/RiConstantPool")                                  \
   template(compileMethod_name,                        "compileMethod")                                                  \
-  template(compileMethod_signature,                   "(Lcom/sun/cri/ri/RiMethod;I)V")                                  \
+  template(compileMethod_signature,                   "(Ljava/lang/reflect/Method;I)V")                                 \
   template(createRiMethod_name,                       "createRiMethod")                                                 \
-  template(createRiMethod_signature,                  "(Ljava/lang/Object;)Lcom/sun/cri/ri/RiMethod;")                  \
+  template(createRiMethod_signature,                  "(Ljava/lang/reflect/Method;)Lcom/sun/cri/ri/RiMethod;")          \
   template(createRiSignature_name,                    "createRiSignature")                                              \
-  template(createRiSignature_signature,               "(Ljava/lang/Object;)Lcom/sun/cri/ri/RiSignature;")               \
+  template(createRiSignature_signature,               "(Ljava/lang/String;)Lcom/sun/cri/ri/RiSignature;")               \
   template(createRiField_name,                        "createRiField")                                                  \
-  template(createRiField_signature,                   "(Lcom/sun/cri/ri/RiType;Ljava/lang/Object;Lcom/sun/cri/ri/RiType;I)Lcom/sun/cri/ri/RiField;")                  \
+  template(createRiField_signature,                   "(Lcom/sun/cri/ri/RiType;Ljava/lang/String;Lcom/sun/cri/ri/RiType;I)Lcom/sun/cri/ri/RiField;") \
   template(createRiType_name,                         "createRiType")                                                   \
-  template(createRiType_signature,                    "(Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;")                    \
+  template(createRiType_signature,                    "(Ljava/lang/Class;)Lcom/sun/cri/ri/RiType;")                     \
   template(createRiTypePrimitive_name,                "createRiTypePrimitive")                                          \
   template(createRiTypePrimitive_signature,           "(I)Lcom/sun/cri/ri/RiType;")                                     \
   template(createRiTypeUnresolved_name,               "createRiTypeUnresolved")                                         \
-  template(createRiTypeUnresolved_signature,          "(Ljava/lang/Object;Ljava/lang/Object;)Lcom/sun/cri/ri/RiType;")  \
+  template(createRiTypeUnresolved_signature,          "(Ljava/lang/String;Ljava/lang/Class;)Lcom/sun/cri/ri/RiType;")   \
   template(createRiConstantPool_name,                 "createRiConstantPool")                                           \
-  template(createRiConstantPool_signature,            "(Ljava/lang/Object;)Lcom/sun/cri/ri/RiConstantPool;")            \
+  template(createRiConstantPool_signature,            "(Ljava/lang/Class;)Lcom/sun/cri/ri/RiConstantPool;")             \
   template(createCiConstantInt_name,                  "createCiConstantInt")                                            \
   template(createCiConstantInt_signature,             "(I)Lcom/sun/cri/ci/CiConstant;")                                 \
   template(createCiConstantLong_name,                 "createCiConstantLong")                                           \
--- a/src/share/vm/includeDB_compiler1	Fri Jul 23 15:53:02 2010 -0700
+++ b/src/share/vm/includeDB_compiler1	Mon Aug 02 15:44:38 2010 -0700
@@ -454,6 +454,7 @@
 
 c1x_VMEntries.hpp                       jni.h
 
+c1x_VMEntries.cpp                       c1x_Compiler.hpp
 c1x_VMEntries.cpp                       c1x_VMEntries.hpp
 c1x_VMEntries.cpp                       c1x_Compiler.hpp
 c1x_VMEntries.cpp                       c1x_VMExits.hpp
@@ -462,6 +463,7 @@
 
 c1x_VMExits.hpp                	        systemDictionary.hpp
 
+c1x_VMExits.cpp                         c1x_Compiler.hpp
 c1x_VMExits.cpp                         javaCalls.hpp
 c1x_VMExits.cpp                         c1x_VMExits.hpp