45 Register obj_reg,
46 Register result) {
47 Label slowCase;
48
49 // Unlike for Object.hashCode, System.identityHashCode is static method and
50 // gets object as argument instead of the receiver.
51 if (method->intrinsic_id() == vmIntrinsics::_identityHashCode) {
52 Label Continue;
53 // return 0 for null reference input
54 __ cmpptr(obj_reg, NULL_WORD);
55 __ jcc(Assembler::notEqual, Continue);
56 __ xorptr(result, result);
57 __ ret(0);
58 __ bind(Continue);
59 }
60
61 __ movptr(result, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
62
63
64 if (LockingMode == LM_LIGHTWEIGHT) {
65 // check if monitor
66 __ testptr(result, markWord::monitor_value);
67 __ jcc(Assembler::notZero, slowCase);
68 } else {
69 // check if locked
70 __ testptr(result, markWord::unlocked_value);
71 __ jcc(Assembler::zero, slowCase);
72 }
73
74 // get hash
75 #ifdef _LP64
76 // Read the header and build a mask to get its hash field.
77 // Depend on hash_mask being at most 32 bits and avoid the use of hash_mask_in_place
78 // because it could be larger than 32 bits in a 64-bit vm. See markWord.hpp.
79 __ shrptr(result, markWord::hash_shift);
80 __ andptr(result, markWord::hash_mask);
81 #else
82 __ andptr(result, markWord::hash_mask_in_place);
83 #endif //_LP64
84
85 // test if hashCode exists
86 __ jcc(Assembler::zero, slowCase);
87 #ifndef _LP64
88 __ shrptr(result, markWord::hash_shift);
89 #endif
90 __ ret(0);
91 __ bind(slowCase);
92 }
93 #endif //COMPILER1
94
95 JRT_LEAF(jfloat, SharedRuntime::frem(jfloat x, jfloat y))
96 assert(StubRoutines::fmod() != nullptr, "");
97 jdouble (*addr)(jdouble, jdouble) = (double (*)(double, double))StubRoutines::fmod();
98 jdouble dx = (jdouble) x;
99 jdouble dy = (jdouble) y;
100
|
45 Register obj_reg,
46 Register result) {
47 Label slowCase;
48
49 // Unlike for Object.hashCode, System.identityHashCode is static method and
50 // gets object as argument instead of the receiver.
51 if (method->intrinsic_id() == vmIntrinsics::_identityHashCode) {
52 Label Continue;
53 // return 0 for null reference input
54 __ cmpptr(obj_reg, NULL_WORD);
55 __ jcc(Assembler::notEqual, Continue);
56 __ xorptr(result, result);
57 __ ret(0);
58 __ bind(Continue);
59 }
60
61 __ movptr(result, Address(obj_reg, oopDesc::mark_offset_in_bytes()));
62
63
64 if (LockingMode == LM_LIGHTWEIGHT) {
65 if (!UseObjectMonitorTable) {
66 // check if monitor
67 __ testptr(result, markWord::monitor_value);
68 __ jcc(Assembler::notZero, slowCase);
69 }
70 } else {
71 // check if locked
72 __ testptr(result, markWord::unlocked_value);
73 __ jcc(Assembler::zero, slowCase);
74 }
75
76 // get hash
77 #ifdef _LP64
78 // Read the header and build a mask to get its hash field.
79 // Depend on hash_mask being at most 32 bits and avoid the use of hash_mask_in_place
80 // because it could be larger than 32 bits in a 64-bit vm. See markWord.hpp.
81 if (UseCompactObjectHeaders) {
82 STATIC_ASSERT(markWord::hash_mask_compact < nth_bit(32));
83 __ shrptr(result, markWord::hash_shift_compact);
84 __ andptr(result, markWord::hash_mask_compact);
85 } else {
86 __ shrptr(result, markWord::hash_shift);
87 __ andptr(result, markWord::hash_mask);
88 }
89 #else
90 __ andptr(result, markWord::hash_mask_in_place);
91 #endif //_LP64
92
93 // test if hashCode exists
94 __ jcc(Assembler::zero, slowCase);
95 #ifndef _LP64
96 __ shrptr(result, markWord::hash_shift);
97 #endif
98 __ ret(0);
99 __ bind(slowCase);
100 }
101 #endif //COMPILER1
102
103 JRT_LEAF(jfloat, SharedRuntime::frem(jfloat x, jfloat y))
104 assert(StubRoutines::fmod() != nullptr, "");
105 jdouble (*addr)(jdouble, jdouble) = (double (*)(double, double))StubRoutines::fmod();
106 jdouble dx = (jdouble) x;
107 jdouble dy = (jdouble) y;
108
|