3018 }
3019
3020 load_const(tmp1, (long) os::get_memory_serialize_page());
3021 release();
3022 stwx(R0, tmp1, tmp2);
3023 }
3024
3025 void MacroAssembler::safepoint_poll(Label& slow_path, Register temp_reg) {
3026 if (SafepointMechanism::uses_thread_local_poll()) {
3027 ld(temp_reg, in_bytes(Thread::polling_page_offset()), R16_thread);
3028 // Armed page has poll_bit set.
3029 andi_(temp_reg, temp_reg, SafepointMechanism::poll_bit());
3030 } else {
3031 lwz(temp_reg, (RegisterOrConstant)(intptr_t)SafepointSynchronize::address_of_state());
3032 cmpwi(CCR0, temp_reg, SafepointSynchronize::_not_synchronized);
3033 }
3034 bne(CCR0, slow_path);
3035 }
3036
3037 void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame) {
3038 BarrierSetAssembler* bs = Universe::heap()->barrier_set()->barrier_set_assembler();
3039 bs->resolve_jobject(this, value, tmp1, tmp2, needs_frame);
3040 }
3041
3042 // Values for last_Java_pc, and last_Java_sp must comply to the rules
3043 // in frame_ppc.hpp.
3044 void MacroAssembler::set_last_Java_frame(Register last_Java_sp, Register last_Java_pc) {
3045 // Always set last_Java_pc and flags first because once last_Java_sp
3046 // is visible has_last_Java_frame is true and users will look at the
3047 // rest of the fields. (Note: flags should always be zero before we
3048 // get here so doesn't need to be set.)
3049
3050 // Verify that last_Java_pc was zeroed on return to Java
3051 asm_assert_mem8_is_zero(in_bytes(JavaThread::last_Java_pc_offset()), R16_thread,
3052 "last_Java_pc not zeroed before leaving Java", 0x200);
3053
3054 // When returning from calling out from Java mode the frame anchor's
3055 // last_Java_pc will always be set to NULL. It is set here so that
3056 // if we are doing a call to native (not VM) that we capture the
3057 // known pc and don't have to rely on the native call having a
3058 // standard frame linkage where we can find the pc.
|
3018 }
3019
3020 load_const(tmp1, (long) os::get_memory_serialize_page());
3021 release();
3022 stwx(R0, tmp1, tmp2);
3023 }
3024
3025 void MacroAssembler::safepoint_poll(Label& slow_path, Register temp_reg) {
3026 if (SafepointMechanism::uses_thread_local_poll()) {
3027 ld(temp_reg, in_bytes(Thread::polling_page_offset()), R16_thread);
3028 // Armed page has poll_bit set.
3029 andi_(temp_reg, temp_reg, SafepointMechanism::poll_bit());
3030 } else {
3031 lwz(temp_reg, (RegisterOrConstant)(intptr_t)SafepointSynchronize::address_of_state());
3032 cmpwi(CCR0, temp_reg, SafepointSynchronize::_not_synchronized);
3033 }
3034 bne(CCR0, slow_path);
3035 }
3036
3037 void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame) {
3038 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
3039 bs->resolve_jobject(this, value, tmp1, tmp2, needs_frame);
3040 }
3041
3042 // Values for last_Java_pc, and last_Java_sp must comply to the rules
3043 // in frame_ppc.hpp.
3044 void MacroAssembler::set_last_Java_frame(Register last_Java_sp, Register last_Java_pc) {
3045 // Always set last_Java_pc and flags first because once last_Java_sp
3046 // is visible has_last_Java_frame is true and users will look at the
3047 // rest of the fields. (Note: flags should always be zero before we
3048 // get here so doesn't need to be set.)
3049
3050 // Verify that last_Java_pc was zeroed on return to Java
3051 asm_assert_mem8_is_zero(in_bytes(JavaThread::last_Java_pc_offset()), R16_thread,
3052 "last_Java_pc not zeroed before leaving Java", 0x200);
3053
3054 // When returning from calling out from Java mode the frame anchor's
3055 // last_Java_pc will always be set to NULL. It is set here so that
3056 // if we are doing a call to native (not VM) that we capture the
3057 // known pc and don't have to rely on the native call having a
3058 // standard frame linkage where we can find the pc.
|