< prev index next >

src/cpu/x86/vm/sharedRuntime_x86.cpp

Print this page




  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/macroAssembler.hpp"
  27 #include "runtime/sharedRuntime.hpp"
  28 #include "vmreg_x86.inline.hpp"
  29 #ifdef COMPILER1
  30 #include "c1/c1_Runtime1.hpp"
  31 #endif //COMPILER1
  32 
  33 #define __ masm->
  34 
  35 #ifdef COMPILER1
  36 // ---------------------------------------------------------------------------
  37 // Object.hashCode, System.identityHashCode can pull the hashCode from the
  38 // header word instead of doing a full VM transition once it's been computed.
  39 // Since hashCode is usually polymorphic at call sites we can't do this
  40 // optimization at the call site without a lot of work.
  41 void SharedRuntime::inline_check_hashcode_from_object_header(MacroAssembler* masm,
  42                                  methodHandle method,
  43                                  Register obj_reg,
  44                                  Register result) {
  45   Label slowCase;
  46 
  47   // Unlike for Object.hashCode, System.identityHashCode is static method and
  48   // gets object as argument instead of the receiver.
  49   if (method->intrinsic_id() == vmIntrinsics::_identityHashCode) {
  50     Label Continue;
  51     // return 0 for null reference input
  52     __ cmpptr(obj_reg, (int32_t)NULL_WORD);
  53     __ jcc(Assembler::notEqual, Continue);
  54     __ xorptr(result, result);
  55     __ ret(0);
  56     __ bind(Continue);
  57   }
  58 
  59   __ movptr(result, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
  60 
  61   // check if locked
  62   __ testptr(result, markOopDesc::unlocked_value);




  22  *
  23  */
  24 
  25 #include "precompiled.hpp"
  26 #include "asm/macroAssembler.hpp"
  27 #include "runtime/sharedRuntime.hpp"
  28 #include "vmreg_x86.inline.hpp"
  29 #ifdef COMPILER1
  30 #include "c1/c1_Runtime1.hpp"
  31 #endif //COMPILER1
  32 
  33 #define __ masm->
  34 
  35 #ifdef COMPILER1
  36 // ---------------------------------------------------------------------------
  37 // Object.hashCode, System.identityHashCode can pull the hashCode from the
  38 // header word instead of doing a full VM transition once it's been computed.
  39 // Since hashCode is usually polymorphic at call sites we can't do this
  40 // optimization at the call site without a lot of work.
  41 void SharedRuntime::inline_check_hashcode_from_object_header(MacroAssembler* masm,
  42                                  const methodHandle& method,
  43                                  Register obj_reg,
  44                                  Register result) {
  45   Label slowCase;
  46 
  47   // Unlike for Object.hashCode, System.identityHashCode is static method and
  48   // gets object as argument instead of the receiver.
  49   if (method->intrinsic_id() == vmIntrinsics::_identityHashCode) {
  50     Label Continue;
  51     // return 0 for null reference input
  52     __ cmpptr(obj_reg, (int32_t)NULL_WORD);
  53     __ jcc(Assembler::notEqual, Continue);
  54     __ xorptr(result, result);
  55     __ ret(0);
  56     __ bind(Continue);
  57   }
  58 
  59   __ movptr(result, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
  60 
  61   // check if locked
  62   __ testptr(result, markOopDesc::unlocked_value);


< prev index next >