@@ -142,8 +142,8 @@ static JavaThread* get_current_thread(bool allow_null=true) {
142142 err_msg (" Cannot call into HotSpot from JVMCI shared library without attaching current thread" )); \
143143 return ; \
144144 } \
145- JVMCITraceMark jtm ( " CompilerToVM:: " # name); \
146- C2V_BLOCK (result_type, name, signature)
145+ C2V_BLOCK (result_type, name, signature) \
146+ JVMCITraceMark jtm ( " CompilerToVM:: " # name);
147147
148148#define C2V_VMENTRY_ (result_type, name, signature, result ) \
149149 JNIEXPORT result_type JNICALL c2v_ ## name signature { \
@@ -153,8 +153,8 @@ static JavaThread* get_current_thread(bool allow_null=true) {
153153 err_msg (" Cannot call into HotSpot from JVMCI shared library without attaching current thread" )); \
154154 return result; \
155155 } \
156- JVMCITraceMark jtm ( " CompilerToVM:: " # name); \
157- C2V_BLOCK (result_type, name, signature)
156+ C2V_BLOCK (result_type, name, signature) \
157+ JVMCITraceMark jtm ( " CompilerToVM:: " # name);
158158
159159#define C2V_VMENTRY_NULL (result_type, name, signature ) C2V_VMENTRY_(result_type, name, signature, NULL )
160160#define C2V_VMENTRY_0 (result_type, name, signature ) C2V_VMENTRY_(result_type, name, signature, 0 )
@@ -503,7 +503,7 @@ C2V_VMENTRY_NULL(jobject, lookupType, (JNIEnv* env, jobject, jstring jname, ARGU
503503 } else {
504504 // Use the System class loader
505505 class_loader = Handle (THREAD, SystemDictionary::java_system_loader ());
506- JVMCIENV->runtime ()->initialize (JVMCIENV );
506+ JVMCIENV->runtime ()->initialize (JVMCI_CHECK_NULL );
507507 }
508508
509509 if (resolve) {
@@ -2312,9 +2312,9 @@ C2V_VMENTRY_PREFIX(jboolean, isCurrentThreadAttached, (JNIEnv* env, jobject c2vm
23122312 // Called from unattached JVMCI shared library thread
23132313 return false ;
23142314 }
2315- JVMCITraceMark jtm (" isCurrentThreadAttached" );
23162315 if (thread->jni_environment () == env) {
23172316 C2V_BLOCK (jboolean, isCurrentThreadAttached, (JNIEnv* env, jobject))
2317+ JVMCITraceMark jtm (" isCurrentThreadAttached" );
23182318 requireJVMCINativeLibrary (JVMCI_CHECK_0);
23192319 JVMCIRuntime* runtime = thread->libjvmci_runtime ();
23202320 if (runtime == nullptr || !runtime->has_shared_library_javavm ()) {
@@ -2331,7 +2331,6 @@ C2V_VMENTRY_PREFIX(jlong, getCurrentJavaThread, (JNIEnv* env, jobject c2vm))
23312331 // Called from unattached JVMCI shared library thread
23322332 return 0L ;
23332333 }
2334- JVMCITraceMark jtm (" getCurrentJavaThread" );
23352334 return (jlong) p2i(thread);
23362335C2V_END
23372336
@@ -2377,10 +2376,10 @@ C2V_VMENTRY_PREFIX(jboolean, attachCurrentThread, (JNIEnv* env, jobject c2vm, jb
23772376 attachSharedLibraryThread (env, name, as_daemon);
23782377 return true ;
23792378 }
2380- JVMCITraceMark jtm (" attachCurrentThread" );
23812379 if (thread->jni_environment () == env) {
23822380 // Called from HotSpot
23832381 C2V_BLOCK (jboolean, attachCurrentThread, (JNIEnv* env, jobject, jboolean))
2382+ JVMCITraceMark jtm (" attachCurrentThread" );
23842383 requireJVMCINativeLibrary (JVMCI_CHECK_0);
23852384
23862385 JVMCIRuntime* runtime = JVMCI::compiler_runtime (thread);
@@ -2435,10 +2434,10 @@ C2V_VMENTRY_PREFIX(jboolean, detachCurrentThread, (JNIEnv* env, jobject c2vm, jb
24352434 // Called from unattached JVMCI shared library thread
24362435 JNI_THROW_ (" detachCurrentThread" , IllegalStateException, " Cannot detach non-attached thread" , false );
24372436 }
2438- JVMCITraceMark jtm (" detachCurrentThread" );
24392437 if (thread->jni_environment () == env) {
24402438 // Called from HotSpot
24412439 C2V_BLOCK (void , detachCurrentThread, (JNIEnv* env, jobject))
2440+ JVMCITraceMark jtm (" detachCurrentThread" );
24422441 requireJVMCINativeLibrary (JVMCI_CHECK_0);
24432442 requireInHotSpot (" detachCurrentThread" , JVMCI_CHECK_0);
24442443 JVMCIRuntime* runtime = thread->libjvmci_runtime ();
0 commit comments