Commit 19741114 authored by Liu Yu's avatar Liu Yu Committed by Commit Bot

[mips][wasm] Avoid duplicating parameter lists

Port: 679af80e

Bug: v8:11377
Change-Id: I65902d260f72a33e816dfec6f6435e55d2fbd306
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2725673
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#73088}
parent acddd72a
...@@ -2299,15 +2299,23 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { ...@@ -2299,15 +2299,23 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
// Save all parameter registers (see wasm-linkage.h). They might be // Save all parameter registers (see wasm-linkage.h). They might be
// overwritten in the runtime call below. We don't have any callee-saved // overwritten in the runtime call below. We don't have any callee-saved
// registers in wasm, so no need to store anything else. // registers in wasm, so no need to store anything else.
constexpr RegList gp_regs = Register::ListOf(a0, a2, a3); RegList gp_regs = 0;
constexpr RegList fp_regs = for (Register gp_param_reg : wasm::kGpParamRegisters) {
DoubleRegister::ListOf(f2, f4, f6, f8, f10, f12, f14); gp_regs |= gp_param_reg.bit();
constexpr int16_t num_to_push = base::bits::CountPopulation(gp_regs) + }
base::bits::CountPopulation(fp_regs);
// The number of regs to be pushed before kWasmInstanceRegister should be RegList fp_regs = 0;
// equal to kNumberOfSavedAllParamRegs. for (DoubleRegister fp_param_reg : wasm::kFpParamRegisters) {
STATIC_ASSERT(num_to_push == fp_regs |= fp_param_reg.bit();
WasmCompileLazyFrameConstants::kNumberOfSavedAllParamRegs); }
CHECK_EQ(NumRegs(gp_regs), arraysize(wasm::kGpParamRegisters));
CHECK_EQ(NumRegs(fp_regs), arraysize(wasm::kFpParamRegisters));
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedGpParamRegs,
NumRegs(gp_regs));
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedFpParamRegs,
NumRegs(fp_regs));
__ MultiPush(gp_regs); __ MultiPush(gp_regs);
__ MultiPushFPU(fp_regs); __ MultiPushFPU(fp_regs);
......
...@@ -2363,16 +2363,23 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) { ...@@ -2363,16 +2363,23 @@ void Builtins::Generate_WasmCompileLazy(MacroAssembler* masm) {
// Save all parameter registers (see wasm-linkage.h). They might be // Save all parameter registers (see wasm-linkage.h). They might be
// overwritten in the runtime call below. We don't have any callee-saved // overwritten in the runtime call below. We don't have any callee-saved
// registers in wasm, so no need to store anything else. // registers in wasm, so no need to store anything else.
constexpr RegList gp_regs = RegList gp_regs = 0;
Register::ListOf(a0, a2, a3, a4, a5, a6, a7); for (Register gp_param_reg : wasm::kGpParamRegisters) {
constexpr RegList fp_regs = gp_regs |= gp_param_reg.bit();
DoubleRegister::ListOf(f2, f4, f6, f8, f10, f12, f14); }
constexpr int16_t num_to_push = base::bits::CountPopulation(gp_regs) +
base::bits::CountPopulation(fp_regs); RegList fp_regs = 0;
// The number of regs to be pushed before kWasmInstanceRegister should be for (DoubleRegister fp_param_reg : wasm::kFpParamRegisters) {
// equal to kNumberOfSavedAllParamRegs. fp_regs |= fp_param_reg.bit();
STATIC_ASSERT(num_to_push == }
WasmCompileLazyFrameConstants::kNumberOfSavedAllParamRegs);
CHECK_EQ(NumRegs(gp_regs), arraysize(wasm::kGpParamRegisters));
CHECK_EQ(NumRegs(fp_regs), arraysize(wasm::kFpParamRegisters));
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedGpParamRegs,
NumRegs(gp_regs));
CHECK_EQ(WasmCompileLazyFrameConstants::kNumberOfSavedFpParamRegs,
NumRegs(fp_regs));
__ MultiPush(gp_regs); __ MultiPush(gp_regs);
// Check if machine has simd enabled, if so push vector registers. If not // Check if machine has simd enabled, if so push vector registers. If not
// then only push double registers. // then only push double registers.
......
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