hotspot/src/share/vm/runtime/deoptimization.cpp
changeset 46998 efb404beeefb
parent 46968 9119841280f4
equal deleted inserted replaced
46995:9e3267ffe6ec 46998:efb404beeefb
  1371   }
  1371   }
  1372   deoptimize_single_frame(thread, fr, reason);
  1372   deoptimize_single_frame(thread, fr, reason);
  1373 
  1373 
  1374 }
  1374 }
  1375 
  1375 
       
  1376 #if INCLUDE_JVMCI
       
  1377 address Deoptimization::deoptimize_for_missing_exception_handler(CompiledMethod* cm) {
       
  1378   // there is no exception handler for this pc => deoptimize
       
  1379   cm->make_not_entrant();
       
  1380 
       
  1381   // Use Deoptimization::deoptimize for all of its side-effects:
       
  1382   // revoking biases of monitors, gathering traps statistics, logging...
       
  1383   // it also patches the return pc but we do not care about that
       
  1384   // since we return a continuation to the deopt_blob below.
       
  1385   JavaThread* thread = JavaThread::current();
       
  1386   RegisterMap reg_map(thread, UseBiasedLocking);
       
  1387   frame runtime_frame = thread->last_frame();
       
  1388   frame caller_frame = runtime_frame.sender(&reg_map);
       
  1389   assert(caller_frame.cb()->as_nmethod_or_null() == cm, "expect top frame nmethod");
       
  1390   Deoptimization::deoptimize(thread, caller_frame, &reg_map, Deoptimization::Reason_not_compiled_exception_handler);
       
  1391 
       
  1392   MethodData* trap_mdo = get_method_data(thread, cm->method(), true);
       
  1393   if (trap_mdo != NULL) {
       
  1394     trap_mdo->inc_trap_count(Deoptimization::Reason_not_compiled_exception_handler);
       
  1395   }
       
  1396 
       
  1397   return SharedRuntime::deopt_blob()->unpack_with_exception_in_tls();
       
  1398 }
       
  1399 #endif
  1376 
  1400 
  1377 void Deoptimization::deoptimize_frame_internal(JavaThread* thread, intptr_t* id, DeoptReason reason) {
  1401 void Deoptimization::deoptimize_frame_internal(JavaThread* thread, intptr_t* id, DeoptReason reason) {
  1378   assert(thread == Thread::current() || SafepointSynchronize::is_at_safepoint(),
  1402   assert(thread == Thread::current() || SafepointSynchronize::is_at_safepoint(),
  1379          "can only deoptimize other thread at a safepoint");
  1403          "can only deoptimize other thread at a safepoint");
  1380   // Compute frame and register map based on thread and sp.
  1404   // Compute frame and register map based on thread and sp.