comparison src/cpu/x86/vm/x86_32.ad @ 512:db4caa99ef11

6787106: Hotspot 32 bit build fails on platforms having different definitions for intptr_t & int32_t Summary: Avoid casting between int32_t and intptr_t specifically for MasmAssembler::movptr in 32 bit platforms. Reviewed-by: jrose, kvn
author xlu
date Wed, 24 Dec 2008 13:06:09 -0800
parents a1980da045cc
children dca06e7f503d
comparison
equal deleted inserted replaced
511:dabd8d202164 512:db4caa99ef11
3369 3369
3370 if (EmitSync & 8192) { 3370 if (EmitSync & 8192) {
3371 masm.movptr(Address(boxReg, 0), 3) ; // results in ST-before-CAS penalty 3371 masm.movptr(Address(boxReg, 0), 3) ; // results in ST-before-CAS penalty
3372 masm.get_thread (scrReg) ; 3372 masm.get_thread (scrReg) ;
3373 masm.movptr(boxReg, tmpReg); // consider: LEA box, [tmp-2] 3373 masm.movptr(boxReg, tmpReg); // consider: LEA box, [tmp-2]
3374 masm.movptr(tmpReg, 0); // consider: xor vs mov 3374 masm.movptr(tmpReg, NULL_WORD); // consider: xor vs mov
3375 if (os::is_MP()) { masm.lock(); } 3375 if (os::is_MP()) { masm.lock(); }
3376 masm.cmpxchgptr(scrReg, Address(boxReg, ObjectMonitor::owner_offset_in_bytes()-2)) ; 3376 masm.cmpxchgptr(scrReg, Address(boxReg, ObjectMonitor::owner_offset_in_bytes()-2)) ;
3377 } else 3377 } else
3378 if ((EmitSync & 128) == 0) { // avoid ST-before-CAS 3378 if ((EmitSync & 128) == 0) { // avoid ST-before-CAS
3379 masm.movptr(scrReg, boxReg) ; 3379 masm.movptr(scrReg, boxReg) ;
3385 masm.prefetchw(Address(rax, ObjectMonitor::owner_offset_in_bytes()-2)); 3385 masm.prefetchw(Address(rax, ObjectMonitor::owner_offset_in_bytes()-2));
3386 } 3386 }
3387 3387
3388 if ((EmitSync & 64) == 0) { 3388 if ((EmitSync & 64) == 0) {
3389 // Optimistic form: consider XORL tmpReg,tmpReg 3389 // Optimistic form: consider XORL tmpReg,tmpReg
3390 masm.movptr(tmpReg, 0 ) ; 3390 masm.movptr(tmpReg, NULL_WORD) ;
3391 } else { 3391 } else {
3392 // Can suffer RTS->RTO upgrades on shared or cold $ lines 3392 // Can suffer RTS->RTO upgrades on shared or cold $ lines
3393 // Test-And-CAS instead of CAS 3393 // Test-And-CAS instead of CAS
3394 masm.movptr(tmpReg, Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2)) ; // rax, = m->_owner 3394 masm.movptr(tmpReg, Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2)) ; // rax, = m->_owner
3395 masm.testptr(tmpReg, tmpReg) ; // Locked ? 3395 masm.testptr(tmpReg, tmpReg) ; // Locked ?
3585 masm.xorptr(boxReg, Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2)) ; 3585 masm.xorptr(boxReg, Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2)) ;
3586 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::recursions_offset_in_bytes()-2)) ; 3586 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::recursions_offset_in_bytes()-2)) ;
3587 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::EntryList_offset_in_bytes()-2)) ; 3587 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::EntryList_offset_in_bytes()-2)) ;
3588 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::cxq_offset_in_bytes()-2)) ; 3588 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::cxq_offset_in_bytes()-2)) ;
3589 masm.jccb (Assembler::notZero, DONE_LABEL) ; 3589 masm.jccb (Assembler::notZero, DONE_LABEL) ;
3590 masm.movptr(Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), 0) ; 3590 masm.movptr(Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), NULL_WORD) ;
3591 masm.jmpb (DONE_LABEL) ; 3591 masm.jmpb (DONE_LABEL) ;
3592 } else { 3592 } else {
3593 masm.xorptr(boxReg, Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2)) ; 3593 masm.xorptr(boxReg, Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2)) ;
3594 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::recursions_offset_in_bytes()-2)) ; 3594 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::recursions_offset_in_bytes()-2)) ;
3595 masm.jccb (Assembler::notZero, DONE_LABEL) ; 3595 masm.jccb (Assembler::notZero, DONE_LABEL) ;
3596 masm.movptr(boxReg, Address (tmpReg, ObjectMonitor::EntryList_offset_in_bytes()-2)) ; 3596 masm.movptr(boxReg, Address (tmpReg, ObjectMonitor::EntryList_offset_in_bytes()-2)) ;
3597 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::cxq_offset_in_bytes()-2)) ; 3597 masm.orptr(boxReg, Address (tmpReg, ObjectMonitor::cxq_offset_in_bytes()-2)) ;
3598 masm.jccb (Assembler::notZero, CheckSucc) ; 3598 masm.jccb (Assembler::notZero, CheckSucc) ;
3599 masm.movptr(Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), 0) ; 3599 masm.movptr(Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), NULL_WORD) ;
3600 masm.jmpb (DONE_LABEL) ; 3600 masm.jmpb (DONE_LABEL) ;
3601 } 3601 }
3602 3602
3603 // The Following code fragment (EmitSync & 65536) improves the performance of 3603 // The Following code fragment (EmitSync & 65536) improves the performance of
3604 // contended applications and contended synchronization microbenchmarks. 3604 // contended applications and contended synchronization microbenchmarks.
3642 // remains in M-state for the lock:orl. 3642 // remains in M-state for the lock:orl.
3643 // 3643 //
3644 // We currently use (3), although it's likely that switching to (2) 3644 // We currently use (3), although it's likely that switching to (2)
3645 // is correct for the future. 3645 // is correct for the future.
3646 3646
3647 masm.movptr(Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), 0) ; 3647 masm.movptr(Address (tmpReg, ObjectMonitor::owner_offset_in_bytes()-2), NULL_WORD) ;
3648 if (os::is_MP()) { 3648 if (os::is_MP()) {
3649 if (VM_Version::supports_sse2() && 1 == FenceInstruction) { 3649 if (VM_Version::supports_sse2() && 1 == FenceInstruction) {
3650 masm.mfence(); 3650 masm.mfence();
3651 } else { 3651 } else {
3652 masm.lock () ; masm.addptr(Address(rsp, 0), 0) ; 3652 masm.lock () ; masm.addptr(Address(rsp, 0), 0) ;