Backed out 2 changesets (bug 1598377) for build bustages at WasmCompile.cpp. CLOSED TREE
authorBrindusan Cristian <cbrindusan@mozilla.com>
Fri, 06 Dec 2019 04:46:29 +0200
changeset 567942 7c75c3077b22479e61a6e414b54fef6bb932f092
parent 567941 774ad330f4f6eab85644f083607158115f8cfa38
child 567943 482892b2dd97385d2ab07520b5d4884d8441aa26
push id12493
push userffxbld-merge
push dateMon, 06 Jan 2020 15:38:57 +0000
treeherdermozilla-beta@63ae456b848d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1598377
milestone73.0a1
backs out774ad330f4f6eab85644f083607158115f8cfa38
f0865dabd55a549de7cad0dcdede430ec3c83fd5
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
Backed out 2 changesets (bug 1598377) for build bustages at WasmCompile.cpp. CLOSED TREE Backed out changeset 774ad330f4f6 (bug 1598377) Backed out changeset f0865dabd55a (bug 1598377)
js/src/wasm/AsmJS.cpp
js/src/wasm/WasmCompile.cpp
js/src/wasm/WasmConstants.h
js/src/wasm/WasmValidate.cpp
js/src/wasm/WasmValidate.h
--- a/js/src/wasm/AsmJS.cpp
+++ b/js/src/wasm/AsmJS.cpp
@@ -1346,19 +1346,19 @@ class MOZ_STACK_CLASS JS_HAZ_ROOTED Modu
         validationLifo_(VALIDATION_LIFO_DEFAULT_CHUNK_SIZE),
         funcDefs_(cx),
         tables_(cx),
         globalMap_(cx),
         sigSet_(cx),
         funcImportMap_(cx),
         arrayViews_(cx),
         compilerEnv_(CompileMode::Once, Tier::Optimized, OptimizedBackend::Ion,
-                     DebugEnabled::False, /* multi value */ false,
-                     /* ref types */ false, /* gc types */ false,
-                     /* huge memory */ false, /* bigint */ false),
+                     DebugEnabled::False, /* ref types */ false,
+                     /* gc types */ false, /* huge memory */ false,
+                     /* bigint */ false),
         env_(&compilerEnv_, Shareable::False, ModuleKind::AsmJS) {
     compilerEnv_.computeParameters(/* gc types */ false);
     env_.minMemoryLength = RoundUpToNextValidAsmJSHeapLength(0);
   }
 
  protected:
   MOZ_MUST_USE bool addStandardLibraryMathInfo() {
     static constexpr struct {
--- a/js/src/wasm/WasmCompile.cpp
+++ b/js/src/wasm/WasmCompile.cpp
@@ -441,28 +441,27 @@ static bool TieringBeneficial(uint32_t c
 }
 
 CompilerEnvironment::CompilerEnvironment(const CompileArgs& args)
     : state_(InitialWithArgs), args_(&args) {}
 
 CompilerEnvironment::CompilerEnvironment(CompileMode mode, Tier tier,
                                          OptimizedBackend optimizedBackend,
                                          DebugEnabled debugEnabled,
-                                         bool multiValueConfigured,
                                          bool refTypesConfigured,
                                          bool gcTypesConfigured,
                                          bool hugeMemory, bool bigIntConfigured)
     : state_(InitialWithModeTierDebug),
       mode_(mode),
       tier_(tier),
       optimizedBackend_(optimizedBackend),
       debug_(debugEnabled),
-      multiValues_(multiValueConfigured),
       refTypes_(refTypesConfigured),
       gcTypes_(gcTypesConfigured),
+      multiValues_(true),
       hugeMemory_(hugeMemory),
       bigInt_(bigIntConfigured) {}
 
 void CompilerEnvironment::computeParameters(bool gcFeatureOptIn) {
   MOZ_ASSERT(state_ == InitialWithModeTierDebug);
 
   if (gcTypes_) {
     gcTypes_ = gcFeatureOptIn;
@@ -510,26 +509,18 @@ void CompilerEnvironment::computeParamet
     tier_ = hasSecondTier ? Tier::Optimized : Tier::Baseline;
   }
 
   optimizedBackend_ =
       craneliftEnabled ? OptimizedBackend::Cranelift : OptimizedBackend::Ion;
 
   debug_ = debugEnabled ? DebugEnabled::True : DebugEnabled::False;
   gcTypes_ = gcEnabled;
-#ifdef ENABLE_WASM_REFTYPES
   refTypes_ = !craneliftEnabled;
-#else
-  refTypes_ = false;
-#endif
-#ifdef ENABLE_WASM_MULTI_VALUE
   multiValues_ = !craneliftEnabled;
-#else
-  multiValues_ = false;
-#endif
   hugeMemory_ = hugeMemory;
   bigInt_ = bigIntEnabled && !craneliftEnabled;
   state_ = Computed;
 }
 
 template <class DecoderT>
 static bool DecodeFunctionBody(DecoderT& d, ModuleGenerator& mg,
                                uint32_t funcIndex) {
@@ -621,36 +612,26 @@ SharedModule wasm::CompileBuffer(const C
 }
 
 void wasm::CompileTier2(const CompileArgs& args, const Bytes& bytecode,
                         const Module& module, Atomic<bool>* cancelled) {
   UniqueChars error;
   Decoder d(bytecode, 0, &error);
 
   bool gcTypesConfigured = false;  // No optimized backend support yet
-#ifdef ENABLE_WASM_REFTYPES
   bool refTypesConfigured = !args.craneliftEnabled;
-#else
-  bool refTypesConfigured = false;
-#endif
-#ifdef ENABLE_WASM_MULTI_VALUE
-  bool multiValueConfigured = !args.craneliftEnabled;
-#else
-  bool multiValueConfigured = false;
-#endif
   bool bigIntConfigured = args.bigIntEnabled && !args.craneliftEnabled;
-
   OptimizedBackend optimizedBackend = args.craneliftEnabled
                                           ? OptimizedBackend::Cranelift
                                           : OptimizedBackend::Ion;
 
-  CompilerEnvironment compilerEnv(
-      CompileMode::Tier2, Tier::Optimized, optimizedBackend,
-      DebugEnabled::False, multiValueConfigured, refTypesConfigured,
-      gcTypesConfigured, args.hugeMemory, bigIntConfigured);
+  CompilerEnvironment compilerEnv(CompileMode::Tier2, Tier::Optimized,
+                                  optimizedBackend, DebugEnabled::False,
+                                  refTypesConfigured, gcTypesConfigured,
+                                  args.hugeMemory, bigIntConfigured);
 
   ModuleEnvironment env(&compilerEnv, args.sharedMemoryEnabled
                                           ? Shareable::True
                                           : Shareable::False);
   if (!DecodeModuleEnvironment(d, &env)) {
     return;
   }
 
--- a/js/src/wasm/WasmConstants.h
+++ b/js/src/wasm/WasmConstants.h
@@ -573,19 +573,21 @@ static const unsigned MaxTables =
 static const unsigned MaxImports = 100000;
 static const unsigned MaxExports = 100000;
 static const unsigned MaxGlobals = 1000000;
 static const unsigned MaxDataSegments = 100000;
 static const unsigned MaxElemSegments = 10000000;
 static const unsigned MaxTableLength = 10000000;
 static const unsigned MaxLocals = 50000;
 static const unsigned MaxParams = 1000;
-// The actual maximum results may be `1` if multi-value is not enabled. Check
-// `env->funcMaxResults()` to get the correct value for a module.
+#ifdef ENABLE_WASM_MULTI_VALUE
 static const unsigned MaxResults = 1000;
+#else
+static const unsigned MaxResults = 1;
+#endif
 static const unsigned MaxStructFields = 1000;
 static const unsigned MaxMemoryMaximumPages = 65536;
 static const unsigned MaxStringBytes = 100000;
 static const unsigned MaxModuleBytes = 1024 * 1024 * 1024;
 static const unsigned MaxFunctionBytes = 7654321;
 
 // These limits pertain to our WebAssembly implementation only.
 
--- a/js/src/wasm/WasmValidate.cpp
+++ b/js/src/wasm/WasmValidate.cpp
@@ -1323,17 +1323,17 @@ static bool DecodeFuncType(Decoder& d, M
   if (!DecodeTypeVector(d, env, typeState, numArgs, &args)) {
     return false;
   }
 
   uint32_t numResults;
   if (!d.readVarU32(&numResults)) {
     return d.fail("bad number of function returns");
   }
-  if (numResults > env->funcMaxResults()) {
+  if (numResults > MaxResults) {
     return d.fail("too many returns in signature");
   }
   ValTypeVector results;
   if (!DecodeTypeVector(d, env, typeState, numResults, &results)) {
     return false;
   }
 
   if ((*typeState)[typeIndex] != TypeState::None) {
@@ -2960,24 +2960,23 @@ bool wasm::DecodeModuleTail(Decoder& d, 
 // Validate algorithm.
 
 bool wasm::Validate(JSContext* cx, const ShareableBytes& bytecode,
                     UniqueChars* error) {
   Decoder d(bytecode.bytes, 0, error);
 
   bool gcTypesConfigured = HasGcSupport(cx);
   bool refTypesConfigured = HasReftypesSupport(cx);
-  bool multiValueConfigured = HasMultiValueSupport(cx);
   bool hugeMemory = false;
   bool bigIntConfigured = HasI64BigIntSupport(cx);
 
-  CompilerEnvironment compilerEnv(
-      CompileMode::Once, Tier::Optimized, OptimizedBackend::Ion,
-      DebugEnabled::False, multiValueConfigured, refTypesConfigured,
-      gcTypesConfigured, hugeMemory, bigIntConfigured);
+  CompilerEnvironment compilerEnv(CompileMode::Once, Tier::Optimized,
+                                  OptimizedBackend::Ion, DebugEnabled::False,
+                                  refTypesConfigured, gcTypesConfigured,
+                                  hugeMemory, bigIntConfigured);
   ModuleEnvironment env(
       &compilerEnv,
       cx->realm()->creationOptions().getSharedMemoryAndAtomicsEnabled()
           ? Shareable::True
           : Shareable::False);
   if (!DecodeModuleEnvironment(d, &env)) {
     return false;
   }
--- a/js/src/wasm/WasmValidate.h
+++ b/js/src/wasm/WasmValidate.h
@@ -82,19 +82,19 @@ struct CompilerEnvironment {
   // will compute all parameters from the CompileArgs and additional values.
   explicit CompilerEnvironment(const CompileArgs& args);
 
   // Save the provided values for mode, tier, and debug, and the initial value
   // for gcTypes/refTypes. A subsequent computeParameters() will compute the
   // final value of gcTypes/refTypes.
   CompilerEnvironment(CompileMode mode, Tier tier,
                       OptimizedBackend optimizedBackend,
-                      DebugEnabled debugEnabled, bool multiValueConfigured,
-                      bool refTypesConfigured, bool gcTypesConfigured,
-                      bool hugeMemory, bool bigIntConfigured);
+                      DebugEnabled debugEnabled, bool refTypesConfigured,
+                      bool gcTypesConfigured, bool hugeMemory,
+                      bool bigIntConfigured);
 
   // Compute any remaining compilation parameters.
   void computeParameters(Decoder& d, bool gcFeatureOptIn);
 
   // Compute any remaining compilation parameters.  Only use this method if
   // the CompilerEnvironment was created with values for mode, tier, and
   // debug.
   void computeParameters(bool gcFeatureOptIn);
@@ -226,19 +226,16 @@ struct ModuleEnvironment {
   bool usesSharedMemory() const { return memoryUsage == MemoryUsage::Shared; }
   bool isAsmJS() const { return kind == ModuleKind::AsmJS; }
   bool debugEnabled() const {
     return compilerEnv->debug() == DebugEnabled::True;
   }
   bool hugeMemoryEnabled() const {
     return !isAsmJS() && compilerEnv->hugeMemory();
   }
-  uint32_t funcMaxResults() const {
-    return multiValuesEnabled() ? MaxResults : 1;
-  }
   bool funcIsImport(uint32_t funcIndex) const {
     return funcIndex < funcImportGlobalDataOffsets.length();
   }
   bool isRefSubtypeOf(ValType one, ValType two) const {
     MOZ_ASSERT(one.isReference());
     MOZ_ASSERT(two.isReference());
 #if defined(ENABLE_WASM_REFTYPES)
 #  if defined(ENABLE_WASM_GC)