< prev index next >

src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp

Print this page
*** 298,10 ***
--- 298,26 ---
    }
    __ call(RuntimeAddress(Runtime1::entry_for(exit_id)));
    __ jmp(_continuation);
  }
  
+ void LoadKlassStub::emit_code(LIR_Assembler* ce) {
+   __ bind(_entry);
+   Register res = _result->as_register();
+   ce->store_parameter(_obj->as_register(), 0);
+   if (res != rax) {
+     // This preserves rax and allows it to be used as return-register,
+     // without messing with the stack.
+     __ xchgptr(rax, res);
+   }
+   __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::load_klass_id)));
+   if (res != rax) {
+     // Swap back rax, and move result to correct register.
+     __ xchgptr(rax, res);
+   }
+   __ jmp(_continuation);
+ }
  
  // Implementation of patching:
  // - Copy the code at given offset to an inlined buffer (first the bytes, then the number of bytes)
  // - Replace original code with a call to the stub
  // At Runtime:
< prev index next >