Commit f4bf42dc authored by Ryan Hunt's avatar Ryan Hunt
Browse files

Bug 1748602 - Backout bug 1642412. r=lth

parent e8f83d20
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -8178,26 +8178,11 @@ void CodeGenerator::visitWasmStoreSlot(LWasmStoreSlot* ins) {
  }
}
void CodeGenerator::visitWasmLoadTableElement(LWasmLoadTableElement* ins) {
  Register elements = ToRegister(ins->elements());
  Register index = ToRegister(ins->index());
  Register output = ToRegister(ins->output());
  masm.loadPtr(BaseIndex(elements, index, ScalePointer), output);
}
void CodeGenerator::visitWasmDerivedPointer(LWasmDerivedPointer* ins) {
  masm.movePtr(ToRegister(ins->base()), ToRegister(ins->output()));
  masm.addPtr(Imm32(int32_t(ins->offset())), ToRegister(ins->output()));
}
void CodeGenerator::visitWasmDerivedIndexPointer(
    LWasmDerivedIndexPointer* ins) {
  Register base = ToRegister(ins->base());
  Register index = ToRegister(ins->index());
  Register output = ToRegister(ins->output());
  masm.computeEffectiveAddress(BaseIndex(base, index, ins->scale()), output);
}
void CodeGenerator::visitWasmStoreRef(LWasmStoreRef* ins) {
  Register tls = ToRegister(ins->tls());
  Register valueAddr = ToRegister(ins->valueAddr());
+0 −9
Original line number Diff line number Diff line
@@ -2723,18 +2723,9 @@
  arguments:
    offset: size_t

- name: WasmLoadTableElement
  result_type: WordSized
  operands:
    elements: WordSized
    index: WordSized

- name: WasmDerivedPointer
  gen_boilerplate: false

- name: WasmDerivedIndexPointer
  gen_boilerplate: false

- name: WasmStoreRef
  operands:
    tls: WordSized
+0 −12
Original line number Diff line number Diff line
@@ -5090,12 +5090,6 @@ void LIRGenerator::visitWasmLoadGlobalCell(MWasmLoadGlobalCell* ins) {
  }
}

void LIRGenerator::visitWasmLoadTableElement(MWasmLoadTableElement* ins) {
  LAllocation elements = useRegisterAtStart(ins->elements());
  LAllocation index = useRegisterAtStart(ins->index());
  define(new (alloc()) LWasmLoadTableElement(elements, index), ins);
}

