< prev index next >

src/hotspot/cpu/x86/x86_64.ad

Print this page
*** 5312,20 ***
--- 5312,36 ---
  %}
  
  // Load narrow Klass Pointer
  instruct loadNKlass(rRegN dst, memory mem)
  %{
+   predicate(!UseCompactObjectHeaders);
    match(Set dst (LoadNKlass mem));
  
    ins_cost(125); // XXX
    format %{ "movl    $dst, $mem\t# compressed klass ptr" %}
    ins_encode %{
      __ movl($dst$$Register, $mem$$Address);
    %}
    ins_pipe(ialu_reg_mem); // XXX
  %}
  
+ instruct loadNKlassCompactHeaders(rRegN dst, memory mem, rFlagsReg cr)
+ %{
+   predicate(UseCompactObjectHeaders);
+   match(Set dst (LoadNKlass mem));
+   effect(KILL cr);
+   ins_cost(125); // XXX
+   format %{ "movl    $dst, $mem\t# compressed klass ptr" %}
+   ins_encode %{
+     Register index = $mem$$index != 4 ? $mem$$index$$Register : noreg;
+     Address::ScaleFactor sf = (index != noreg) ? static_cast<Address::ScaleFactor>($mem$$scale) : Address::no_scale;
+     __ load_nklass_compact_c2($dst$$Register, $mem$$base$$Register, index, sf, $mem$$disp);
+   %}
+   ins_pipe(pipe_slow); // XXX
+ %}
+ 
  // Load Float
  instruct loadF(regF dst, memory mem)
  %{
    match(Set dst (LoadF mem));
  

*** 12640,10 ***
--- 12656,11 ---
    ins_pipe(ialu_cr_reg_imm);
  %}
  
  instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
  %{
+   predicate(!UseCompactObjectHeaders);
    match(Set cr (CmpN src (LoadNKlass mem)));
  
    format %{ "cmpl    $mem, $src\t# compressed klass ptr" %}
    ins_encode %{
      __ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);

*** 13286,11 ***
    %}
    ins_pipe(pipe_slow);
  %}
  
  instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
!   predicate(!Compile::current()->use_rtm());
    match(Set cr (FastLock object box));
    effect(TEMP tmp, TEMP scr, USE_KILL box);
    ins_cost(300);
    format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
    ins_encode %{
--- 13303,11 ---
    %}
    ins_pipe(pipe_slow);
  %}
  
  instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr) %{
!   predicate(LockingMode != LM_LIGHTWEIGHT && !Compile::current()->use_rtm());
    match(Set cr (FastLock object box));
    effect(TEMP tmp, TEMP scr, USE_KILL box);
    ins_cost(300);
    format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
    ins_encode %{

*** 13299,20 ***
--- 13316,45 ---
    %}
    ins_pipe(pipe_slow);
  %}
  
  instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
+   predicate(LockingMode != LM_LIGHTWEIGHT);
    match(Set cr (FastUnlock object box));
    effect(TEMP tmp, USE_KILL box);
    ins_cost(300);
    format %{ "fastunlock $object,$box\t! kills $box,$tmp" %}
    ins_encode %{
      __ fast_unlock($object$$Register, $box$$Register, $tmp$$Register, ra_->C->use_rtm());
    %}
    ins_pipe(pipe_slow);
  %}
  
+ instruct cmpFastLockLightweight(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI rax_reg, rRegP tmp) %{
+   predicate(LockingMode == LM_LIGHTWEIGHT);
+   match(Set cr (FastLock object box));
+   effect(TEMP rax_reg, TEMP tmp, USE_KILL box);
+   ins_cost(300);
+   format %{ "fastlock $object,$box\t! kills $box,$rax_reg,$tmp" %}
+   ins_encode %{
+     __ fast_lock_lightweight($object$$Register, $box$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
+   %}
+   ins_pipe(pipe_slow);
+ %}
+ 
+ instruct cmpFastUnlockLightweight(rFlagsReg cr, rRegP object, rax_RegP rax_reg, rRegP tmp) %{
+   predicate(LockingMode == LM_LIGHTWEIGHT);
+   match(Set cr (FastUnlock object rax_reg));
+   effect(TEMP tmp, USE_KILL rax_reg);
+   ins_cost(300);
+   format %{ "fastunlock $object,$rax_reg\t! kills $rax_reg,$tmp" %}
+   ins_encode %{
+     __ fast_unlock_lightweight($object$$Register, $rax_reg$$Register, $tmp$$Register, r15_thread);
+   %}
+   ins_pipe(pipe_slow);
+ %}
+ 
  
  // ============================================================================
  // Safepoint Instructions
  instruct safePoint_poll_tls(rFlagsReg cr, rRegP poll)
  %{
< prev index next >