< prev index next >

src/hotspot/cpu/s390/macroAssembler_s390.cpp

Print this page

3246     z_ngr(currentHeader, temp);
3247     //   z_brne(done);
3248     //   z_release();
3249     z_stg(currentHeader/*==0 or not 0*/, BasicLock::displaced_header_offset_in_bytes(), box);
3250 
3251     z_bru(done);
3252   } else {
3253     assert(LockingMode == LM_LIGHTWEIGHT, "must be");
3254     lightweight_lock(oop, displacedHeader, temp, done);
3255     z_bru(done);
3256   }
3257 
3258   Register zero = temp;
3259   Register monitor_tagged = displacedHeader; // Tagged with markWord::monitor_value.
3260   bind(object_has_monitor);
3261   // The object's monitor m is unlocked iff m->owner is null,
3262   // otherwise m->owner may contain a thread or a stack address.
3263   //
3264   // Try to CAS m->owner from null to current thread.
3265   z_lghi(zero, 0);
3266   // If m->owner is null, then csg succeeds and sets m->owner=THREAD and CR=EQ.
3267   z_csg(zero, Z_thread, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), monitor_tagged);

3268   if (LockingMode != LM_LIGHTWEIGHT) {
3269     // Store a non-null value into the box.
3270     z_stg(box, BasicLock::displaced_header_offset_in_bytes(), box);
3271   }
3272 #ifdef ASSERT
3273   z_brne(done);
3274   // We've acquired the monitor, check some invariants.
3275   // Invariant 1: _recursions should be 0.
3276   asm_assert_mem8_is_zero(OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions), monitor_tagged,
3277                           "monitor->_recursions should be 0", -1);
3278   z_ltgr(zero, zero); // Set CR=EQ.
3279 #endif
3280   bind(done);
3281 
3282   BLOCK_COMMENT("} compiler_fast_lock_object");
3283   // If locking was successful, CR should indicate 'EQ'.
3284   // The compiler or the native wrapper generates a branch to the runtime call
3285   // _complete_monitor_locking_Java.
3286 }
3287 

3246     z_ngr(currentHeader, temp);
3247     //   z_brne(done);
3248     //   z_release();
3249     z_stg(currentHeader/*==0 or not 0*/, BasicLock::displaced_header_offset_in_bytes(), box);
3250 
3251     z_bru(done);
3252   } else {
3253     assert(LockingMode == LM_LIGHTWEIGHT, "must be");
3254     lightweight_lock(oop, displacedHeader, temp, done);
3255     z_bru(done);
3256   }
3257 
3258   Register zero = temp;
3259   Register monitor_tagged = displacedHeader; // Tagged with markWord::monitor_value.
3260   bind(object_has_monitor);
3261   // The object's monitor m is unlocked iff m->owner is null,
3262   // otherwise m->owner may contain a thread or a stack address.
3263   //
3264   // Try to CAS m->owner from null to current thread.
3265   z_lghi(zero, 0);
3266   // If m->owner is null, then csg succeeds and sets m->owner=THREAD_ID and CR=EQ.
3267   z_l(Z_R1_scratch, Address(Z_thread, JavaThread::lock_id_offset()));
3268   z_csg(zero, Z_R1_scratch, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner), monitor_tagged);
3269   if (LockingMode != LM_LIGHTWEIGHT) {
3270     // Store a non-null value into the box.
3271     z_stg(box, BasicLock::displaced_header_offset_in_bytes(), box);
3272   }
3273 #ifdef ASSERT
3274   z_brne(done);
3275   // We've acquired the monitor, check some invariants.
3276   // Invariant 1: _recursions should be 0.
3277   asm_assert_mem8_is_zero(OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions), monitor_tagged,
3278                           "monitor->_recursions should be 0", -1);
3279   z_ltgr(zero, zero); // Set CR=EQ.
3280 #endif
3281   bind(done);
3282 
3283   BLOCK_COMMENT("} compiler_fast_lock_object");
3284   // If locking was successful, CR should indicate 'EQ'.
3285   // The compiler or the native wrapper generates a branch to the runtime call
3286   // _complete_monitor_locking_Java.
3287 }
3288 
< prev index next >