# HG changeset patch # User twisti # Date 1386542018 28800 # Node ID f13f6dc290c82c07bf702c1df8591a65dc49ae67 # Parent 0ffe9e4bb3647cd8ba05f3952ddfb8f4935d1a50 don't pass HotSpotResolvedObjectType to VMToCompiler.compileMethod but instead create it in Java code diff -r 0ffe9e4bb364 -r f13f6dc290c8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java Sun Dec 08 13:27:52 2013 -0800 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java Sun Dec 08 14:33:38 2013 -0800 @@ -38,7 +38,7 @@ * Compiles a method to machine code. This method is called from the VM * (VMToCompiler::compileMethod). */ - void compileMethod(long metaspaceMethod, HotSpotResolvedObjectType holder, int entryBCI, boolean blocking); + void compileMethod(long metaspaceMethod, int entryBCI, boolean blocking); void shutdownCompiler() throws Exception; diff -r 0ffe9e4bb364 -r f13f6dc290c8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Sun Dec 08 13:27:52 2013 -0800 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java Sun Dec 08 14:33:38 2013 -0800 @@ -502,7 +502,12 @@ } @Override - public void compileMethod(long metaspaceMethod, final HotSpotResolvedObjectType holder, final int entryBCI, final boolean blocking) { + public void compileMethod(long metaspaceMethod, final int entryBCI, final boolean blocking) { + HotSpotVMConfig config = runtime().getConfig(); + final long metaspaceConstMethod = unsafe.getAddress(metaspaceMethod + config.methodConstMethodOffset); + final long metaspaceConstantPool = unsafe.getAddress(metaspaceConstMethod + config.constMethodConstantsOffset); + final long metaspaceKlass = unsafe.getAddress(metaspaceConstantPool + config.constantPoolHolderOffset); + final HotSpotResolvedObjectType holder = (HotSpotResolvedObjectType) HotSpotResolvedObjectType.fromMetaspaceKlass(metaspaceKlass); final HotSpotResolvedJavaMethod method = holder.createMethod(metaspaceMethod); // We have to use a privileged action here because compilations are enqueued from user code // which very likely contains unprivileged frames. diff -r 0ffe9e4bb364 -r f13f6dc290c8 src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp Sun Dec 08 13:27:52 2013 -0800 +++ b/src/share/vm/classfile/vmSymbols.hpp Sun Dec 08 14:33:38 2013 -0800 @@ -355,7 +355,7 @@ template(compileTheWorld_name, "compileTheWorld") \ template(shutdownCompiler_name, "shutdownCompiler") \ template(compileMethod_name, "compileMethod") \ - template(compileMethod_signature, "(JLcom/oracle/graal/hotspot/meta/HotSpotResolvedObjectType;IZ)V") \ + template(compileMethod_signature, "(JIZ)V") \ template(setOption_name, "setOption") \ template(setOption_signature, "(Ljava/lang/String;)Z") \ template(finalizeOptions_name, "finalizeOptions") \ diff -r 0ffe9e4bb364 -r f13f6dc290c8 src/share/vm/graal/graalCompiler.cpp --- a/src/share/vm/graal/graalCompiler.cpp Sun Dec 08 13:27:52 2013 -0800 +++ b/src/share/vm/graal/graalCompiler.cpp Sun Dec 08 14:33:38 2013 -0800 @@ -193,9 +193,7 @@ assert(_initialized, "must already be initialized"); ResourceMark rm; thread->set_is_graal_compiling(true); - Handle holder = GraalCompiler::createHotSpotResolvedObjectType(method, CHECK); - check_pending_exception("Error while calling createHotSpotResolvedObjectType"); - VMToCompiler::compileMethod(method(), holder, entry_bci, blocking); + VMToCompiler::compileMethod(method(), entry_bci, blocking); thread->set_is_graal_compiling(false); } diff -r 0ffe9e4bb364 -r f13f6dc290c8 src/share/vm/graal/graalVMToCompiler.cpp --- a/src/share/vm/graal/graalVMToCompiler.cpp Sun Dec 08 13:27:52 2013 -0800 +++ b/src/share/vm/graal/graalVMToCompiler.cpp Sun Dec 08 14:33:38 2013 -0800 @@ -111,15 +111,13 @@ check_pending_exception("Error while calling finalizeOptions"); } -void VMToCompiler::compileMethod(Method* method, Handle holder, int entry_bci, jboolean blocking) { +void VMToCompiler::compileMethod(Method* method, int entry_bci, jboolean blocking) { assert(method != NULL, "just checking"); - assert(!holder.is_null(), "just checking"); Thread* THREAD = Thread::current(); JavaValue result(T_VOID); JavaCallArguments args; args.push_oop(instance()); args.push_long((jlong) (address) method); - args.push_oop(holder()); args.push_int(entry_bci); args.push_int(blocking); JavaCalls::call_interface(&result, vmToCompilerKlass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, THREAD); diff -r 0ffe9e4bb364 -r f13f6dc290c8 src/share/vm/graal/graalVMToCompiler.hpp --- a/src/share/vm/graal/graalVMToCompiler.hpp Sun Dec 08 13:27:52 2013 -0800 +++ b/src/share/vm/graal/graalVMToCompiler.hpp Sun Dec 08 14:33:38 2013 -0800 @@ -60,8 +60,8 @@ // public static void HotSpotOptions.finalizeOptions(boolean ciTime); static void finalizeOptions(jboolean ciTime); - // public abstract boolean compileMethod(long vmId, String name, int entry_bci, boolean blocking); - static void compileMethod(Method* method, Handle holder, int entry_bci, jboolean blocking); + // public abstract boolean compileMethod(long vmId, int entry_bci, boolean blocking); + static void compileMethod(Method* method, int entry_bci, jboolean blocking); // public abstract void shutdownCompiler(); static void shutdownCompiler();