Chromium Code Reviews| Index: src/arm64/lithium-codegen-arm64.h |
| diff --git a/src/arm64/lithium-codegen-arm64.h b/src/arm64/lithium-codegen-arm64.h |
| index f4213051870e05e2f2589c07d2a2ae629dcd61a5..a4f6d57d96d81094eb0124311d2e5f295a38419d 100644 |
| --- a/src/arm64/lithium-codegen-arm64.h |
| +++ b/src/arm64/lithium-codegen-arm64.h |
| @@ -377,14 +377,23 @@ class LCodeGen: public LCodeGenBase { |
| ASSERT(codegen_->expected_safepoint_kind_ == Safepoint::kSimple); |
| codegen_->expected_safepoint_kind_ = kind; |
| + UseScratchRegisterScope temps(codegen_->masm_); |
| + // Preserve the value of lr which must be saved on the stack (the call to |
| + // the stub will clobber it). |
| + Register to_be_pushed_lr = |
| + temps.Acquire(StoreRegistersStateStub::to_be_pushed_lr()); |
| + codegen_->masm_->Mov(to_be_pushed_lr, lr); |
|
ulan
2014/03/24 11:09:25
to_be_pushed_lr is ip0, how do we guarantee that t
vincent.belliard
2014/03/24 11:16:59
This register is reserved by the UseScratchRegiste
ulan
2014/03/24 11:31:26
Right, and what if the ip0 is not available in the
vincent.belliard
2014/03/24 11:43:28
In debug, Acquire checks that the register is avai
ulan
2014/03/24 12:23:51
OK, thank you for explanation. I went through the
vincent.belliard
2014/03/24 16:03:52
done
|
| switch (codegen_->expected_safepoint_kind_) { |
| - case Safepoint::kWithRegisters: |
| - codegen_->masm_->PushSafepointRegisters(); |
| + case Safepoint::kWithRegisters: { |
| + StoreRegistersStateStub stub(kDontSaveFPRegs); |
| + codegen_->masm_->CallStub(&stub); |
| break; |
| - case Safepoint::kWithRegistersAndDoubles: |
| - codegen_->masm_->PushSafepointRegisters(); |
| - codegen_->masm_->PushSafepointFPRegisters(); |
| + } |
| + case Safepoint::kWithRegistersAndDoubles: { |
| + StoreRegistersStateStub stub(kSaveFPRegs); |
| + codegen_->masm_->CallStub(&stub); |
| break; |
| + } |
| default: |
| UNREACHABLE(); |
| } |
| @@ -394,13 +403,16 @@ class LCodeGen: public LCodeGenBase { |
| Safepoint::Kind kind = codegen_->expected_safepoint_kind_; |
| ASSERT((kind & Safepoint::kWithRegisters) != 0); |
| switch (kind) { |
| - case Safepoint::kWithRegisters: |
| - codegen_->masm_->PopSafepointRegisters(); |
| + case Safepoint::kWithRegisters: { |
| + RestoreRegistersStateStub stub(kDontSaveFPRegs); |
| + codegen_->masm_->CallStub(&stub); |
| break; |
| - case Safepoint::kWithRegistersAndDoubles: |
| - codegen_->masm_->PopSafepointFPRegisters(); |
| - codegen_->masm_->PopSafepointRegisters(); |
| + } |
| + case Safepoint::kWithRegistersAndDoubles: { |
| + RestoreRegistersStateStub stub(kSaveFPRegs); |
| + codegen_->masm_->CallStub(&stub); |
| break; |
| + } |
| default: |
| UNREACHABLE(); |
| } |