< prev index next >

src/hotspot/cpu/x86/x86_64.ad

Print this page
@@ -5294,20 +5294,22 @@
    %}
    ins_pipe(ialu_reg_mem); // XXX
  %}
  
  // Load narrow Klass Pointer
- instruct loadNKlass(rRegN dst, memory mem)
+ instruct loadNKlass(rRegN dst, indOffset8 mem, rFlagsReg cr)
  %{
    match(Set dst (LoadNKlass mem));
- 
+   effect(TEMP_DEF dst, KILL cr);
    ins_cost(125); // XXX
    format %{ "movl    $dst, $mem\t# compressed klass ptr" %}
    ins_encode %{
-     __ movl($dst$$Register, $mem$$Address);
+     assert($mem$$disp == oopDesc::klass_offset_in_bytes(), "expect correct offset 4, but got: %d", $mem$$disp);
+     assert($mem$$index == 4, "expect no index register: %d", $mem$$index);
+     __ load_nklass($dst$$Register, $mem$$base$$Register);
    %}
-   ins_pipe(ialu_reg_mem); // XXX
+   ins_pipe(pipe_slow); // XXX
  %}
  
  // Load Float
  instruct loadF(regF dst, memory mem)
  %{

@@ -12601,12 +12603,16 @@
      __ cmp_narrow_klass($op1$$Register, (Klass*)$op2$$constant);
    %}
    ins_pipe(ialu_cr_reg_imm);
  %}
  
+ // Disabled because the compressed Klass* in header cannot be safely
+ // accessed. TODO: Re-enable it as soon as synchronization does not
+ // overload the upper header bits anymore.
  instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
  %{
+   predicate(false);
    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);

@@ -13283,40 +13289,40 @@
  // ============================================================================
  // inlined locking and unlocking
  
  instruct cmpFastLockRTM(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rdx_RegI scr, rRegI cx1, rRegI cx2) %{
    predicate(Compile::current()->use_rtm());
-   match(Set cr (FastLock object box));
-   effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, USE_KILL box);
+   match(Set cr (FastLock object));
+   effect(TEMP tmp, TEMP scr, TEMP cx1, TEMP cx2, TEMP box);
    ins_cost(300);
    format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr,$cx1,$cx2" %}
    ins_encode %{
      __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
-                  $scr$$Register, $cx1$$Register, $cx2$$Register,
+                  $scr$$Register, $cx1$$Register, $cx2$$Register, r15_thread,
                   _rtm_counters, _stack_rtm_counters,
                   ((Method*)(ra_->C->method()->constant_encoding()))->method_data(),
                   true, ra_->C->profile_rtm());
    %}
    ins_pipe(pipe_slow);
  %}
  
- instruct cmpFastLock(rFlagsReg cr, rRegP object, rbx_RegP box, rax_RegI tmp, rRegP scr, rRegP cx1) %{
+ instruct cmpFastLock(rFlagsReg cr, rRegP object, rax_RegI tmp, rRegP scr, rRegP cx1) %{
    predicate(!Compile::current()->use_rtm());
-   match(Set cr (FastLock object box));
-   effect(TEMP tmp, TEMP scr, TEMP cx1, USE_KILL box);
+   match(Set cr (FastLock object));
+   effect(TEMP tmp, TEMP scr, TEMP cx1);
    ins_cost(300);
-   format %{ "fastlock $object,$box\t! kills $box,$tmp,$scr" %}
+   format %{ "fastlock $object\t! kills $tmp,$scr" %}
    ins_encode %{
-     __ fast_lock($object$$Register, $box$$Register, $tmp$$Register,
-                  $scr$$Register, $cx1$$Register, noreg, NULL, NULL, NULL, false, false);
+     __ fast_lock($object$$Register, noreg, $tmp$$Register,
+                  $scr$$Register, $cx1$$Register, noreg, r15_thread, NULL, NULL, NULL, false, false);
    %}
    ins_pipe(pipe_slow);
  %}
  
  instruct cmpFastUnlock(rFlagsReg cr, rRegP object, rax_RegP box, rRegP tmp) %{
-   match(Set cr (FastUnlock object box));
-   effect(TEMP tmp, USE_KILL box);
+   match(Set cr (FastUnlock object));
+   effect(TEMP tmp, TEMP 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());
    %}
< prev index next >