< prev index next >

src/hotspot/cpu/x86/x86.ad

Print this page
*** 7282,15 ***
    match(Set dst (LoadNKlass mem));
    effect(KILL cr);
    ins_cost(125);
    format %{
      "movl    $dst, $mem\t# compressed klass ptr, shifted\n\t"
!     "shrl    $dst, markWord::klass_shift_at_offset"
    %}
    ins_encode %{
!     __ movl($dst$$Register, $mem$$Address);
!     __ shrl($dst$$Register, markWord::klass_shift_at_offset);
    %}
    ins_pipe(ialu_reg_mem);
  %}
  
  // Load Float
--- 7282,23 ---
    match(Set dst (LoadNKlass mem));
    effect(KILL cr);
    ins_cost(125);
    format %{
      "movl    $dst, $mem\t# compressed klass ptr, shifted\n\t"
!     "shrl    $dst, markWord::klass_shift"
    %}
    ins_encode %{
!     // The incoming address is pointing into obj-start + Type::klass_offset(). We need to extract
!     // obj-start, so that we can load from the object's mark-word instead.
+     Register d = $dst$$Register;
+     Address  s = ($mem$$Address).plus_disp(-Type::klass_offset());
+     if (UseAPX) {
+       __ eshrl(d, s, markWord::klass_shift, false);
+     } else {
+       __ movl(d, s);
+       __ shrl(d, markWord::klass_shift);
+     }
    %}
    ins_pipe(ialu_reg_mem);
  %}
  
  // Load Float
< prev index next >