365 break;
366 case 11:
367 switch (minor) {
368 case 0: // version 11.0.<micro> is recognized
369 break;
370 default:
371 return JNI_EVERSION; // unsupported minor version number
372 }
373 break;
374 default:
375 // Starting from 13 we do not care about minor version anymore
376 if (major < 13 || major > VM_Version::vm_major_version()) {
377 return JNI_EVERSION; // unsupported major version number
378 }
379 }
380 if (Continuations::enabled()) {
381 // Virtual threads support. There is a performance impact when VTMS transitions are enabled.
382 java_lang_VirtualThread::set_notify_jvmti_events(true);
383 if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) {
384 ThreadInVMfromNative __tiv(JavaThread::current());
385 java_lang_VirtualThread::init_static_notify_jvmti_events();
386 }
387 }
388
389 if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) {
390 JavaThread* current_thread = JavaThread::current();
391 // transition code: native to VM
392 ThreadInVMfromNative __tiv(current_thread);
393 VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
394 debug_only(VMNativeEntryWrapper __vew;)
395
396 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
397 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*
398 return JNI_OK;
399
400 } else if (JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) {
401 // not live, no thread to transition
402 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
403 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*
404 return JNI_OK;
|
365 break;
366 case 11:
367 switch (minor) {
368 case 0: // version 11.0.<micro> is recognized
369 break;
370 default:
371 return JNI_EVERSION; // unsupported minor version number
372 }
373 break;
374 default:
375 // Starting from 13 we do not care about minor version anymore
376 if (major < 13 || major > VM_Version::vm_major_version()) {
377 return JNI_EVERSION; // unsupported major version number
378 }
379 }
380 if (Continuations::enabled()) {
381 // Virtual threads support. There is a performance impact when VTMS transitions are enabled.
382 java_lang_VirtualThread::set_notify_jvmti_events(true);
383 if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) {
384 ThreadInVMfromNative __tiv(JavaThread::current());
385 JvmtiVTMSTransitionDisabler disabler;
386 java_lang_VirtualThread::init_static_notify_jvmti_events();
387 }
388 }
389
390 if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) {
391 JavaThread* current_thread = JavaThread::current();
392 // transition code: native to VM
393 ThreadInVMfromNative __tiv(current_thread);
394 VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread)
395 debug_only(VMNativeEntryWrapper __vew;)
396
397 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
398 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*
399 return JNI_OK;
400
401 } else if (JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) {
402 // not live, no thread to transition
403 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version);
404 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv*
405 return JNI_OK;
|