Mercurial > hg > graal-jvmci-8
comparison src/share/vm/jvmci/jvmciCompiler.cpp @ 22454:76af33d4d504
Make jvmci redefinition safe
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Fri, 21 Aug 2015 11:57:29 -0700 |
parents | 7202e96981c6 |
children | d9f5c93a83d3 |
comparison
equal
deleted
inserted
replaced
22453:d6bbd5d8d81e | 22454:76af33d4d504 |
---|---|
22 */ | 22 */ |
23 | 23 |
24 #include "precompiled.hpp" | 24 #include "precompiled.hpp" |
25 #include "memory/oopFactory.hpp" | 25 #include "memory/oopFactory.hpp" |
26 #include "runtime/javaCalls.hpp" | 26 #include "runtime/javaCalls.hpp" |
27 #include "jvmci/jvmciJavaAccess.hpp" | |
27 #include "jvmci/jvmciCompiler.hpp" | 28 #include "jvmci/jvmciCompiler.hpp" |
28 #include "jvmci/jvmciEnv.hpp" | 29 #include "jvmci/jvmciEnv.hpp" |
29 #include "jvmci/jvmciRuntime.hpp" | 30 #include "jvmci/jvmciRuntime.hpp" |
30 #include "runtime/compilationPolicy.hpp" | 31 #include "runtime/compilationPolicy.hpp" |
31 #include "runtime/globals_extension.hpp" | 32 #include "runtime/globals_extension.hpp" |
121 // and we know that there are no endless loops | 122 // and we know that there are no endless loops |
122 return; | 123 return; |
123 } | 124 } |
124 | 125 |
125 JVMCIRuntime::ensure_jvmci_class_loader_is_initialized(); | 126 JVMCIRuntime::ensure_jvmci_class_loader_is_initialized(); |
127 jvmci_compute_offsets(); | |
126 HandleMark hm; | 128 HandleMark hm; |
127 ResourceMark rm; | 129 ResourceMark rm; |
130 Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(); | |
131 | |
132 JavaValue method_result(T_OBJECT); | |
133 { | |
134 JavaCallArguments args; | |
135 args.push_long((jlong) (address) method()); | |
136 JavaCalls::call_static(&method_result, SystemDictionary::HotSpotResolvedJavaMethodImpl_klass(), vmSymbols::fromMetaspace_name(), vmSymbols::method_fromMetaspace_signature(), &args, CHECK_ABORT); | |
137 } | |
138 | |
128 JavaValue result(T_VOID); | 139 JavaValue result(T_VOID); |
129 JavaCallArguments args; | 140 JavaCallArguments args; |
130 Handle receiver = JVMCIRuntime::get_HotSpotJVMCIRuntime(); | |
131 args.push_oop(receiver); | 141 args.push_oop(receiver); |
132 args.push_long((jlong) (address) method()); | 142 args.push_oop((oop)method_result.get_jobject()); |
133 args.push_int(entry_bci); | 143 args.push_int(entry_bci); |
134 args.push_long((jlong) (address) env); | 144 args.push_long((jlong) (address) env); |
135 args.push_int(env->task()->compile_id()); | 145 args.push_int(env->task()->compile_id()); |
136 JavaCalls::call_special(&result, receiver->klass(), vmSymbols::compileMetaspaceMethod_name(), vmSymbols::compileMetaspaceMethod_signature(), &args, CHECK_ABORT); | 146 JavaCalls::call_special(&result, receiver->klass(), vmSymbols::compileMethod_name(), vmSymbols::compileMethod_signature(), &args, CHECK_ABORT); |
137 | 147 |
138 _methodsCompiled++; | 148 _methodsCompiled++; |
139 } | 149 } |
140 | 150 |
141 | 151 |