void LIRGenerator::visitWasmStoreGlobalVar(MWasmStoreGlobalVar* ins) {
  MDefinition* value = ins->value();
  size_t offs = offsetof(wasm::TlsData, globalArea) + ins->globalDataOffset();
@@ -5158,12 +5152,6 @@ void LIRGenerator::visitWasmDerivedPointer(MWasmDerivedPointer* ins) {
  define(new (alloc()) LWasmDerivedPointer(base), ins);
}

void LIRGenerator::visitWasmDerivedIndexPointer(MWasmDerivedIndexPointer* ins) {
  LAllocation base = useRegisterAtStart(ins->base());
  LAllocation index = useRegisterAtStart(ins->index());
  define(new (alloc()) LWasmDerivedIndexPointer(base, index), ins);
}

void LIRGenerator::visitWasmStoreRef(MWasmStoreRef* ins) {
  LAllocation tls = useRegister(ins->tls());
  LAllocation valueAddr = useFixed(ins->valueAddr(), PreBarrierReg);
+6 −68
Original line number Diff line number Diff line
@@ -333,23 +333,21 @@ class AliasSet {
        1 << 9,                  // An array buffer view's length or byteOffset
    WasmGlobalCell = 1 << 10,    // A wasm global cell
    WasmTableElement = 1 << 11,  // An element of a wasm table
    WasmTableMeta = 1 << 12,     // A wasm table elements pointer and
                                 // length field, in Tls.
    WasmStackResult = 1 << 13,   // A stack result from the current function
    WasmStackResult = 1 << 12,   // A stack result from the current function

    // JSContext's exception state. This is used on instructions like MThrow
    // or MNewArrayDynamicLength that throw exceptions (other than OOM) but have
    // no other side effect, to ensure that they get their own up-to-date resume
    // point. (This resume point will be used when constructing the Baseline
    // frame during exception bailouts.)
    ExceptionState = 1 << 14,
    ExceptionState = 1 << 13,

    // Used for instructions that load the privateSlot of DOM proxies and
    // the ExpandoAndGeneration.
    DOMProxyExpando = 1 << 15,
    DOMProxyExpando = 1 << 14,

    // Hash table of a Map or Set object.
    MapOrSetHashTable = 1 << 16,
    MapOrSetHashTable = 1 << 15,

    // Internal state of the random number generator
    RNG = 1 << 16,
@@ -9024,8 +9022,6 @@ class MWasmLoadTls : public MUnaryInstruction, public NoTypePolicy::Data {
    // are allowed.
    MOZ_ASSERT(aliases_.flags() ==
                   AliasSet::Load(AliasSet::WasmHeapMeta).flags() ||
               aliases_.flags() ==
                   AliasSet::Load(AliasSet::WasmTableMeta).flags() ||
               aliases_.flags() ==
                   AliasSet::Load(AliasSet::WasmPendingException).flags() ||
               aliases_.flags() == AliasSet::None().flags());
@@ -9088,21 +9084,12 @@ class MWasmHeapBase : public MUnaryInstruction, public NoTypePolicy::Data {
// For memory64, bounds check nodes are always of type Int64.

class MWasmBoundsCheck : public MBinaryInstruction, public NoTypePolicy::Data {
 public:
  enum Target {
    Memory,
    Table,
  };

 private:
  wasm::BytecodeOffset bytecodeOffset_;
  Target target_;

  explicit MWasmBoundsCheck(MDefinition* index, MDefinition* boundsCheckLimit,
                            wasm::BytecodeOffset bytecodeOffset, Target target)
                            wasm::BytecodeOffset bytecodeOffset)
      : MBinaryInstruction(classOpcode, index, boundsCheckLimit),
        bytecodeOffset_(bytecodeOffset),
        target_(target) {
        bytecodeOffset_(bytecodeOffset) {
    MOZ_ASSERT(index->type() == boundsCheckLimit->type());

    // Bounds check is effectful: it throws for OOB.
@@ -9120,8 +9107,6 @@ class MWasmBoundsCheck : public MBinaryInstruction, public NoTypePolicy::Data {

  AliasSet getAliasSet() const override { return AliasSet::None(); }

  bool isMemory() const { return target_ == MWasmBoundsCheck::Memory; }

  bool isRedundant() const { return !isGuard(); }

  void setRedundant() { setNotGuard(); }
@@ -9596,21 +9581,6 @@ class MWasmLoadGlobalCell : public MUnaryInstruction,
  AliasType mightAlias(const MDefinition* def) const override;
};

class MWasmLoadTableElement : public MBinaryInstruction,
                              public NoTypePolicy::Data {
  MWasmLoadTableElement(MDefinition* elements, MDefinition* index)
      : MBinaryInstruction(classOpcode, elements, index) {
    setResultType(MIRType::RefOrNull);
    setMovable();
  }

 public:
  INSTRUCTION_HEADER(WasmLoadTableElement)
  TRIVIAL_NEW_WRAPPERS
  NAMED_OPERANDS((0, elements))
  NAMED_OPERANDS((1, index))
};

class MWasmStoreGlobalVar : public MBinaryInstruction,
                            public NoTypePolicy::Data {
  MWasmStoreGlobalVar(unsigned globalDataOffset, MDefinition* value,
@@ -9701,38 +9671,6 @@ class MWasmDerivedPointer : public MUnaryInstruction,
  ALLOW_CLONE(MWasmDerivedPointer)
};

class MWasmDerivedIndexPointer : public MBinaryInstruction,
                                 public NoTypePolicy::Data {
  MWasmDerivedIndexPointer(MDefinition* base, MDefinition* index, Scale scale)
      : MBinaryInstruction(classOpcode, base, index), scale_(scale) {
    setResultType(MIRType::Pointer);
    setMovable();
  }

  Scale scale_;

 public:
  INSTRUCTION_HEADER(WasmDerivedIndexPointer)
  TRIVIAL_NEW_WRAPPERS
  NAMED_OPERANDS((0, base))
  NAMED_OPERANDS((1, index))

  Scale scale() const { return scale_; }

  AliasSet getAliasSet() const override { return AliasSet::None(); }

  bool congruentTo(const MDefinition* ins) const override {
    return congruentIfOperandsEqual(ins) &&
           ins->toWasmDerivedIndexPointer()->scale() == scale();
  }

  ALLOW_CLONE(MWasmDerivedIndexPointer)
};

// Stores a reference to an address. This performs a pre-barrier on the address,
// but not a post-barrier. A post-barrier must be performed separately, if it's
// required.

class MWasmStoreRef : public MAryInstruction<3>, public NoTypePolicy::Data {
  AliasSet::Flag aliasSet_;

+0 −6
Original line number Diff line number Diff line
@@ -2605,9 +2605,6 @@
- name: WasmLoadGlobalCell
  gen_boilerplate: false

- name: WasmLoadTableElement
  gen_boilerplate: false

- name: WasmStoreGlobalVar
  gen_boilerplate: false

@@ -2620,9 +2617,6 @@
- name: WasmDerivedPointer
  gen_boilerplate: false

- name: WasmDerivedIndexPointer
  gen_boilerplate: false

- name: WasmStoreRef
  gen_boilerplate: false

Loading