author | André Bargull <andre.bargull@gmail.com> |
Tue, 07 Apr 2020 08:35:32 +0000 | |
changeset 522631 | bd3e77b5b2e935b1a371f363e159187cf0fd5c1c |
parent 522630 | b801d8007636e2a979eb1c93dcb82e20fe468ba2 |
child 522632 | 2ba73b4b8fd79244ecca495e4ea27013eb5b1be6 |
push id | 37293 |
push user | apavel@mozilla.com |
push date | Tue, 07 Apr 2020 21:44:02 +0000 |
treeherder | mozilla-central@de63e64b9090 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | jandem |
bugs | 1627618 |
milestone | 77.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
js/src/jit/MIR.h | file | annotate | diff | comparison | revisions | |
js/src/wasm/WasmIonCompile.cpp | file | annotate | diff | comparison | revisions |
--- a/js/src/jit/MIR.h +++ b/js/src/jit/MIR.h @@ -5402,31 +5402,36 @@ class MAdd : public MBinaryArithInstruct }; class MSub : public MBinaryArithInstruction { MSub(MDefinition* left, MDefinition* right) : MBinaryArithInstruction(classOpcode, left, right) { setResultType(MIRType::Value); } - MSub(MDefinition* left, MDefinition* right, MIRType type, - bool mustPreserveNaN = false) + MSub(MDefinition* left, MDefinition* right, MIRType type) : MSub(left, right) { specialization_ = type; setResultType(type); - setMustPreserveNaN(mustPreserveNaN); - if (type == MIRType::Int32) { - setTruncateKind(Truncate); - } } public: INSTRUCTION_HEADER(Sub) TRIVIAL_NEW_WRAPPERS + static MSub* NewWasm(TempAllocator& alloc, MDefinition* left, + MDefinition* right, MIRType type, bool mustPreserveNaN) { + auto* ret = new (alloc) MSub(left, right, type); + ret->setMustPreserveNaN(mustPreserveNaN); + if (type == MIRType::Int32) { + ret->setTruncateKind(Truncate); + } + return ret; + } + double getIdentity() override { return 0; } bool isFloat32Commutative() const override { return true; } bool fallible() const; void computeRange(TempAllocator& alloc) override; bool needTruncation(TruncateKind kind) override; void truncate() override;
--- a/js/src/wasm/WasmIonCompile.cpp +++ b/js/src/wasm/WasmIonCompile.cpp @@ -354,17 +354,17 @@ class FunctionCompiler { } MDefinition* sub(MDefinition* lhs, MDefinition* rhs, MIRType type) { if (inDeadCode()) { return nullptr; } // wasm can't fold x - 0.0 because of NaN with custom payloads. - MSub* ins = MSub::New(alloc(), lhs, rhs, type, mustPreserveNaN(type)); + MSub* ins = MSub::NewWasm(alloc(), lhs, rhs, type, mustPreserveNaN(type)); curBlock_->add(ins); return ins; } MDefinition* nearbyInt(MDefinition* input, RoundingMode roundingMode) { if (inDeadCode()) { return nullptr; }