353 switch (major) { 354 case 1: 355 switch (minor) { 356 case 0: // version 1.0.<micro> is recognized 357 case 1: // version 1.1.<micro> is recognized 358 case 2: // version 1.2.<micro> is recognized 359 break; 360 361 default: 362 return JNI_EVERSION; // unsupported minor version number 363 } 364 break; 365 case 9: 366 switch (minor) { 367 case 0: // version 9.0.<micro> is recognized 368 break; 369 default: 370 return JNI_EVERSION; // unsupported minor version number 371 } 372 break; 373 default: 374 return JNI_EVERSION; // unsupported major version number 375 } 376 377 if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) { 378 JavaThread* current_thread = JavaThread::current(); 379 // transition code: native to VM 380 ThreadInVMfromNative __tiv(current_thread); 381 VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread) 382 debug_only(VMNativeEntryWrapper __vew;) 383 384 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version); 385 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv* 386 return JNI_OK; 387 388 } else if (JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) { 389 // not live, no thread to transition 390 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version); 391 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv* 392 return JNI_OK; | 353 switch (major) { 354 case 1: 355 switch (minor) { 356 case 0: // version 1.0.<micro> is recognized 357 case 1: // version 1.1.<micro> is recognized 358 case 2: // version 1.2.<micro> is recognized 359 break; 360 361 default: 362 return JNI_EVERSION; // unsupported minor version number 363 } 364 break; 365 case 9: 366 switch (minor) { 367 case 0: // version 9.0.<micro> is recognized 368 break; 369 default: 370 return JNI_EVERSION; // unsupported minor version number 371 } 372 break; 373 case 11: 374 switch (minor) { 375 case 0: // version 11.0.<micro> is recognized 376 break; 377 default: 378 return JNI_EVERSION; // unsupported minor version number 379 } 380 break; 381 default: 382 return JNI_EVERSION; // unsupported major version number 383 } 384 385 if (JvmtiEnv::get_phase() == JVMTI_PHASE_LIVE) { 386 JavaThread* current_thread = JavaThread::current(); 387 // transition code: native to VM 388 ThreadInVMfromNative __tiv(current_thread); 389 VM_ENTRY_BASE(jvmtiEnv*, JvmtiExport::get_jvmti_interface, current_thread) 390 debug_only(VMNativeEntryWrapper __vew;) 391 392 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version); 393 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv* 394 return JNI_OK; 395 396 } else if (JvmtiEnv::get_phase() == JVMTI_PHASE_ONLOAD) { 397 // not live, no thread to transition 398 JvmtiEnv *jvmti_env = JvmtiEnv::create_a_jvmti(version); 399 *penv = jvmti_env->jvmti_external(); // actual type is jvmtiEnv* -- not to be confused with JvmtiEnv* 400 return JNI_OK; |