From e938cad3c79fc68b6f245e7958e692d092d19aae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Fri, 31 Jan 2025 08:57:26 +0000 Subject: [PATCH] Bug 1944011 - Part 42: Combine LUnboxBase and LUnbox. r=iain Both classes can be merged after part 41. Differential Revision: https://phabricator.services.mozilla.com/D235855 --- js/src/jit/arm64/LIR-arm64.h | 15 ++++----------- js/src/jit/loong64/LIR-loong64.h | 6 ------ js/src/jit/mips64/LIR-mips64.h | 6 ------ js/src/jit/riscv64/LIR-riscv64.h | 6 ------ js/src/jit/x64/LIR-x64.h | 15 ++++----------- 5 files changed, 8 insertions(+), 40 deletions(-) diff --git a/js/src/jit/arm64/LIR-arm64.h b/js/src/jit/arm64/LIR-arm64.h index a8bc51a6d0363..20a0ba6e57397 100644 --- a/js/src/jit/arm64/LIR-arm64.h +++ b/js/src/jit/arm64/LIR-arm64.h @@ -10,10 +10,11 @@ namespace js { namespace jit { -class LUnboxBase : public LInstructionHelper<1, BOX_PIECES, 0> { +class LUnbox : public LInstructionHelper<1, BOX_PIECES, 0> { public: - LUnboxBase(LNode::Opcode opcode, const LAllocation& input) - : LInstructionHelper(opcode) { + LIR_HEADER(Unbox); + + explicit LUnbox(const LAllocation& input) : LInstructionHelper(classOpcode) { setOperand(0, input); } @@ -22,14 +23,6 @@ class LUnboxBase : public LInstructionHelper<1, BOX_PIECES, 0> { LBoxAllocation input() const { return getBoxOperand(Input); } MUnbox* mir() const { return mir_->toUnbox(); } -}; - -class LUnbox : public LUnboxBase { - public: - LIR_HEADER(Unbox); - - explicit LUnbox(const LAllocation& input) : LUnboxBase(classOpcode, input) {} - const char* extraName() const { return StringFromMIRType(mir()->type()); } }; diff --git a/js/src/jit/loong64/LIR-loong64.h b/js/src/jit/loong64/LIR-loong64.h index 2a5c5f5d32cb0..eb5796db428e8 100644 --- a/js/src/jit/loong64/LIR-loong64.h +++ b/js/src/jit/loong64/LIR-loong64.h @@ -11,12 +11,6 @@ namespace js { namespace jit { class LUnbox : public LInstructionHelper<1, BOX_PIECES, 0> { - protected: - LUnbox(LNode::Opcode opcode, const LAllocation& input) - : LInstructionHelper(opcode) { - setOperand(0, input); - } - public: LIR_HEADER(Unbox); diff --git a/js/src/jit/mips64/LIR-mips64.h b/js/src/jit/mips64/LIR-mips64.h index aff764390421d..5a8d88215539a 100644 --- a/js/src/jit/mips64/LIR-mips64.h +++ b/js/src/jit/mips64/LIR-mips64.h @@ -11,12 +11,6 @@ namespace js { namespace jit { class LUnbox : public LInstructionHelper<1, BOX_PIECES, 0> { - protected: - LUnbox(LNode::Opcode opcode, const LAllocation& input) - : LInstructionHelper(opcode) { - setOperand(0, input); - } - public: LIR_HEADER(Unbox); diff --git a/js/src/jit/riscv64/LIR-riscv64.h b/js/src/jit/riscv64/LIR-riscv64.h index babed9c7407c3..fc1df8637076a 100644 --- a/js/src/jit/riscv64/LIR-riscv64.h +++ b/js/src/jit/riscv64/LIR-riscv64.h @@ -11,12 +11,6 @@ namespace js { namespace jit { class LUnbox : public LInstructionHelper<1, BOX_PIECES, 0> { - protected: - LUnbox(LNode::Opcode opcode, const LAllocation& input) - : LInstructionHelper(opcode) { - setOperand(0, input); - } - public: LIR_HEADER(Unbox); diff --git a/js/src/jit/x64/LIR-x64.h b/js/src/jit/x64/LIR-x64.h index 1792a75addb28..10809502f586d 100644 --- a/js/src/jit/x64/LIR-x64.h +++ b/js/src/jit/x64/LIR-x64.h @@ -12,10 +12,11 @@ namespace jit { // Given an untyped input, guards on whether it's a specific type and returns // the unboxed payload. -class LUnboxBase : public LInstructionHelper<1, BOX_PIECES, 0> { +class LUnbox : public LInstructionHelper<1, BOX_PIECES, 0> { public: - LUnboxBase(LNode::Opcode op, const LAllocation& input) - : LInstructionHelper<1, 1, 0>(op) { + LIR_HEADER(Unbox) + + explicit LUnbox(const LAllocation& input) : LInstructionHelper(classOpcode) { setOperand(0, input); } @@ -24,14 +25,6 @@ class LUnboxBase : public LInstructionHelper<1, BOX_PIECES, 0> { LBoxAllocation input() const { return getBoxOperand(Input); } MUnbox* mir() const { return mir_->toUnbox(); } -}; - -class LUnbox : public LUnboxBase { - public: - LIR_HEADER(Unbox) - - explicit LUnbox(const LAllocation& input) : LUnboxBase(classOpcode, input) {} - const char* extraName() const { return StringFromMIRType(mir()->type()); } };