869 #endif // ASSERT |
869 #endif // ASSERT |
870 } |
870 } |
871 |
871 |
872 // Get synchronization object to Rscratch2. |
872 // Get synchronization object to Rscratch2. |
873 { |
873 { |
874 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); |
|
875 Label Lstatic; |
874 Label Lstatic; |
876 Label Ldone; |
875 Label Ldone; |
877 |
876 |
878 __ testbitdi(CCR0, R0, Rflags, JVM_ACC_STATIC_BIT); |
877 __ testbitdi(CCR0, R0, Rflags, JVM_ACC_STATIC_BIT); |
879 __ btrue(CCR0, Lstatic); |
878 __ btrue(CCR0, Lstatic); |
881 // Non-static case: load receiver obj from stack and we're done. |
880 // Non-static case: load receiver obj from stack and we're done. |
882 __ ld(Robj_to_lock, R18_locals); |
881 __ ld(Robj_to_lock, R18_locals); |
883 __ b(Ldone); |
882 __ b(Ldone); |
884 |
883 |
885 __ bind(Lstatic); // Static case: Lock the java mirror |
884 __ bind(Lstatic); // Static case: Lock the java mirror |
886 __ ld(Robj_to_lock, in_bytes(Method::const_offset()), R19_method); |
885 __ load_mirror(Robj_to_lock, R19_method); |
887 __ ld(Robj_to_lock, in_bytes(ConstMethod::constants_offset()), Robj_to_lock); |
|
888 __ ld(Robj_to_lock, ConstantPool::pool_holder_offset_in_bytes(), Robj_to_lock); |
|
889 __ ld(Robj_to_lock, mirror_offset, Robj_to_lock); |
|
890 |
886 |
891 __ bind(Ldone); |
887 __ bind(Ldone); |
892 __ verify_oop(Robj_to_lock); |
888 __ verify_oop(Robj_to_lock); |
893 } |
889 } |
894 |
890 |
1049 __ std(R12_scratch2, _abi(lr), R1_SP); |
1045 __ std(R12_scratch2, _abi(lr), R1_SP); |
1050 |
1046 |
1051 __ addi(R26_monitor, R1_SP, - frame::ijava_state_size); |
1047 __ addi(R26_monitor, R1_SP, - frame::ijava_state_size); |
1052 __ addi(R15_esp, R26_monitor, - Interpreter::stackElementSize); |
1048 __ addi(R15_esp, R26_monitor, - Interpreter::stackElementSize); |
1053 |
1049 |
|
1050 // Get mirror and store it in the frame as GC root for this Method* |
|
1051 __ load_mirror(R12_scratch2, R19_method); |
|
1052 |
1054 // Store values. |
1053 // Store values. |
1055 // R15_esp, R14_bcp, R26_monitor, R28_mdx are saved at java calls |
1054 // R15_esp, R14_bcp, R26_monitor, R28_mdx are saved at java calls |
1056 // in InterpreterMacroAssembler::call_from_interpreter. |
1055 // in InterpreterMacroAssembler::call_from_interpreter. |
1057 __ std(R19_method, _ijava_state_neg(method), R1_SP); |
1056 __ std(R19_method, _ijava_state_neg(method), R1_SP); |
|
1057 __ std(R12_scratch2, _ijava_state_neg(mirror), R1_SP); |
1058 __ std(R21_sender_SP, _ijava_state_neg(sender_sp), R1_SP); |
1058 __ std(R21_sender_SP, _ijava_state_neg(sender_sp), R1_SP); |
1059 __ std(R27_constPoolCache, _ijava_state_neg(cpoolCache), R1_SP); |
1059 __ std(R27_constPoolCache, _ijava_state_neg(cpoolCache), R1_SP); |
1060 __ std(R18_locals, _ijava_state_neg(locals), R1_SP); |
1060 __ std(R18_locals, _ijava_state_neg(locals), R1_SP); |
1061 |
1061 |
1062 // Note: esp, bcp, monitor, mdx live in registers. Hence, the correct version can only |
1062 // Note: esp, bcp, monitor, mdx live in registers. Hence, the correct version can only |
1317 |
1317 |
1318 // Restore access flags. |
1318 // Restore access flags. |
1319 __ testbitdi(CCR0, R0, access_flags, JVM_ACC_STATIC_BIT); |
1319 __ testbitdi(CCR0, R0, access_flags, JVM_ACC_STATIC_BIT); |
1320 __ bfalse(CCR0, method_is_not_static); |
1320 __ bfalse(CCR0, method_is_not_static); |
1321 |
1321 |
1322 // constants = method->constants(); |
1322 __ load_mirror(R12_sratch2, R19_method); |
1323 __ ld(R11_scratch1, in_bytes(Method::const_offset()), R19_method); |
|
1324 __ ld(R11_scratch1, in_bytes(ConstMethod::constants_offset()), R11_scratch1); |
|
1325 // pool_holder = method->constants()->pool_holder(); |
|
1326 __ ld(R11_scratch1/*pool_holder*/, ConstantPool::pool_holder_offset_in_bytes(), |
|
1327 R11_scratch1/*constants*/); |
|
1328 |
|
1329 const int mirror_offset = in_bytes(Klass::java_mirror_offset()); |
|
1330 |
|
1331 // mirror = pool_holder->klass_part()->java_mirror(); |
|
1332 __ ld(R0/*mirror*/, mirror_offset, R11_scratch1/*pool_holder*/); |
|
1333 // state->_native_mirror = mirror; |
1323 // state->_native_mirror = mirror; |
1334 |
1324 |
1335 __ ld(R11_scratch1, 0, R1_SP); |
1325 __ ld(R11_scratch1, 0, R1_SP); |
1336 __ std(R0/*mirror*/, _ijava_state_neg(oop_tmp), R11_scratch1); |
1326 __ std(R12_scratch2/*mirror*/, _ijava_state_neg(oop_tmp), R11_scratch1); |
1337 // R4_ARG2 = &state->_oop_temp; |
1327 // R4_ARG2 = &state->_oop_temp; |
1338 __ addi(R4_ARG2, R11_scratch1, _ijava_state_neg(oop_tmp)); |
1328 __ addi(R4_ARG2, R11_scratch1, _ijava_state_neg(oop_tmp)); |
1339 BIND(method_is_not_static); |
1329 BIND(method_is_not_static); |
1340 } |
1330 } |
1341 |
1331 |