< prev index next >

src/hotspot/cpu/riscv/riscv.ad

Print this page
@@ -10206,14 +10206,15 @@
  
  // inlined locking and unlocking
  // using t1 as the 'flag' register to bridge the BoolNode producers and consumers
  instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp1, iRegPNoSp tmp2, iRegPNoSp tmp3)
  %{
+   predicate(LockingMode != LM_LIGHTWEIGHT);
    match(Set cr (FastLock object box));
    effect(TEMP tmp1, TEMP tmp2, TEMP tmp3);
  
-   ins_cost(LOAD_COST * 2 + STORE_COST * 3 + ALU_COST * 6 + BRANCH_COST * 3);
+   ins_cost(10 * DEFAULT_COST);
    format %{ "fastlock $object,$box\t! kills $tmp1,$tmp2,$tmp3, #@cmpFastLock" %}
  
    ins_encode %{
      __ fast_lock($object$$Register, $box$$Register, $tmp1$$Register, $tmp2$$Register, $tmp3$$Register);
    %}

@@ -10222,23 +10223,56 @@
  %}
  
  // using t1 as the 'flag' register to bridge the BoolNode producers and consumers
  instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp1, iRegPNoSp tmp2)
  %{
+   predicate(LockingMode != LM_LIGHTWEIGHT);
    match(Set cr (FastUnlock object box));
    effect(TEMP tmp1, TEMP tmp2);
  
-   ins_cost(LOAD_COST * 2 + STORE_COST + ALU_COST * 2 + BRANCH_COST * 4);
+   ins_cost(10 * DEFAULT_COST);
    format %{ "fastunlock $object,$box\t! kills $tmp1, $tmp2, #@cmpFastUnlock" %}
  
    ins_encode %{
      __ fast_unlock($object$$Register, $box$$Register, $tmp1$$Register, $tmp2$$Register);
    %}
  
    ins_pipe(pipe_serial);
  %}
  
+ instruct cmpFastLockLightweight(rFlagsReg cr, iRegP object, iRegP_R10 box, iRegPNoSp tmp1, iRegPNoSp tmp2)
+ %{
+   predicate(LockingMode == LM_LIGHTWEIGHT);
+   match(Set cr (FastLock object box));
+   effect(TEMP tmp1, TEMP tmp2, USE_KILL box);
+ 
+   ins_cost(10 * DEFAULT_COST);
+   format %{ "fastlock $object,$box\t! kills $box,$tmp1,$tmp2 #@cmpFastLockLightweight" %}
+ 
+   ins_encode %{
+     __ fast_lock_lightweight($object$$Register, $box$$Register, $tmp1$$Register, $tmp2$$Register);
+   %}
+ 
+   ins_pipe(pipe_serial);
+ %}
+ 
+ instruct cmpFastUnlockLightweight(rFlagsReg cr, iRegP object, iRegP_R10 box, iRegPNoSp tmp1, iRegPNoSp tmp2)
+ %{
+   predicate(LockingMode == LM_LIGHTWEIGHT);
+   match(Set cr (FastUnlock object box));
+   effect(TEMP tmp1, TEMP tmp2, USE_KILL box);
+ 
+   ins_cost(10 * DEFAULT_COST);
+   format %{ "fastunlock $object,$box\t! kills $box,$tmp1,$tmp2, #@cmpFastUnlockLightweight" %}
+ 
+   ins_encode %{
+     __ fast_unlock_lightweight($object$$Register, $box$$Register, $tmp1$$Register, $tmp2$$Register);
+   %}
+ 
+   ins_pipe(pipe_serial);
+ %}
+ 
  // Tail Call; Jump from runtime stub to Java code.
  // Also known as an 'interprocedural jump'.
  // Target of jump will eventually return to caller.
  // TailJump below removes the return address.
  instruct TailCalljmpInd(iRegPNoSp jump_target, inline_cache_RegP method_oop)
< prev index next >