< prev index next >

src/hotspot/share/runtime/deoptimization.cpp

Print this page
@@ -120,10 +120,14 @@
  DeoptimizationScope::~DeoptimizationScope() {
    assert(_deopted, "Deopt not executed");
  }
  
  void DeoptimizationScope::mark(nmethod* nm, bool inc_recompile_counts) {
+   if (!nm->can_be_deoptimized()) {
+     return;
+   }
+ 
    ConditionalMutexLocker ml(NMethodState_lock, !NMethodState_lock->owned_by_self(), Mutex::_no_safepoint_check_flag);
  
    // If it's already marked but we still need it to be deopted.
    if (nm->is_marked_for_deoptimization()) {
      dependent(nm);

@@ -1664,11 +1668,11 @@
                                                                  deoptee_thread, thread);
            }
            assert(mon_info->owner()->is_locked(), "object must be locked now");
            assert(obj->mark().has_monitor(), "must be");
            assert(!deoptee_thread->lock_stack().contains(obj()), "must be");
-           assert(ObjectSynchronizer::read_monitor(thread, obj(), obj->mark())->owner() == deoptee_thread, "must be");
+           assert(ObjectSynchronizer::read_monitor(thread, obj(), obj->mark())->is_owner(deoptee_thread), "must be");
          } else {
            ObjectSynchronizer::enter_for(obj, lock, deoptee_thread);
            assert(mon_info->owner()->is_locked(), "object must be locked now");
          }
        }
< prev index next >