< prev index next >

src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp

Print this page

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

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




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

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

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