< prev index next >

src/hotspot/cpu/x86/x86_64.ad

Print this page

12366   ins_pipe(pipe_jcc);
12367   ins_short_branch(1);
12368 %}
12369 
12370 // ============================================================================
12371 // inlined locking and unlocking
12372 
12373 instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
12374   predicate(LockingMode != LM_LIGHTWEIGHT);
12375   match(Set cr (FastLock object box));
12376   effect(TEMP tmp, TEMP scr, USE_KILL box);
12377   ins_cost(300);
12378   format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
12379   ins_encode %{
12380     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
12381                  $scr$$Register, noreg, noreg, r15_thread, nullptr);
12382   %}
12383   ins_pipe(pipe_slow);
12384 %}
12385 
12386 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
12387   predicate(LockingMode != LM_LIGHTWEIGHT);
12388   match(Set cr (FastUnlock object box));
12389   effect(TEMP tmp, USE_KILL box);
12390   ins_cost(300);
12391   format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
12392   ins_encode %{
12393     __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register);
12394   %}
12395   ins_pipe(pipe_slow);
12396 %}
12397 
12398 instruct cmpFastLockLightweight(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI rax_reg, rRegP tmp) %{
12399   predicate(LockingMode == LM_LIGHTWEIGHT);
12400   match(Set cr (FastLock object box));
12401   effect(TEMP rax_reg, TEMP tmp, USE_KILL box);
12402   ins_cost(300);
12403   format %{ "fastlock $object,$box\t! kills $box,$rax_reg,$tmp" %}
12404   ins_encode %{
12405     __ fast_lock_lightweight($object$$Register, $box$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
12406   %}
12407   ins_pipe(pipe_slow);
12408 %}
12409 
12410 instruct cmpFastUnlockLightweight(rFlagsReg cr, rRegP object, rax_RegP rax_reg, rRegP tmp) %{
12411   predicate(LockingMode == LM_LIGHTWEIGHT);
12412   match(Set cr (FastUnlock object rax_reg));
12413   effect(TEMP tmp, USE_KILL rax_reg);
12414   ins_cost(300);
12415   format %{ "fastunlock $object,$rax_reg\t! kills $rax_reg,$tmp" %}
12416   ins_encode %{
12417     __ fast_unlock_lightweight($object$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
12418   %}
12419   ins_pipe(pipe_slow);
12420 %}
12421 
12422 
12423 // ============================================================================
12424 // Safepoint Instructions
12425 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
12426 %{
12427   match(SafePoint poll);
12428   effect(KILL cr, USE poll);
12429 
12430   format %{ "testl   rax, [$poll]\t"
12431             "# Safepoint: poll for GC" %}
12432   ins_cost(125);
12433   ins_encode %{
12434     __ relocate(relocInfo::poll_type);
12435     address pre_pc = __ pc();
12436     __ testl(rax, Address($poll$$Register, 0));
12437     assert(nativeInstruction_at(pre_pc)->is_safepoint_poll(), "must emit test %%eax [reg]");

12366   ins_pipe(pipe_jcc);
12367   ins_short_branch(1);
12368 %}
12369 
12370 // ============================================================================
12371 // inlined locking and unlocking
12372 
12373 instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
12374   predicate(LockingMode != LM_LIGHTWEIGHT);
12375   match(Set cr (FastLock object box));
12376   effect(TEMP tmp, TEMP scr, USE_KILL box);
12377   ins_cost(300);
12378   format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
12379   ins_encode %{
12380     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
12381                  $scr$$Register, noreg, noreg, r15_thread, nullptr);
12382   %}
12383   ins_pipe(pipe_slow);
12384 %}
12385 
12386 instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp, rRegP scr) %{
12387   predicate(LockingMode != LM_LIGHTWEIGHT);
12388   match(Set cr (FastUnlock object box));
12389   effect(TEMP tmp, TEMP scr, USE_KILL box);
12390   ins_cost(300);
12391   format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
12392   ins_encode %{
12393     __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, $scr$$Register);
12394   %}
12395   ins_pipe(pipe_slow);
12396 %}
12397 
12398 instruct cmpFastLockLightweight(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI rax_reg, rRegP tmp) %{
12399   predicate(LockingMode == LM_LIGHTWEIGHT);
12400   match(Set cr (FastLock object box));
12401   effect(TEMP rax_reg, TEMP tmp, USE_KILL box);
12402   ins_cost(300);
12403   format %{ "fastlock $object,$box\t! kills $box,$rax_reg,$tmp" %}
12404   ins_encode %{
12405     __ fast_lock_lightweight($object$$Register, $box$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
12406   %}
12407   ins_pipe(pipe_slow);
12408 %}
12409 
12410 instruct cmpFastUnlockLightweight(rFlagsReg cr, rRegP object, rax_RegP rax_reg, rRegP tmp, rRegP scr) %{
12411   predicate(LockingMode == LM_LIGHTWEIGHT);
12412   match(Set cr (FastUnlock object rax_reg));
12413   effect(TEMP tmp, TEMP scr, USE_KILL rax_reg);
12414   ins_cost(300);
12415   format %{ "fastunlock $object,$rax_reg\t! kills $rax_reg,$tmp" %}
12416   ins_encode %{
12417     __ fast_unlock_lightweight($object$$Register, $rax_reg$$Register, $tmp$$Register, $scr$$Register, r15_thread);
12418   %}
12419   ins_pipe(pipe_slow);
12420 %}
12421 
12422 
12423 // ============================================================================
12424 // Safepoint Instructions
12425 instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
12426 %{
12427   match(SafePoint poll);
12428   effect(KILL cr, USE poll);
12429 
12430   format %{ "testl   rax, [$poll]\t"
12431             "# Safepoint: poll for GC" %}
12432   ins_cost(125);
12433   ins_encode %{
12434     __ relocate(relocInfo::poll_type);
12435     address pre_pc = __ pc();
12436     __ testl(rax, Address($poll$$Register, 0));
12437     assert(nativeInstruction_at(pre_pc)->is_safepoint_poll(), "must emit test %%eax [reg]");
< prev index next >