src/hotspot/share/runtime/deoptimization.cpp
changeset 47687 fb290fd1f9d4
parent 47216 71c04702a3d5
child 47692 0d2d80c0d425
equal deleted inserted replaced
47686:24ebaf9d7198 47687:fb290fd1f9d4
   337       delete list;
   337       delete list;
   338     }
   338     }
   339 
   339 
   340   }
   340   }
   341 
   341 
   342 #ifndef SHARK
       
   343   // Compute the caller frame based on the sender sp of stub_frame and stored frame sizes info.
   342   // Compute the caller frame based on the sender sp of stub_frame and stored frame sizes info.
   344   CodeBlob* cb = stub_frame.cb();
   343   CodeBlob* cb = stub_frame.cb();
   345   // Verify we have the right vframeArray
   344   // Verify we have the right vframeArray
   346   assert(cb->frame_size() >= 0, "Unexpected frame size");
   345   assert(cb->frame_size() >= 0, "Unexpected frame size");
   347   intptr_t* unpack_sp = stub_frame.sp() + cb->frame_size();
   346   intptr_t* unpack_sp = stub_frame.sp() + cb->frame_size();
   357          cb->is_uncommon_trap_stub() ||
   356          cb->is_uncommon_trap_stub() ||
   358          strcmp("Stub<DeoptimizationStub.deoptimizationHandler>", cb->name()) == 0 ||
   357          strcmp("Stub<DeoptimizationStub.deoptimizationHandler>", cb->name()) == 0 ||
   359          strcmp("Stub<UncommonTrapStub.uncommonTrapHandler>", cb->name()) == 0,
   358          strcmp("Stub<UncommonTrapStub.uncommonTrapHandler>", cb->name()) == 0,
   360          "unexpected code blob: %s", cb->name());
   359          "unexpected code blob: %s", cb->name());
   361 #endif
   360 #endif
   362 #else
       
   363   intptr_t* unpack_sp = stub_frame.sender(&dummy_map).unextended_sp();
       
   364 #endif // !SHARK
       
   365 
   361 
   366   // This is a guarantee instead of an assert because if vframe doesn't match
   362   // This is a guarantee instead of an assert because if vframe doesn't match
   367   // we will unpack the wrong deoptimized frame and wind up in strange places
   363   // we will unpack the wrong deoptimized frame and wind up in strange places
   368   // where it will be very difficult to figure out what went wrong. Better
   364   // where it will be very difficult to figure out what went wrong. Better
   369   // to die an early death here than some very obscure death later when the
   365   // to die an early death here than some very obscure death later when the
   486   // since the frame will "magically" show the original pc before the deopt
   482   // since the frame will "magically" show the original pc before the deopt
   487   // and we'd undo the deopt.
   483   // and we'd undo the deopt.
   488 
   484 
   489   frame_pcs[0] = deopt_sender.raw_pc();
   485   frame_pcs[0] = deopt_sender.raw_pc();
   490 
   486 
   491 #ifndef SHARK
       
   492   assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc");
   487   assert(CodeCache::find_blob_unsafe(frame_pcs[0]) != NULL, "bad pc");
   493 #endif // SHARK
       
   494 
   488 
   495 #ifdef INCLUDE_JVMCI
   489 #ifdef INCLUDE_JVMCI
   496   if (exceptionObject() != NULL) {
   490   if (exceptionObject() != NULL) {
   497     thread->set_exception_oop(exceptionObject());
   491     thread->set_exception_oop(exceptionObject());
   498     exec_mode = Unpack_exception;
   492     exec_mode = Unpack_exception;
  1447     mdo = m()->method_data();
  1441     mdo = m()->method_data();
  1448   }
  1442   }
  1449   return mdo;
  1443   return mdo;
  1450 }
  1444 }
  1451 
  1445 
  1452 #if defined(COMPILER2) || defined(SHARK) || INCLUDE_JVMCI
  1446 #if defined(COMPILER2) || INCLUDE_JVMCI
  1453 void Deoptimization::load_class_by_index(const constantPoolHandle& constant_pool, int index, TRAPS) {
  1447 void Deoptimization::load_class_by_index(const constantPoolHandle& constant_pool, int index, TRAPS) {
  1454   // in case of an unresolved klass entry, load the class.
  1448   // in case of an unresolved klass entry, load the class.
  1455   if (constant_pool->tag_at(index).is_unresolved_klass()) {
  1449   if (constant_pool->tag_at(index).is_unresolved_klass()) {
  1456     Klass* tk = constant_pool->klass_at_ignore_error(index, CHECK);
  1450     Klass* tk = constant_pool->klass_at_ignore_error(index, CHECK);
  1457     return;
  1451     return;
  2364     }
  2358     }
  2365     #undef PRINT_STAT_LINE
  2359     #undef PRINT_STAT_LINE
  2366     if (xtty != NULL)  xtty->tail("statistics");
  2360     if (xtty != NULL)  xtty->tail("statistics");
  2367   }
  2361   }
  2368 }
  2362 }
  2369 #else // COMPILER2 || SHARK || INCLUDE_JVMCI
  2363 #else // COMPILER2 || INCLUDE_JVMCI
  2370 
  2364 
  2371 
  2365 
  2372 // Stubs for C1 only system.
  2366 // Stubs for C1 only system.
  2373 bool Deoptimization::trap_state_is_recompiled(int trap_state) {
  2367 bool Deoptimization::trap_state_is_recompiled(int trap_state) {
  2374   return false;
  2368   return false;
  2400                                               int trap_state) {
  2394                                               int trap_state) {
  2401   jio_snprintf(buf, buflen, "#%d", trap_state);
  2395   jio_snprintf(buf, buflen, "#%d", trap_state);
  2402   return buf;
  2396   return buf;
  2403 }
  2397 }
  2404 
  2398 
  2405 #endif // COMPILER2 || SHARK || INCLUDE_JVMCI
  2399 #endif // COMPILER2 || INCLUDE_JVMCI