src/hotspot/share/jvmci/jvmciRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File open Sdiff src/hotspot/share/jvmci

src/hotspot/share/jvmci/jvmciRuntime.cpp

Print this page




 579   Handle receiverHandle(thread, receiver);
 580   // A nested ThreadsListHandle may require the Threads_lock which
 581   // requires thread_in_vm which is why this method cannot be JRT_LEAF.
 582   ThreadsListHandle tlh;
 583 
 584   JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle());
 585   if (receiverThread == NULL || (EnableThreadSMRExtraValidityChecks && !tlh.includes(receiverThread))) {
 586     // The other thread may exit during this process, which is ok so return false.
 587     return JNI_FALSE;
 588   } else {
 589     return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0);
 590   }
 591 JRT_END
 592 
 593 JRT_ENTRY(int, JVMCIRuntime::test_deoptimize_call_int(JavaThread* thread, int value))
 594   deopt_caller();
 595   return value;
 596 JRT_END
 597 
 598 void JVMCIRuntime::force_initialization(TRAPS) {

 599   JVMCIRuntime::initialize_well_known_classes(CHECK);
 600 
 601   ResourceMark rm;
 602   TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK);
 603   TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK);
 604   Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK);
 605   JavaValue result(T_OBJECT);
 606   JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK);

 607 }
 608 
 609 // private static JVMCIRuntime JVMCI.initializeRuntime()
 610 JVM_ENTRY(jobject, JVM_GetJVMCIRuntime(JNIEnv *env, jclass c))
 611   if (!EnableJVMCI) {
 612     THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled")
 613   }
 614   JVMCIRuntime::initialize_HotSpotJVMCIRuntime(CHECK_NULL);
 615   jobject ret = JVMCIRuntime::get_HotSpotJVMCIRuntime_jobject(CHECK_NULL);
 616   return ret;
 617 JVM_END
 618 
 619 Handle JVMCIRuntime::callStatic(const char* className, const char* methodName, const char* signature, JavaCallArguments* args, TRAPS) {
 620   TempNewSymbol name = SymbolTable::new_symbol(className, CHECK_(Handle()));
 621   Klass* klass = SystemDictionary::resolve_or_fail(name, true, CHECK_(Handle()));
 622   TempNewSymbol runtime = SymbolTable::new_symbol(methodName, CHECK_(Handle()));
 623   TempNewSymbol sig = SymbolTable::new_symbol(signature, CHECK_(Handle()));
 624   JavaValue result(T_OBJECT);
 625   if (args == NULL) {
 626     JavaCalls::call_static(&result, klass, runtime, sig, CHECK_(Handle()));




 579   Handle receiverHandle(thread, receiver);
 580   // A nested ThreadsListHandle may require the Threads_lock which
 581   // requires thread_in_vm which is why this method cannot be JRT_LEAF.
 582   ThreadsListHandle tlh;
 583 
 584   JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle());
 585   if (receiverThread == NULL || (EnableThreadSMRExtraValidityChecks && !tlh.includes(receiverThread))) {
 586     // The other thread may exit during this process, which is ok so return false.
 587     return JNI_FALSE;
 588   } else {
 589     return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0);
 590   }
 591 JRT_END
 592 
 593 JRT_ENTRY(int, JVMCIRuntime::test_deoptimize_call_int(JavaThread* thread, int value))
 594   deopt_caller();
 595   return value;
 596 JRT_END
 597 
 598 void JVMCIRuntime::force_initialization(TRAPS) {
 599   Arguments::set_force_init_jvmci_runtime(true);
 600   JVMCIRuntime::initialize_well_known_classes(CHECK);
 601 
 602   ResourceMark rm;
 603   TempNewSymbol getCompiler = SymbolTable::new_symbol("getCompiler", CHECK);
 604   TempNewSymbol sig = SymbolTable::new_symbol("()Ljdk/vm/ci/runtime/JVMCICompiler;", CHECK);
 605   Handle jvmciRuntime = JVMCIRuntime::get_HotSpotJVMCIRuntime(CHECK);
 606   JavaValue result(T_OBJECT);
 607   JavaCalls::call_virtual(&result, jvmciRuntime, HotSpotJVMCIRuntime::klass(), getCompiler, sig, CHECK);
 608   Arguments::set_force_init_jvmci_runtime(false);
 609 }
 610 
 611 // private static JVMCIRuntime JVMCI.initializeRuntime()
 612 JVM_ENTRY(jobject, JVM_GetJVMCIRuntime(JNIEnv *env, jclass c))
 613   if (!EnableJVMCI) {
 614     THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), "JVMCI is not enabled")
 615   }
 616   JVMCIRuntime::initialize_HotSpotJVMCIRuntime(CHECK_NULL);
 617   jobject ret = JVMCIRuntime::get_HotSpotJVMCIRuntime_jobject(CHECK_NULL);
 618   return ret;
 619 JVM_END
 620 
 621 Handle JVMCIRuntime::callStatic(const char* className, const char* methodName, const char* signature, JavaCallArguments* args, TRAPS) {
 622   TempNewSymbol name = SymbolTable::new_symbol(className, CHECK_(Handle()));
 623   Klass* klass = SystemDictionary::resolve_or_fail(name, true, CHECK_(Handle()));
 624   TempNewSymbol runtime = SymbolTable::new_symbol(methodName, CHECK_(Handle()));
 625   TempNewSymbol sig = SymbolTable::new_symbol(signature, CHECK_(Handle()));
 626   JavaValue result(T_OBJECT);
 627   if (args == NULL) {
 628     JavaCalls::call_static(&result, klass, runtime, sig, CHECK_(Handle()));


src/hotspot/share/jvmci/jvmciRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File