< prev index next >

src/hotspot/cpu/x86/c2_MacroAssembler_x86.cpp

Print this page

 480     load_klass(tmpReg, objReg, cx1Reg);
 481     movl(tmpReg, Address(tmpReg, Klass::access_flags_offset()));
 482     testl(tmpReg, JVM_ACC_IS_VALUE_BASED_CLASS);
 483     jcc(Assembler::notZero, DONE_LABEL);
 484   }
 485 
 486 #if INCLUDE_RTM_OPT
 487   if (UseRTMForStackLocks && use_rtm) {
 488     rtm_stack_locking(objReg, tmpReg, scrReg, cx2Reg,
 489                       stack_rtm_counters, method_data, profile_rtm,
 490                       DONE_LABEL, IsInflated);
 491   }
 492 #endif // INCLUDE_RTM_OPT
 493 
 494   movptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes()));          // [FETCH]
 495   testptr(tmpReg, markWord::monitor_value); // inflated vs stack-locked|neutral
 496   jccb(Assembler::notZero, IsInflated);
 497 
 498   // Attempt stack-locking ...
 499   orptr (tmpReg, markWord::unlocked_value);




 500   movptr(Address(boxReg, 0), tmpReg);          // Anticipate successful CAS
 501   lock();
 502   cmpxchgptr(boxReg, Address(objReg, oopDesc::mark_offset_in_bytes()));      // Updates tmpReg
 503   jcc(Assembler::equal, DONE_LABEL);           // Success
 504 
 505   // Recursive locking.
 506   // The object is stack-locked: markword contains stack pointer to BasicLock.
 507   // Locked by current thread if difference with current SP is less than one page.
 508   subptr(tmpReg, rsp);
 509   // Next instruction set ZFlag == 1 (Success) if difference is less then one page.
 510   andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - os::vm_page_size())) );
 511   movptr(Address(boxReg, 0), tmpReg);
 512   jmp(DONE_LABEL);
 513 
 514   bind(IsInflated);
 515   // The object is inflated. tmpReg contains pointer to ObjectMonitor* + markWord::monitor_value
 516 
 517 #if INCLUDE_RTM_OPT
 518   // Use the same RTM locking code in 32- and 64-bit VM.
 519   if (use_rtm) {

 480     load_klass(tmpReg, objReg, cx1Reg);
 481     movl(tmpReg, Address(tmpReg, Klass::access_flags_offset()));
 482     testl(tmpReg, JVM_ACC_IS_VALUE_BASED_CLASS);
 483     jcc(Assembler::notZero, DONE_LABEL);
 484   }
 485 
 486 #if INCLUDE_RTM_OPT
 487   if (UseRTMForStackLocks && use_rtm) {
 488     rtm_stack_locking(objReg, tmpReg, scrReg, cx2Reg,
 489                       stack_rtm_counters, method_data, profile_rtm,
 490                       DONE_LABEL, IsInflated);
 491   }
 492 #endif // INCLUDE_RTM_OPT
 493 
 494   movptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes()));          // [FETCH]
 495   testptr(tmpReg, markWord::monitor_value); // inflated vs stack-locked|neutral
 496   jccb(Assembler::notZero, IsInflated);
 497 
 498   // Attempt stack-locking ...
 499   orptr (tmpReg, markWord::unlocked_value);
 500   if (EnableValhalla) {
 501     // Mask inline_type bit such that we go to the slow path if object is an inline type
 502     andptr(tmpReg, ~((int) markWord::inline_type_bit_in_place));
 503   }
 504   movptr(Address(boxReg, 0), tmpReg);          // Anticipate successful CAS
 505   lock();
 506   cmpxchgptr(boxReg, Address(objReg, oopDesc::mark_offset_in_bytes()));      // Updates tmpReg
 507   jcc(Assembler::equal, DONE_LABEL);           // Success
 508 
 509   // Recursive locking.
 510   // The object is stack-locked: markword contains stack pointer to BasicLock.
 511   // Locked by current thread if difference with current SP is less than one page.
 512   subptr(tmpReg, rsp);
 513   // Next instruction set ZFlag == 1 (Success) if difference is less then one page.
 514   andptr(tmpReg, (int32_t) (NOT_LP64(0xFFFFF003) LP64_ONLY(7 - os::vm_page_size())) );
 515   movptr(Address(boxReg, 0), tmpReg);
 516   jmp(DONE_LABEL);
 517 
 518   bind(IsInflated);
 519   // The object is inflated. tmpReg contains pointer to ObjectMonitor* + markWord::monitor_value
 520 
 521 #if INCLUDE_RTM_OPT
 522   // Use the same RTM locking code in 32- and 64-bit VM.
 523   if (use_rtm) {
< prev index next >