< prev index next >

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Print this page

6784 #endif
6785 }
6786 
6787 #ifndef PRODUCT
6788 void MacroAssembler::verify_cross_modify_fence_not_required() {
6789   if (VerifyCrossModifyFence) {
6790     // Check if thread needs a cross modify fence.
6791     ldrb(rscratch1, Address(rthread, in_bytes(JavaThread::requires_cross_modify_fence_offset())));
6792     Label fence_not_required;
6793     cbz(rscratch1, fence_not_required);
6794     // If it does then fail.
6795     lea(rscratch1, RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::verify_cross_modify_fence_failure)));
6796     mov(c_rarg0, rthread);
6797     blr(rscratch1);
6798     bind(fence_not_required);
6799   }
6800 }
6801 #endif
6802 
6803 void MacroAssembler::spin_wait() {

6804   for (int i = 0; i < VM_Version::spin_wait_desc().inst_count(); ++i) {
6805     switch (VM_Version::spin_wait_desc().inst()) {
6806       case SpinWait::NOP:
6807         nop();
6808         break;
6809       case SpinWait::ISB:
6810         isb();
6811         break;
6812       case SpinWait::YIELD:
6813         yield();
6814         break;




6815       default:
6816         ShouldNotReachHere();
6817     }
6818   }

6819 }
6820 
6821 // Stack frame creation/removal
6822 
6823 void MacroAssembler::enter(bool strip_ret_addr) {
6824   if (strip_ret_addr) {
6825     // Addresses can only be signed once. If there are multiple nested frames being created
6826     // in the same function, then the return address needs stripping first.
6827     strip_return_address();
6828   }
6829   protect_return_address();
6830   stp(rfp, lr, Address(pre(sp, -2 * wordSize)));
6831   mov(rfp, sp);
6832 }
6833 
6834 void MacroAssembler::leave() {
6835   mov(sp, rfp);
6836   ldp(rfp, lr, Address(post(sp, 2 * wordSize)));
6837   authenticate_return_address();
6838 }

6784 #endif
6785 }
6786 
6787 #ifndef PRODUCT
6788 void MacroAssembler::verify_cross_modify_fence_not_required() {
6789   if (VerifyCrossModifyFence) {
6790     // Check if thread needs a cross modify fence.
6791     ldrb(rscratch1, Address(rthread, in_bytes(JavaThread::requires_cross_modify_fence_offset())));
6792     Label fence_not_required;
6793     cbz(rscratch1, fence_not_required);
6794     // If it does then fail.
6795     lea(rscratch1, RuntimeAddress(CAST_FROM_FN_PTR(address, JavaThread::verify_cross_modify_fence_failure)));
6796     mov(c_rarg0, rthread);
6797     blr(rscratch1);
6798     bind(fence_not_required);
6799   }
6800 }
6801 #endif
6802 
6803 void MacroAssembler::spin_wait() {
6804   block_comment("spin_wait {");
6805   for (int i = 0; i < VM_Version::spin_wait_desc().inst_count(); ++i) {
6806     switch (VM_Version::spin_wait_desc().inst()) {
6807       case SpinWait::NOP:
6808         nop();
6809         break;
6810       case SpinWait::ISB:
6811         isb();
6812         break;
6813       case SpinWait::YIELD:
6814         yield();
6815         break;
6816       case SpinWait::SB:
6817         assert(VM_Version::supports_sb(), "current CPU does not support SB instruction");
6818         sb();
6819         break;
6820       default:
6821         ShouldNotReachHere();
6822     }
6823   }
6824   block_comment("}");
6825 }
6826 
6827 // Stack frame creation/removal
6828 
6829 void MacroAssembler::enter(bool strip_ret_addr) {
6830   if (strip_ret_addr) {
6831     // Addresses can only be signed once. If there are multiple nested frames being created
6832     // in the same function, then the return address needs stripping first.
6833     strip_return_address();
6834   }
6835   protect_return_address();
6836   stp(rfp, lr, Address(pre(sp, -2 * wordSize)));
6837   mov(rfp, sp);
6838 }
6839 
6840 void MacroAssembler::leave() {
6841   mov(sp, rfp);
6842   ldp(rfp, lr, Address(post(sp, 2 * wordSize)));
6843   authenticate_return_address();
6844 }
< prev index next >