Skip to content

Commit

Permalink
Bug 1944011 - Part 42: Combine LUnboxBase and LUnbox. r=iain
Browse files Browse the repository at this point in the history
Both classes can be merged after part 41.

Differential Revision: https://phabricator.services.mozilla.com/D235855
  • Loading branch information
anba committed Jan 31, 2025
1 parent 62985a9 commit e938cad
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 40 deletions.
15 changes: 4 additions & 11 deletions js/src/jit/arm64/LIR-arm64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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()); }
};

Expand Down
6 changes: 0 additions & 6 deletions js/src/jit/loong64/LIR-loong64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 0 additions & 6 deletions js/src/jit/mips64/LIR-mips64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
6 changes: 0 additions & 6 deletions js/src/jit/riscv64/LIR-riscv64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
15 changes: 4 additions & 11 deletions js/src/jit/x64/LIR-x64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand All @@ -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()); }
};

Expand Down

0 comments on commit e938cad

Please sign in to comment.