Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index 9ebaaa94cc66212a9f06e9bd44df9eb21f9ff2c5..48e42c85ca51e27b489eb8ffe47c3df936fdc957 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -1446,15 +1446,17 @@ void MacroAssembler::Pushad() { |
// r15 is kSmiConstantRegister |
STATIC_ASSERT(11 == kNumSafepointSavedRegisters); |
// Use lea for symmetry with Popad. |
- lea(rsp, Operand(rsp, |
- -(kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); |
+ int sp_delta = |
+ (kNumSafepointRegisters - kNumSafepointSavedRegisters) * kPointerSize; |
+ lea(rsp, Operand(rsp, -sp_delta)); |
} |
void MacroAssembler::Popad() { |
// Popad must not change the flags, so use lea instead of addq. |
- lea(rsp, Operand(rsp, |
- (kNumSafepointRegisters-kNumSafepointSavedRegisters) * kPointerSize)); |
+ int sp_delta = |
+ (kNumSafepointRegisters - kNumSafepointSavedRegisters) * kPointerSize; |
+ lea(rsp, Operand(rsp, sp_delta)); |
pop(r14); |
pop(r12); |
pop(r11); |
@@ -1496,6 +1498,16 @@ int MacroAssembler::kSafepointPushRegisterIndices[Register::kNumRegisters] = { |
}; |
+void MacroAssembler::StoreToSafepointRegisterSlot(Register dst, Register src) { |
+ movq(SafepointRegisterSlot(dst), src); |
+} |
+ |
+ |
+Operand MacroAssembler::SafepointRegisterSlot(Register reg) { |
+ return Operand(rsp, SafepointRegisterStackIndex(reg.code()) * kPointerSize); |
+} |
+ |
+ |
void MacroAssembler::PushTryHandler(CodeLocation try_location, |
HandlerType type) { |
// Adjust this code if not the case. |