2187 __ addi(r_box, R1_SP, lock_offset);
2188
2189 # ifdef ASSERT
2190 if (UseBiasedLocking) {
2191 // Making the box point to itself will make it clear it went unused
2192 // but also be obviously invalid.
2193 __ std(r_box, 0, r_box);
2194 }
2195 # endif // ASSERT
2196
2197 // Try fastpath for locking.
2198 // fast_lock kills r_temp_1, r_temp_2, r_temp_3.
2199 __ compiler_fast_lock_object(r_flag, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
2200 __ beq(r_flag, locked);
2201
2202 // None of the above fast optimizations worked so we have to get into the
2203 // slow case of monitor enter. Inline a special case of call_VM that
2204 // disallows any pending_exception.
2205
2206 // Save argument registers and leave room for C-compatible ABI_REG_ARGS.
2207 int frame_size = frame::abi_reg_args_size +
2208 align_up(total_c_args * wordSize, frame::alignment_in_bytes);
2209 __ mr(R11_scratch1, R1_SP);
2210 RegisterSaver::push_frame_and_save_argument_registers(masm, R12_scratch2, frame_size, total_c_args, out_regs, out_regs2);
2211
2212 // Do the call.
2213 __ set_last_Java_frame(R11_scratch1, r_return_pc);
2214 assert(r_return_pc->is_nonvolatile(), "expecting return pc to be in non-volatile register");
2215 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_locking_C), r_oop, r_box, R16_thread);
2216 __ reset_last_Java_frame();
2217
2218 RegisterSaver::restore_argument_registers_and_pop_frame(masm, frame_size, total_c_args, out_regs, out_regs2);
2219
2220 __ asm_assert_mem8_is_zero(thread_(pending_exception),
2221 "no pending exception allowed on exit from SharedRuntime::complete_monitor_locking_C", 0);
2222
2223 __ bind(locked);
2224 }
2225
2226
2227 // Publish thread state
2228 // --------------------------------------------------------------------------
|
2187 __ addi(r_box, R1_SP, lock_offset);
2188
2189 # ifdef ASSERT
2190 if (UseBiasedLocking) {
2191 // Making the box point to itself will make it clear it went unused
2192 // but also be obviously invalid.
2193 __ std(r_box, 0, r_box);
2194 }
2195 # endif // ASSERT
2196
2197 // Try fastpath for locking.
2198 // fast_lock kills r_temp_1, r_temp_2, r_temp_3.
2199 __ compiler_fast_lock_object(r_flag, r_oop, r_box, r_temp_1, r_temp_2, r_temp_3);
2200 __ beq(r_flag, locked);
2201
2202 // None of the above fast optimizations worked so we have to get into the
2203 // slow case of monitor enter. Inline a special case of call_VM that
2204 // disallows any pending_exception.
2205
2206 // Save argument registers and leave room for C-compatible ABI_REG_ARGS.
2207 int frame_size = frame::abi_reg_args_size + align_up(total_c_args * wordSize, frame::alignment_in_bytes);
2208 __ mr(R11_scratch1, R1_SP);
2209 RegisterSaver::push_frame_and_save_argument_registers(masm, R12_scratch2, frame_size, total_c_args, out_regs, out_regs2);
2210
2211 // Do the call.
2212 __ set_last_Java_frame(R11_scratch1, r_return_pc);
2213 assert(r_return_pc->is_nonvolatile(), "expecting return pc to be in non-volatile register");
2214 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_locking_C), r_oop, r_box, R16_thread);
2215 __ reset_last_Java_frame();
2216
2217 RegisterSaver::restore_argument_registers_and_pop_frame(masm, frame_size, total_c_args, out_regs, out_regs2);
2218
2219 __ asm_assert_mem8_is_zero(thread_(pending_exception),
2220 "no pending exception allowed on exit from SharedRuntime::complete_monitor_locking_C", 0);
2221
2222 __ bind(locked);
2223 }
2224
2225
2226 // Publish thread state
2227 // --------------------------------------------------------------------------
|