12272 _rtm_counters, _stack_rtm_counters,
12273 ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
12274 true, ra_->C->profile_rtm());
12275 %}
12276 ins_pipe(pipe_slow);
12277 %}
12278
12279 instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
12280 predicate(LockingMode != LM_LIGHTWEIGHT && !Compile::current()->use_rtm());
12281 match(Set cr (FastLock object box));
12282 effect(TEMP tmp, TEMP scr, USE_KILL box);
12283 ins_cost(300);
12284 format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
12285 ins_encode %{
12286 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
12287 $scr$$Register, noreg, noreg, r15_thread, nullptr, nullptr, nullptr, false, false);
12288 %}
12289 ins_pipe(pipe_slow);
12290 %}
12291
12292 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
12293 predicate(LockingMode != LM_LIGHTWEIGHT);
12294 match(Set cr (FastUnlock object box));
12295 effect(TEMP tmp, USE_KILL box);
12296 ins_cost(300);
12297 format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
12298 ins_encode %{
12299 __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, ra_->C->use_rtm());
12300 %}
12301 ins_pipe(pipe_slow);
12302 %}
12303
12304 instruct cmpFastLockLightweight(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI rax_reg, rRegP tmp) %{
12305 predicate(LockingMode == LM_LIGHTWEIGHT);
12306 match(Set cr (FastLock object box));
12307 effect(TEMP rax_reg, TEMP tmp, USE_KILL box);
12308 ins_cost(300);
12309 format %{ "fastlock $object,$box\t! kills $box,$rax_reg,$tmp" %}
12310 ins_encode %{
12311 __ fast_lock_lightweight($object$$Register, $box$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
12312 %}
12313 ins_pipe(pipe_slow);
12314 %}
12315
12316 instruct cmpFastUnlockLightweight(rFlagsReg cr, rRegP object, rax_RegP rax_reg, rRegP tmp) %{
12317 predicate(LockingMode == LM_LIGHTWEIGHT);
12318 match(Set cr (FastUnlock object rax_reg));
12319 effect(TEMP tmp, USE_KILL rax_reg);
12320 ins_cost(300);
12321 format %{ "fastunlock $object,$rax_reg\t! kills $rax_reg,$tmp" %}
12322 ins_encode %{
12323 __ fast_unlock_lightweight($object$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
12324 %}
12325 ins_pipe(pipe_slow);
12326 %}
12327
12328
12329 // ============================================================================
12330 // Safepoint Instructions
12331 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
12332 %{
12333 match(SafePoint poll);
12334 effect(KILL cr, USE poll);
12335
12336 format %{ "testl rax, [$poll]\t"
12337 "# Safepoint: poll for GC" %}
12338 ins_cost(125);
12339 size(4); /* setting an explicit size will cause debug builds to assert if size is incorrect */
12340 ins_encode %{
12341 __ relocate(relocInfo::poll_type);
12342 address pre_pc = __ pc();
12343 __ testl(rax, Address($poll$$Register, 0));
|
12272 _rtm_counters, _stack_rtm_counters,
12273 ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
12274 true, ra_->C->profile_rtm());
12275 %}
12276 ins_pipe(pipe_slow);
12277 %}
12278
12279 instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
12280 predicate(LockingMode != LM_LIGHTWEIGHT && !Compile::current()->use_rtm());
12281 match(Set cr (FastLock object box));
12282 effect(TEMP tmp, TEMP scr, USE_KILL box);
12283 ins_cost(300);
12284 format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
12285 ins_encode %{
12286 __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
12287 $scr$$Register, noreg, noreg, r15_thread, nullptr, nullptr, nullptr, false, false);
12288 %}
12289 ins_pipe(pipe_slow);
12290 %}
12291
12292 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp, rRegP scr) %{
12293 predicate(LockingMode != LM_LIGHTWEIGHT);
12294 match(Set cr (FastUnlock object box));
12295 effect(TEMP tmp, TEMP scr, USE_KILL box);
12296 ins_cost(300);
12297 format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
12298 ins_encode %{
12299 __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, $scr$$Register, ra_->C->use_rtm());
12300 %}
12301 ins_pipe(pipe_slow);
12302 %}
12303
12304 instruct cmpFastLockLightweight(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI rax_reg, rRegP tmp) %{
12305 predicate(LockingMode == LM_LIGHTWEIGHT);
12306 match(Set cr (FastLock object box));
12307 effect(TEMP rax_reg, TEMP tmp, USE_KILL box);
12308 ins_cost(300);
12309 format %{ "fastlock $object,$box\t! kills $box,$rax_reg,$tmp" %}
12310 ins_encode %{
12311 __ fast_lock_lightweight($object$$Register, $box$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
12312 %}
12313 ins_pipe(pipe_slow);
12314 %}
12315
12316 instruct cmpFastUnlockLightweight(rFlagsReg cr, rRegP object, rax_RegP rax_reg, rRegP tmp, rRegP scr) %{
12317 predicate(LockingMode == LM_LIGHTWEIGHT);
12318 match(Set cr (FastUnlock object rax_reg));
12319 effect(TEMP tmp, TEMP scr, USE_KILL rax_reg);
12320 ins_cost(300);
12321 format %{ "fastunlock $object,$rax_reg\t! kills $rax_reg,$tmp" %}
12322 ins_encode %{
12323 __ fast_unlock_lightweight($object$$Register, $rax_reg$$Register, $tmp$$Register, $scr$$Register, r15_thread);
12324 %}
12325 ins_pipe(pipe_slow);
12326 %}
12327
12328
12329 // ============================================================================
12330 // Safepoint Instructions
12331 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
12332 %{
12333 match(SafePoint poll);
12334 effect(KILL cr, USE poll);
12335
12336 format %{ "testl rax, [$poll]\t"
12337 "# Safepoint: poll for GC" %}
12338 ins_cost(125);
12339 size(4); /* setting an explicit size will cause debug builds to assert if size is incorrect */
12340 ins_encode %{
12341 __ relocate(relocInfo::poll_type);
12342 address pre_pc = __ pc();
12343 __ testl(rax, Address($poll$$Register, 0));
|