1752 __ bind(hit); |
1752 __ bind(hit); |
1753 |
1753 |
1754 int vep_offset = ((intptr_t)__ pc()) - start; |
1754 int vep_offset = ((intptr_t)__ pc()) - start; |
1755 |
1755 |
1756 #ifdef COMPILER1 |
1756 #ifdef COMPILER1 |
1757 if (InlineObjectHash && method->intrinsic_id() == vmIntrinsics::_hashCode) { |
1757 // For Object.hashCode, System.identityHashCode try to pull hashCode from object header if available. |
1758 // Object.hashCode can pull the hashCode from the header word |
1758 if ((InlineObjectHash && method->intrinsic_id() == vmIntrinsics::_hashCode) || (method->intrinsic_id() == vmIntrinsics::_identityHashCode)) { |
1759 // instead of doing a full VM transition once it's been computed. |
1759 inline_check_hashcode_from_object_header(masm, method, rcx /*obj_reg*/, rax /*result*/); |
1760 // Since hashCode is usually polymorphic at call sites we can't do |
1760 } |
1761 // this optimization at the call site without a lot of work. |
|
1762 Label slowCase; |
|
1763 Register receiver = rcx; |
|
1764 Register result = rax; |
|
1765 __ movptr(result, Address(receiver, oopDesc::mark_offset_in_bytes())); |
|
1766 |
|
1767 // check if locked |
|
1768 __ testptr(result, markOopDesc::unlocked_value); |
|
1769 __ jcc (Assembler::zero, slowCase); |
|
1770 |
|
1771 if (UseBiasedLocking) { |
|
1772 // Check if biased and fall through to runtime if so |
|
1773 __ testptr(result, markOopDesc::biased_lock_bit_in_place); |
|
1774 __ jcc (Assembler::notZero, slowCase); |
|
1775 } |
|
1776 |
|
1777 // get hash |
|
1778 __ andptr(result, markOopDesc::hash_mask_in_place); |
|
1779 // test if hashCode exists |
|
1780 __ jcc (Assembler::zero, slowCase); |
|
1781 __ shrptr(result, markOopDesc::hash_shift); |
|
1782 __ ret(0); |
|
1783 __ bind (slowCase); |
|
1784 } |
|
1785 #endif // COMPILER1 |
1761 #endif // COMPILER1 |
1786 |
1762 |
1787 // The instruction at the verified entry point must be 5 bytes or longer |
1763 // The instruction at the verified entry point must be 5 bytes or longer |
1788 // because it can be patched on the fly by make_non_entrant. The stack bang |
1764 // because it can be patched on the fly by make_non_entrant. The stack bang |
1789 // instruction fits that requirement. |
1765 // instruction fits that requirement. |