[mips][deoptimizer][cleanup] Don't store values of single precision fp registers
port 556e485
https://crrev.com/c/1669687
Original Commit Message:
Instead of storing the values of the single precision floating point registers,
get their values from the aliased double precision registers.
This saves, on arm64, 184 bytes per deoptimisation kind function (552 in total)
and 128 bytes in the RegisterValues class.
Change-Id: Ic178de717d27a63b3f510b3a93e8f33a1730dc8b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1725669
Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Yu Yin <xwafish@gmail.com>
Cr-Commit-Position: refs/heads/master@{#62998}
This commit is contained in:
parent
cfc1573727
commit
c2f18318f2
@ -30,7 +30,6 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
RegList saved_regs = restored_regs | sp.bit() | ra.bit();
|
||||
|
||||
const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kNumRegisters;
|
||||
const int kFloatRegsSize = kFloatSize * FloatRegister::kNumRegisters;
|
||||
|
||||
// Save all FPU registers before messing with them.
|
||||
__ Subu(sp, sp, Operand(kDoubleRegsSize));
|
||||
@ -42,14 +41,6 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
__ Sdc1(fpu_reg, MemOperand(sp, offset));
|
||||
}
|
||||
|
||||
__ Subu(sp, sp, Operand(kFloatRegsSize));
|
||||
for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
|
||||
int code = config->GetAllocatableFloatCode(i);
|
||||
const FloatRegister fpu_reg = FloatRegister::from_code(code);
|
||||
int offset = code * kFloatSize;
|
||||
__ swc1(fpu_reg, MemOperand(sp, offset));
|
||||
}
|
||||
|
||||
// Push saved_regs (needed to populate FrameDescription::registers_).
|
||||
// Leave gaps for other registers.
|
||||
__ Subu(sp, sp, kNumberOfRegisters * kPointerSize);
|
||||
@ -64,7 +55,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
__ sw(fp, MemOperand(a2));
|
||||
|
||||
const int kSavedRegistersAreaSize =
|
||||
(kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
|
||||
(kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
|
||||
|
||||
// Get the bailout id is passed as kRootRegister by the caller.
|
||||
__ mov(a2, kRootRegister);
|
||||
@ -123,22 +114,11 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
int code = config->GetAllocatableDoubleCode(i);
|
||||
int dst_offset = code * kDoubleSize + double_regs_offset;
|
||||
int src_offset =
|
||||
code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
|
||||
code * kDoubleSize + kNumberOfRegisters * kPointerSize;
|
||||
__ Ldc1(f0, MemOperand(sp, src_offset));
|
||||
__ Sdc1(f0, MemOperand(a1, dst_offset));
|
||||
}
|
||||
|
||||
// Copy FPU registers to
|
||||
// float_registers_[FloatRegister::kNumAllocatableRegisters]
|
||||
int float_regs_offset = FrameDescription::float_registers_offset();
|
||||
for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
|
||||
int code = config->GetAllocatableFloatCode(i);
|
||||
int dst_offset = code * kFloatSize + float_regs_offset;
|
||||
int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
|
||||
__ lwc1(f0, MemOperand(sp, src_offset));
|
||||
__ swc1(f0, MemOperand(a1, dst_offset));
|
||||
}
|
||||
|
||||
// Remove the saved registers from the stack.
|
||||
__ Addu(sp, sp, Operand(kSavedRegistersAreaSize));
|
||||
|
||||
|
@ -30,7 +30,6 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
RegList saved_regs = restored_regs | sp.bit() | ra.bit();
|
||||
|
||||
const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kNumRegisters;
|
||||
const int kFloatRegsSize = kFloatSize * FloatRegister::kNumRegisters;
|
||||
|
||||
// Save all double FPU registers before messing with them.
|
||||
__ Dsubu(sp, sp, Operand(kDoubleRegsSize));
|
||||
@ -42,15 +41,6 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
__ Sdc1(fpu_reg, MemOperand(sp, offset));
|
||||
}
|
||||
|
||||
// Save all float FPU registers before messing with them.
|
||||
__ Dsubu(sp, sp, Operand(kFloatRegsSize));
|
||||
for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
|
||||
int code = config->GetAllocatableFloatCode(i);
|
||||
const FloatRegister fpu_reg = FloatRegister::from_code(code);
|
||||
int offset = code * kFloatSize;
|
||||
__ Swc1(fpu_reg, MemOperand(sp, offset));
|
||||
}
|
||||
|
||||
// Push saved_regs (needed to populate FrameDescription::registers_).
|
||||
// Leave gaps for other registers.
|
||||
__ Dsubu(sp, sp, kNumberOfRegisters * kPointerSize);
|
||||
@ -65,7 +55,7 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
__ Sd(fp, MemOperand(a2));
|
||||
|
||||
const int kSavedRegistersAreaSize =
|
||||
(kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize;
|
||||
(kNumberOfRegisters * kPointerSize) + kDoubleRegsSize;
|
||||
|
||||
// Get the bailout is passed as kRootRegister by the caller.
|
||||
__ mov(a2, kRootRegister);
|
||||
@ -125,22 +115,11 @@ void Deoptimizer::GenerateDeoptimizationEntries(MacroAssembler* masm,
|
||||
int code = config->GetAllocatableDoubleCode(i);
|
||||
int dst_offset = code * kDoubleSize + double_regs_offset;
|
||||
int src_offset =
|
||||
code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize;
|
||||
code * kDoubleSize + kNumberOfRegisters * kPointerSize;
|
||||
__ Ldc1(f0, MemOperand(sp, src_offset));
|
||||
__ Sdc1(f0, MemOperand(a1, dst_offset));
|
||||
}
|
||||
|
||||
int float_regs_offset = FrameDescription::float_registers_offset();
|
||||
// Copy FPU registers to
|
||||
// float_registers_[FloatRegister::kNumAllocatableRegisters]
|
||||
for (int i = 0; i < config->num_allocatable_float_registers(); ++i) {
|
||||
int code = config->GetAllocatableFloatCode(i);
|
||||
int dst_offset = code * kFloatSize + float_regs_offset;
|
||||
int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize;
|
||||
__ Lwc1(f0, MemOperand(sp, src_offset));
|
||||
__ Swc1(f0, MemOperand(a1, dst_offset));
|
||||
}
|
||||
|
||||
// Remove the saved registers from the stack.
|
||||
__ Daddu(sp, sp, Operand(kSavedRegistersAreaSize));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user