< prev index next >

src/hotspot/cpu/aarch64/templateTable_aarch64.cpp

Print this page
@@ -3860,10 +3860,13 @@
  
    // store object
    __ str(r0, Address(c_rarg1, BasicObjectLock::obj_offset_in_bytes()));
    __ lock_object(c_rarg1);
  
+   // The object is stored so counter should be increased even if stackoverflow is generated
+   __ inc_held_monitor_count(rthread);
+ 
    // check to make sure this monitor doesn't cause stack overflow after locking
    __ save_bcp();  // in case of exception
    __ generate_stack_overflow_check(0);
  
    // The bcp has already been incremented. Just need to dispatch to

@@ -3918,10 +3921,11 @@
  
    // call run-time routine
    __ bind(found);
    __ push_ptr(r0); // make sure object is on stack (contract with oopMaps)
    __ unlock_object(c_rarg1);
+   __ dec_held_monitor_count(rthread);
    __ pop_ptr(r0); // discard object
  }
  
  
  // Wide instructions
< prev index next >