< prev index next >

src/hotspot/cpu/aarch64/aarch64.ad

Print this page
*** 7144,20 ***
  
  // Load Narrow Klass Pointer
  instruct loadNKlass(iRegNNoSp dst, memory4 mem)
  %{
    match(Set dst (LoadNKlass mem));
!   predicate(!needs_acquiring_load(n));
  
    ins_cost(4 * INSN_COST);
    format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
  
    ins_encode(aarch64_enc_ldrw(dst, mem));
  
    ins_pipe(iload_reg_mem);
  %}
  
  // Load Float
  instruct loadF(vRegF dst, memory4 mem)
  %{
    match(Set dst (LoadF mem));
    predicate(!needs_acquiring_load(n));
--- 7144,34 ---
  
  // Load Narrow Klass Pointer
  instruct loadNKlass(iRegNNoSp dst, memory4 mem)
  %{
    match(Set dst (LoadNKlass mem));
!   predicate(!needs_acquiring_load(n) && !UseCompactObjectHeaders);
  
    ins_cost(4 * INSN_COST);
    format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
  
    ins_encode(aarch64_enc_ldrw(dst, mem));
  
    ins_pipe(iload_reg_mem);
  %}
  
+ instruct loadNKlassCompactHeaders(iRegNNoSp dst, memory4 mem, rFlagsReg cr)
+ %{
+   match(Set dst (LoadNKlass mem));
+   effect(KILL cr);
+   predicate(!needs_acquiring_load(n) && UseCompactObjectHeaders);
+ 
+   ins_cost(4 * INSN_COST);
+   format %{ "ldrw  $dst, $mem\t# compressed class ptr" %}
+   ins_encode %{
+     __ load_nklass_compact($dst$$Register, $mem$$base$$Register, $mem$$index$$Register, $mem$$scale, $mem$$disp);
+   %}
+   ins_pipe(pipe_slow);
+ %}
+ 
  // Load Float
  instruct loadF(vRegF dst, memory4 mem)
  %{
    match(Set dst (LoadF mem));
    predicate(!needs_acquiring_load(n));

*** 16435,27 ***
  // ============================================================================
  // inlined locking and unlocking
  
  instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2, iRegPNoSp tmp3)
  %{
    match(Set cr (FastLock object box));
    effect(TEMP tmp, TEMP tmp2, TEMP tmp3);
  
-   // TODO
-   // identify correct cost
    ins_cost(5 * INSN_COST);
!   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
  
    ins_encode %{
      __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register, $tmp3$$Register);
    %}
  
    ins_pipe(pipe_serial);
  %}
  
  instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
  %{
    match(Set cr (FastUnlock object box));
    effect(TEMP tmp, TEMP tmp2);
  
    ins_cost(5 * INSN_COST);
    format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
--- 16449,27 ---
  // ============================================================================
  // inlined locking and unlocking
  
  instruct cmpFastLock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2, iRegPNoSp tmp3)
  %{
+   predicate(LockingMode != LM_LIGHTWEIGHT);
    match(Set cr (FastLock object box));
    effect(TEMP tmp, TEMP tmp2, TEMP tmp3);
  
    ins_cost(5 * INSN_COST);
!   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2,$tmp3" %}
  
    ins_encode %{
      __ fast_lock($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register, $tmp3$$Register);
    %}
  
    ins_pipe(pipe_serial);
  %}
  
  instruct cmpFastUnlock(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
  %{
+   predicate(LockingMode != LM_LIGHTWEIGHT);
    match(Set cr (FastUnlock object box));
    effect(TEMP tmp, TEMP tmp2);
  
    ins_cost(5 * INSN_COST);
    format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}

*** 16465,10 ***
--- 16479,41 ---
    %}
  
    ins_pipe(pipe_serial);
  %}
  
+ instruct cmpFastLockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
+ %{
+   predicate(LockingMode == LM_LIGHTWEIGHT);
+   match(Set cr (FastLock object box));
+   effect(TEMP tmp, TEMP tmp2);
+ 
+   ins_cost(5 * INSN_COST);
+   format %{ "fastlock $object,$box\t! kills $tmp,$tmp2" %}
+ 
+   ins_encode %{
+     __ fast_lock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
+   %}
+ 
+   ins_pipe(pipe_serial);
+ %}
+ 
+ instruct cmpFastUnlockLightweight(rFlagsReg cr, iRegP object, iRegP box, iRegPNoSp tmp, iRegPNoSp tmp2)
+ %{
+   predicate(LockingMode == LM_LIGHTWEIGHT);
+   match(Set cr (FastUnlock object box));
+   effect(TEMP tmp, TEMP tmp2);
+ 
+   ins_cost(5 * INSN_COST);
+   format %{ "fastunlock $object,$box\t! kills $tmp, $tmp2" %}
+ 
+   ins_encode %{
+     __ fast_unlock_lightweight($object$$Register, $box$$Register, $tmp$$Register, $tmp2$$Register);
+   %}
+ 
+   ins_pipe(pipe_serial);
+ %}
  
  // ============================================================================
  // Safepoint Instructions
  
  // TODO
< prev index next >