comparison src/cpu/x86/vm/macroAssembler_x86.cpp @ 17849:526acaf3626f

8038939: Some options related to RTM locking optimization works inconsistently Summary: Switch UseRTMXendForLockBusy flag ON by default and change code to retry RTM locking on lock busy condition by default. Reviewed-by: roland
author kvn
date Wed, 09 Apr 2014 11:18:02 -0700
parents 606acabe7b5c
children 400709e275c1
comparison
equal deleted inserted replaced
17848:6048424d3865 17849:526acaf3626f
1486 1486
1487 if (RTMRetryCount > 0) { 1487 if (RTMRetryCount > 0) {
1488 movl(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort 1488 movl(retry_on_abort_count_Reg, RTMRetryCount); // Retry on abort
1489 bind(L_rtm_retry); 1489 bind(L_rtm_retry);
1490 } 1490 }
1491 if (!UseRTMXendForLockBusy) { 1491 movptr(tmpReg, Address(objReg, 0));
1492 movptr(tmpReg, Address(objReg, 0)); 1492 testptr(tmpReg, markOopDesc::monitor_value); // inflated vs stack-locked|neutral|biased
1493 testptr(tmpReg, markOopDesc::monitor_value); // inflated vs stack-locked|neutral|biased 1493 jcc(Assembler::notZero, IsInflated);
1494 jcc(Assembler::notZero, IsInflated); 1494
1495 }
1496 if (PrintPreciseRTMLockingStatistics || profile_rtm) { 1495 if (PrintPreciseRTMLockingStatistics || profile_rtm) {
1497 Label L_noincrement; 1496 Label L_noincrement;
1498 if (RTMTotalCountIncrRate > 1) { 1497 if (RTMTotalCountIncrRate > 1) {
1499 // tmpReg, scrReg and flags are killed 1498 // tmpReg, scrReg and flags are killed
1500 branch_on_random_using_rdtsc(tmpReg, scrReg, (int)RTMTotalCountIncrRate, L_noincrement); 1499 branch_on_random_using_rdtsc(tmpReg, scrReg, (int)RTMTotalCountIncrRate, L_noincrement);
1510 jcc(Assembler::equal, DONE_LABEL); // all done if unlocked 1509 jcc(Assembler::equal, DONE_LABEL); // all done if unlocked
1511 1510
1512 Register abort_status_Reg = tmpReg; // status of abort is stored in RAX 1511 Register abort_status_Reg = tmpReg; // status of abort is stored in RAX
1513 if (UseRTMXendForLockBusy) { 1512 if (UseRTMXendForLockBusy) {
1514 xend(); 1513 xend();
1515 movptr(tmpReg, Address(objReg, 0)); 1514 movptr(abort_status_Reg, 0x2); // Set the abort status to 2 (so we can retry)
1516 testptr(tmpReg, markOopDesc::monitor_value); // inflated vs stack-locked|neutral|biased
1517 jcc(Assembler::notZero, IsInflated);
1518 movptr(abort_status_Reg, 0x1); // Set the abort status to 1 (as xabort does)
1519 jmp(L_decrement_retry); 1515 jmp(L_decrement_retry);
1520 } 1516 }
1521 else { 1517 else {
1522 xabort(0); 1518 xabort(0);
1523 } 1519 }