Bug 1439004 - Fix more build breakage when ENABLE_WASM_SATURATING_TRUNC_OPS is not defined. r=luke
authorDan Gohman <sunfish@mozilla.com>
Wed, 21 Feb 2018 12:21:00 -0500
changeset 404726 a4f510195124b1c2bd74aea3438acb02df29deb7
parent 404725 31ea2689701e6bbae44401b1696609469187d1c4
child 404727 54b20676b4c4a884c5964f3d583aa5f46e72204c
push id100081
push userryanvm@gmail.com
push dateThu, 22 Feb 2018 03:08:31 +0000
treeherdermozilla-inbound@a4f510195124 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1439004
milestone60.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
Bug 1439004 - Fix more build breakage when ENABLE_WASM_SATURATING_TRUNC_OPS is not defined. r=luke
js/src/wasm/WasmAST.h
js/src/wasm/WasmBinaryToText.cpp
js/src/wasm/WasmTextToBinary.cpp
--- a/js/src/wasm/WasmAST.h
+++ b/js/src/wasm/WasmAST.h
@@ -193,17 +193,19 @@ enum class AstExprKind
     BranchTable,
     Call,
     CallIndirect,
     ComparisonOperator,
     Const,
     ConversionOperator,
     CurrentMemory,
     Drop,
+#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
     ExtraConversionOperator,
+#endif
     First,
     GetGlobal,
     GetLocal,
     GrowMemory,
     If,
     Load,
     Nop,
     Pop,
@@ -1137,32 +1139,34 @@ class AstConversionOperator final : publ
       : AstExpr(Kind, ExprType::Limit),
         op_(op), operand_(operand)
     {}
 
     Op op() const { return op_; }
     AstExpr* operand() const { return operand_; }
 };
 
+#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
 // Like AstConversionOperator, but for opcodes encoded with the Numeric prefix.
 class AstExtraConversionOperator final : public AstExpr
 {
     NumericOp op_;
     AstExpr* operand_;
 
   public:
     static const AstExprKind Kind = AstExprKind::ExtraConversionOperator;
     explicit AstExtraConversionOperator(NumericOp op, AstExpr* operand)
       : AstExpr(Kind, ExprType::Limit),
         op_(op), operand_(operand)
     {}
 
     NumericOp op() const { return op_; }
     AstExpr* operand() const { return operand_; }
 };
+#endif
 
 // This is an artificial AST node which can fill operand slots in an AST
 // constructed from parsing or decoding stack-machine code that doesn't have
 // an inherent AST structure.
 class AstPop final : public AstExpr
 {
   public:
     static const AstExprKind Kind = AstExprKind::Pop;
--- a/js/src/wasm/WasmBinaryToText.cpp
+++ b/js/src/wasm/WasmBinaryToText.cpp
@@ -745,42 +745,42 @@ RenderConversionOperator(WasmRenderConte
 #endif
       case Op::I32Eqz:            opStr = "i32.eqz"; break;
       case Op::I64Eqz:            opStr = "i64.eqz"; break;
       default:                      return Fail(c, "unexpected conversion operator");
     }
     return c.buffer.append(opStr, strlen(opStr));
 }
 
+#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
 static bool
 RenderExtraConversionOperator(WasmRenderContext& c, AstExtraConversionOperator& conv)
 {
     if (!RenderExpr(c, *conv.operand()))
         return false;
 
     if (!RenderIndent(c))
         return false;
 
     MAP_AST_EXPR(c, conv);
     const char* opStr;
     switch (conv.op()) {
-#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
       case NumericOp::I32TruncSSatF32:   opStr = "i32.trunc_s:sat/f32"; break;
       case NumericOp::I32TruncUSatF32:   opStr = "i32.trunc_u:sat/f32"; break;
       case NumericOp::I32TruncSSatF64:   opStr = "i32.trunc_s:sat/f64"; break;
       case NumericOp::I32TruncUSatF64:   opStr = "i32.trunc_u:sat/f64"; break;
       case NumericOp::I64TruncSSatF32:   opStr = "i64.trunc_s:sat/f32"; break;
       case NumericOp::I64TruncUSatF32:   opStr = "i64.trunc_u:sat/f32"; break;
       case NumericOp::I64TruncSSatF64:   opStr = "i64.trunc_s:sat/f64"; break;
       case NumericOp::I64TruncUSatF64:   opStr = "i64.trunc_u:sat/f64"; break;
-#endif
       default:                      return Fail(c, "unexpected extra conversion operator");
     }
     return c.buffer.append(opStr, strlen(opStr));
 }
+#endif
 
 static bool
 RenderIf(WasmRenderContext& c, AstIf& if_)
 {
     if (!RenderExpr(c, if_.cond()))
         return false;
 
     if (!RenderIndent(c))
@@ -1349,20 +1349,22 @@ RenderExpr(WasmRenderContext& c, AstExpr
       case AstExprKind::ComparisonOperator:
         if (!RenderComparisonOperator(c, expr.as<AstComparisonOperator>()))
             return false;
         break;
       case AstExprKind::ConversionOperator:
         if (!RenderConversionOperator(c, expr.as<AstConversionOperator>()))
             return false;
         break;
+#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
       case AstExprKind::ExtraConversionOperator:
         if (!RenderExtraConversionOperator(c, expr.as<AstExtraConversionOperator>()))
             return false;
         break;
+#endif
       case AstExprKind::Load:
         if (!RenderLoad(c, expr.as<AstLoad>()))
             return false;
         break;
       case AstExprKind::Store:
         if (!RenderStore(c, expr.as<AstStore>()))
             return false;
         break;
--- a/js/src/wasm/WasmTextToBinary.cpp
+++ b/js/src/wasm/WasmTextToBinary.cpp
@@ -86,17 +86,19 @@ class WasmToken
         Drop,
         Elem,
         Else,
         End,
         EndOfFile,
         Equal,
         Error,
         Export,
+#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
         ExtraConversionOpcode,
+#endif
         Float,
         Func,
         GetGlobal,
         GetLocal,
         Global,
         GrowMemory,
         If,
         Import,
@@ -213,25 +215,27 @@ class WasmToken
         end_(end)
     {
         MOZ_ASSERT(begin != end);
         MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == TernaryOpcode ||
                    kind_ == ComparisonOpcode || kind_ == ConversionOpcode ||
                    kind_ == Load || kind_ == Store);
         u.op_ = op;
     }
+#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
     explicit WasmToken(Kind kind, NumericOp op, const char16_t* begin, const char16_t* end)
       : kind_(kind),
         begin_(begin),
         end_(end)
     {
         MOZ_ASSERT(begin != end);
         MOZ_ASSERT(kind_ == ExtraConversionOpcode);
         u.numericOp_ = op;
     }
+#endif
     explicit WasmToken(Kind kind, ThreadOp op, const char16_t* begin, const char16_t* end)
       : kind_(kind),
         begin_(begin),
         end_(end)
     {
         MOZ_ASSERT(begin != end);
         MOZ_ASSERT(kind_ == AtomicCmpXchg || kind_ == AtomicLoad || kind_ == AtomicRMW ||
                    kind_ == AtomicStore || kind_ == Wait || kind_ == Wake);
@@ -283,20 +287,22 @@ class WasmToken
         return u.valueType_;
     }
     Op op() const {
         MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == TernaryOpcode ||
                    kind_ == ComparisonOpcode || kind_ == ConversionOpcode ||
                    kind_ == Load || kind_ == Store);
         return u.op_;
     }
+#ifdef ENABLE_WASM_SATURATING_TRUNC_OPS
     NumericOp numericOp() const {
         MOZ_ASSERT(kind_ == ExtraConversionOpcode);
         return u.numericOp_;
     }
+#endif
     ThreadOp threadOp() const {
         MOZ_ASSERT(kind_ == AtomicCmpXchg || kind_ == AtomicLoad || kind_ == AtomicRMW ||
                    kind_ == AtomicStore || kind_ == Wait || kind_ == Wake);
         return u.threadOp_;
     }
     bool isOpcode() const {
         switch (kind_) {
           case AtomicCmpXchg: