From 1e57ce022c217588477e370c0543099d11875916 Mon Sep 17 00:00:00 2001 From: Narcis Beleuzu Date: Tue, 14 Jan 2020 22:23:15 +0200 Subject: [PATCH] Backed out changeset d2457f7efd8a (bug 1608791) for spidermonkey bustages on WasmBaselineCompile.cpp. CLOSED TREE --- js/src/jit/arm/Architecture-arm.h | 7 ++-- js/src/jit/arm/Assembler-arm.cpp | 7 ++++ js/src/jit/arm64/Architecture-arm64.h | 1 - js/src/jit/mips32/Architecture-mips32.h | 1 - js/src/wasm/WasmBaselineCompile.cpp | 48 +++++++++++-------------- 5 files changed, 29 insertions(+), 35 deletions(-) diff --git a/js/src/jit/arm/Architecture-arm.h b/js/src/jit/arm/Architecture-arm.h index ff425f16983f..3e3800b07247 100644 --- a/js/src/jit/arm/Architecture-arm.h +++ b/js/src/jit/arm/Architecture-arm.h @@ -386,11 +386,8 @@ class VFPRegister { bool isUInt() const { return kind == UInt; } bool equiv(const VFPRegister& other) const { return other.kind == kind; } size_t size() const { return (kind == Double) ? 8 : 4; } - bool isInvalid() const { return _isInvalid; } - bool isMissing() const { - MOZ_ASSERT(!_isInvalid); - return _isMissing; - } + bool isInvalid() const; + bool isMissing() const; VFPRegister doubleOverlay(unsigned int which = 0) const; VFPRegister singleOverlay(unsigned int which = 0) const; diff --git a/js/src/jit/arm/Assembler-arm.cpp b/js/src/jit/arm/Assembler-arm.cpp index 5caaa4c2a715..bd06200a15e8 100644 --- a/js/src/jit/arm/Assembler-arm.cpp +++ b/js/src/jit/arm/Assembler-arm.cpp @@ -1114,6 +1114,13 @@ VFPRegister VFPRegister::uintOverlay(unsigned int which) const { return VFPRegister(code_, UInt); } +bool VFPRegister::isInvalid() const { return _isInvalid; } + +bool VFPRegister::isMissing() const { + MOZ_ASSERT(!_isInvalid); + return _isMissing; +} + bool Assembler::oom() const { return AssemblerShared::oom() || m_buffer.oom() || jumpRelocations_.oom() || dataRelocations_.oom(); diff --git a/js/src/jit/arm64/Architecture-arm64.h b/js/src/jit/arm64/Architecture-arm64.h index a8a1c2a901e1..f2bb160a7d58 100644 --- a/js/src/jit/arm64/Architecture-arm64.h +++ b/js/src/jit/arm64/Architecture-arm64.h @@ -494,7 +494,6 @@ struct FloatRegister { bool isSingle() const { return k_ == FloatRegisters::Single; } bool isDouble() const { return k_ == FloatRegisters::Double; } bool isSimd128() const { return false; } - bool isInvalid() const { return code_ == FloatRegisters::Code(-1); } FloatRegister asSingle() const { return FloatRegister(code_, FloatRegisters::Single); diff --git a/js/src/jit/mips32/Architecture-mips32.h b/js/src/jit/mips32/Architecture-mips32.h index 56dc37dfefe5..794d5080847b 100644 --- a/js/src/jit/mips32/Architecture-mips32.h +++ b/js/src/jit/mips32/Architecture-mips32.h @@ -137,7 +137,6 @@ class FloatRegister : public FloatRegisterMIPSShared { bool isSingle() const { return kind_ == Single; } bool isDouble() const { return kind_ == Double; } - bool isInvalid() const { return code_ == FloatRegisters::invalid_freg; } FloatRegister doubleOverlay() const; FloatRegister singleOverlay() const; diff --git a/js/src/wasm/WasmBaselineCompile.cpp b/js/src/wasm/WasmBaselineCompile.cpp index da66c496eb6a..c09d8af7c26c 100644 --- a/js/src/wasm/WasmBaselineCompile.cpp +++ b/js/src/wasm/WasmBaselineCompile.cpp @@ -299,50 +299,42 @@ struct RegTypeOf { struct RegI32 : public Register { RegI32() : Register(Register::Invalid()) {} - explicit RegI32(Register reg) : Register(reg) { - MOZ_ASSERT(reg != Invalid()); - } - bool isInvalid() const { return *this == Invalid(); } - bool isValid() const { return !isInvalid(); } - static RegI32 Invalid() { return RegI32(); } + explicit RegI32(Register reg) : Register(reg) {} + bool isValid() const { return *this != Invalid(); } + bool isInvalid() const { return !isValid(); } + static RegI32 Invalid() { return RegI32(Register::Invalid()); } }; struct RegI64 : public Register64 { RegI64() : Register64(Register64::Invalid()) {} - explicit RegI64(Register64 reg) : Register64(reg) { - MOZ_ASSERT(reg != Invalid()); - } - bool isInvalid() const { return *this == Invalid(); } - bool isValid() const { return !isInvalid(); } - static RegI64 Invalid() { return RegI64(); } + explicit RegI64(Register64 reg) : Register64(reg) {} + bool isValid() const { return *this != Invalid(); } + bool isInvalid() const { return !isValid(); } + static RegI64 Invalid() { return RegI64(Register64::Invalid()); } }; struct RegPtr : public Register { RegPtr() : Register(Register::Invalid()) {} - explicit RegPtr(Register reg) : Register(reg) { - MOZ_ASSERT(reg != Invalid()); - } - bool isInvalid() const { return *this == Invalid(); } - bool isValid() const { return !isInvalid(); } - static RegPtr Invalid() { return RegPtr(); } + explicit RegPtr(Register reg) : Register(reg) {} + bool isValid() const { return *this != Invalid(); } + bool isInvalid() const { return !isValid(); } + static RegPtr Invalid() { return RegPtr(Register::Invalid()); } }; struct RegF32 : public FloatRegister { RegF32() : FloatRegister() {} - explicit RegF32(FloatRegister reg) : FloatRegister(reg) { - MOZ_ASSERT(isSingle()); - } - bool isValid() const { return !isInvalid(); } - static RegF32 Invalid() { return RegF32(); } + explicit RegF32(FloatRegister reg) : FloatRegister(reg) {} + bool isValid() const { return *this != Invalid(); } + bool isInvalid() const { return !isValid(); } + static RegF32 Invalid() { return RegF32(InvalidFloatReg); } }; struct RegF64 : public FloatRegister { RegF64() : FloatRegister() {} - explicit RegF64(FloatRegister reg) : FloatRegister(reg) { - MOZ_ASSERT(isDouble()); - } - bool isValid() const { return !isInvalid(); } - static RegF64 Invalid() { return RegF64(); } + explicit RegF64(FloatRegister reg) : FloatRegister(reg) {} + bool isValid() const { return *this != Invalid(); } + bool isInvalid() const { return !isValid(); } + static RegF64 Invalid() { return RegF64(InvalidFloatReg); } }; struct AnyReg {