Index: src/arm64/code-stubs-arm64.cc |
diff --git a/src/arm64/code-stubs-arm64.cc b/src/arm64/code-stubs-arm64.cc |
index 61b395fb92db2b683960bd91622fec40590ee27f..b512e4259a374a39a91399f4e2c073e01b4189d2 100644 |
--- a/src/arm64/code-stubs-arm64.cc |
+++ b/src/arm64/code-stubs-arm64.cc |
@@ -1133,6 +1133,39 @@ void StoreBufferOverflowStub::GenerateFixedRegStubsAheadOfTime( |
} |
+void StoreRegistersStateStub::Generate(MacroAssembler* masm) { |
+ MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); |
+ UseScratchRegisterScope temps(masm); |
+ Register saved_lr = temps.UnsafeAcquire(to_be_pushed_lr()); |
+ Register return_address = temps.AcquireX(); |
+ __ Mov(return_address, lr); |
+ // Restore lr with the value it had before the call to this stub (the value |
+ // which must be pushed). |
+ __ Mov(lr, saved_lr); |
+ if (save_doubles_ == kSaveFPRegs) { |
+ __ PushSafepointRegistersAndDoubles(); |
+ } else { |
+ __ PushSafepointRegisters(); |
+ } |
+ __ Ret(return_address); |
+} |
+ |
+ |
+void RestoreRegistersStateStub::Generate(MacroAssembler* masm) { |
+ MacroAssembler::NoUseRealAbortsScope no_use_real_aborts(masm); |
+ UseScratchRegisterScope temps(masm); |
+ Register return_address = temps.AcquireX(); |
+ // Preserve the return address (lr will be clobbered by the pop). |
+ __ Mov(return_address, lr); |
+ if (save_doubles_ == kSaveFPRegs) { |
+ __ PopSafepointRegistersAndDoubles(); |
+ } else { |
+ __ PopSafepointRegisters(); |
+ } |
+ __ Ret(return_address); |
+} |
+ |
+ |
void MathPowStub::Generate(MacroAssembler* masm) { |
// Stack on entry: |
// jssp[0]: Exponent (as a tagged value). |
@@ -1394,10 +1427,28 @@ void CodeStub::GenerateStubsAheadOfTime(Isolate* isolate) { |
ArrayConstructorStubBase::GenerateStubsAheadOfTime(isolate); |
CreateAllocationSiteStub::GenerateAheadOfTime(isolate); |
BinaryOpICStub::GenerateAheadOfTime(isolate); |
+ StoreRegistersStateStub::GenerateAheadOfTime(isolate); |
+ RestoreRegistersStateStub::GenerateAheadOfTime(isolate); |
BinaryOpICWithAllocationSiteStub::GenerateAheadOfTime(isolate); |
} |
+void StoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) { |
+ StoreRegistersStateStub stub1(kDontSaveFPRegs); |
+ stub1.GetCode(isolate); |
+ StoreRegistersStateStub stub2(kSaveFPRegs); |
+ stub2.GetCode(isolate); |
+} |
+ |
+ |
+void RestoreRegistersStateStub::GenerateAheadOfTime(Isolate* isolate) { |
+ RestoreRegistersStateStub stub1(kDontSaveFPRegs); |
+ stub1.GetCode(isolate); |
+ RestoreRegistersStateStub stub2(kSaveFPRegs); |
+ stub2.GetCode(isolate); |
+} |
+ |
+ |
void CodeStub::GenerateFPStubs(Isolate* isolate) { |
// Floating-point code doesn't get special handling in ARM64, so there's |
// nothing to do here. |