Commit fbd1d1ad authored by Jaideep Bajwa's avatar Jaideep Bajwa Committed by Commit Bot

PPC: Fix register corruption

Fix register corruption and save constant pool register.

R=joransiu@ca.ibm.com, jyan@ca.ibm.com
BUG=
LOG=N

Change-Id: I278b7f9a60e10c5347cdfba52432837f68c82836
Reviewed-on: https://chromium-review.googlesource.com/649812
Commit-Queue: Junliang Yan <jyan@ca.ibm.com>
Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#47832}
parent 43bb2778
......@@ -230,6 +230,9 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
Builtins::CallableFor(__ isolate(), Builtins::kRecordWrite);
RegList registers = callable.descriptor().allocatable_registers();
if (FLAG_enable_embedded_constant_pool) {
registers |= kConstantPoolRegister.bit();
}
SaveRegisters(registers);
__ mflr(scratch0_);
__ Push(scratch0_);
......@@ -262,8 +265,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
frame()->DidAllocateDoubleRegisters() ? kSaveFPRegs : kDontSaveFPRegs;
if (must_save_lr_) {
// We need to save and restore lr if the frame was elided.
__ mflr(scratch1_);
__ Push(scratch1_);
__ mflr(scratch0_);
__ Push(scratch0_);
}
if (must_save_lr_ && FLAG_enable_embedded_constant_pool) {
ConstantPoolUnavailableScope constant_pool_unavailable(tasm());
......@@ -277,8 +280,8 @@ class OutOfLineRecordWrite final : public OutOfLineCode {
}
if (must_save_lr_) {
// We need to save and restore lr if the frame was elided.
__ Pop(scratch1_);
__ mtlr(scratch1_);
__ Pop(scratch0_);
__ mtlr(scratch0_);
}
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment