< prev index next >

src/share/vm/prims/jvmtiEnvBase.cpp

Print this page




1349     }
1350     Deoptimization::deoptimize_frame(java_thread, jvf->fr().id());
1351   }
1352 
1353   // Get information about method return type
1354   Symbol* signature = jvf->method()->signature();
1355 
1356   ResultTypeFinder rtf(signature);
1357   TosState fr_tos = as_TosState(rtf.type());
1358   if (fr_tos != tos) {
1359     if (tos != itos || (fr_tos != btos && fr_tos != ztos && fr_tos != ctos && fr_tos != stos)) {
1360       return JVMTI_ERROR_TYPE_MISMATCH;
1361     }
1362   }
1363 
1364   // Check that the jobject class matches the return type signature.
1365   jobject jobj = value.l;
1366   if (tos == atos && jobj != NULL) { // NULL reference is allowed
1367     Handle ob_h(current_thread, JNIHandles::resolve_external_guard(jobj));
1368     NULL_CHECK(ob_h, JVMTI_ERROR_INVALID_OBJECT);
1369     KlassHandle ob_kh = KlassHandle(current_thread, ob_h()->klass());
1370     NULL_CHECK(ob_kh, JVMTI_ERROR_INVALID_OBJECT);
1371 
1372     // Method return type signature.
1373     char* ty_sign = 1 + strchr(signature->as_C_string(), ')');
1374 
1375     if (!VM_GetOrSetLocal::is_assignable(ty_sign, ob_kh(), current_thread)) {
1376       return JVMTI_ERROR_TYPE_MISMATCH;
1377     }
1378     *ret_ob_h = ob_h;
1379   }
1380   return JVMTI_ERROR_NONE;
1381 } /* end check_top_frame */
1382 
1383 
1384 // ForceEarlyReturn<type> follows the PopFrame approach in many aspects.
1385 // Main difference is on the last stage in the interpreter.
1386 // The PopFrame stops method execution to continue execution
1387 // from the same method call instruction.
1388 // The ForceEarlyReturn forces return from method so the execution
1389 // continues at the bytecode following the method call.
1390 
1391 // Threads_lock NOT held, java_thread not protected by lock
1392 // java_thread - pre-checked
1393 
1394 jvmtiError
1395 JvmtiEnvBase::force_early_return(JavaThread* java_thread, jvalue value, TosState tos) {




1349     }
1350     Deoptimization::deoptimize_frame(java_thread, jvf->fr().id());
1351   }
1352 
1353   // Get information about method return type
1354   Symbol* signature = jvf->method()->signature();
1355 
1356   ResultTypeFinder rtf(signature);
1357   TosState fr_tos = as_TosState(rtf.type());
1358   if (fr_tos != tos) {
1359     if (tos != itos || (fr_tos != btos && fr_tos != ztos && fr_tos != ctos && fr_tos != stos)) {
1360       return JVMTI_ERROR_TYPE_MISMATCH;
1361     }
1362   }
1363 
1364   // Check that the jobject class matches the return type signature.
1365   jobject jobj = value.l;
1366   if (tos == atos && jobj != NULL) { // NULL reference is allowed
1367     Handle ob_h(current_thread, JNIHandles::resolve_external_guard(jobj));
1368     NULL_CHECK(ob_h, JVMTI_ERROR_INVALID_OBJECT);
1369     Klass* ob_k = ob_h()->klass();
1370     NULL_CHECK(ob_k, JVMTI_ERROR_INVALID_OBJECT);
1371 
1372     // Method return type signature.
1373     char* ty_sign = 1 + strchr(signature->as_C_string(), ')');
1374 
1375     if (!VM_GetOrSetLocal::is_assignable(ty_sign, ob_k, current_thread)) {
1376       return JVMTI_ERROR_TYPE_MISMATCH;
1377     }
1378     *ret_ob_h = ob_h;
1379   }
1380   return JVMTI_ERROR_NONE;
1381 } /* end check_top_frame */
1382 
1383 
1384 // ForceEarlyReturn<type> follows the PopFrame approach in many aspects.
1385 // Main difference is on the last stage in the interpreter.
1386 // The PopFrame stops method execution to continue execution
1387 // from the same method call instruction.
1388 // The ForceEarlyReturn forces return from method so the execution
1389 // continues at the bytecode following the method call.
1390 
1391 // Threads_lock NOT held, java_thread not protected by lock
1392 // java_thread - pre-checked
1393 
1394 jvmtiError
1395 JvmtiEnvBase::force_early_return(JavaThread* java_thread, jvalue value, TosState tos) {


< prev index next >