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