Backed out changeset 6996ca3c1ef6 (bug 1308056) for Windows bustage and spidermonkey test failures. r=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Tue, 11 Oct 2016 14:25:54 +0200
changeset 360377 35590eb61756f1f36569a19740bfdc34e3bb190b
parent 360376 d77072059582f13fe62477717836cec397dbc70b
child 360378 c99f2fb3dc50e2aae4710aa93674e170ff2a6be7
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1308056
milestone52.0a1
backs out6996ca3c1ef6cb928825a91642972a2375fb1910
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 changeset 6996ca3c1ef6 (bug 1308056) for Windows bustage and spidermonkey test failures. r=backout on a CLOSED TREE
js/src/asmjs/WasmAST.h
js/src/asmjs/WasmBinary.cpp
js/src/asmjs/WasmBinary.h
js/src/asmjs/WasmBinaryToAST.cpp
js/src/asmjs/WasmCompile.cpp
js/src/asmjs/WasmJS.cpp
js/src/asmjs/WasmJS.h
js/src/asmjs/WasmModule.cpp
js/src/asmjs/WasmTextToBinary.cpp
js/src/asmjs/WasmTypes.h
--- a/js/src/asmjs/WasmAST.h
+++ b/js/src/asmjs/WasmAST.h
@@ -621,40 +621,40 @@ typedef AstVector<AstGlobal*> AstGlobalV
 class AstImport : public AstNode
 {
     AstName name_;
     AstName module_;
     AstName field_;
     DefinitionKind kind_;
 
     AstRef funcSig_;
-    Limits resizable_;
+    ResizableLimits resizable_;
     AstGlobal global_;
 
   public:
     AstImport(AstName name, AstName module, AstName field, AstRef funcSig)
       : name_(name), module_(module), field_(field), kind_(DefinitionKind::Function), funcSig_(funcSig)
     {}
-    AstImport(AstName name, AstName module, AstName field, DefinitionKind kind, Limits resizable)
+    AstImport(AstName name, AstName module, AstName field, DefinitionKind kind, ResizableLimits resizable)
       : name_(name), module_(module), field_(field), kind_(kind), resizable_(resizable)
     {}
     AstImport(AstName name, AstName module, AstName field, AstGlobal global)
       : name_(name), module_(module), field_(field), kind_(DefinitionKind::Global), global_(global)
     {}
 
     AstName name() const { return name_; }
     AstName module() const { return module_; }
     AstName field() const { return field_; }
 
     DefinitionKind kind() const { return kind_; }
     AstRef& funcSig() {
         MOZ_ASSERT(kind_ == DefinitionKind::Function);
         return funcSig_;
     }
-    Limits resizable() const {
+    ResizableLimits resizable() const {
         MOZ_ASSERT(kind_ == DefinitionKind::Memory || kind_ == DefinitionKind::Table);
         return resizable_;
     }
     const AstGlobal& global() const {
         MOZ_ASSERT(kind_ == DefinitionKind::Global);
         return global_;
     }
 };
@@ -739,18 +739,18 @@ class AstModule : public AstNode
   private:
     typedef AstHashMap<AstSig*, uint32_t, AstSig> SigMap;
 
     LifoAlloc&           lifo_;
     SigVector            sigs_;
     SigMap               sigMap_;
     ImportVector         imports_;
     NameVector           funcImportNames_;
-    Maybe<Limits>        table_;
-    Maybe<Limits>        memory_;
+    Maybe<ResizableLimits> table_;
+    Maybe<ResizableLimits> memory_;
     ExportVector         exports_;
     Maybe<AstStartFunc>  startFunc_;
     FuncVector           funcs_;
     AstDataSegmentVector dataSegments_;
     AstElemSegmentVector elemSegments_;
     AstGlobalVector      globals_;
 
   public:
@@ -764,38 +764,38 @@ class AstModule : public AstNode
         funcs_(lifo),
         dataSegments_(lifo),
         elemSegments_(lifo),
         globals_(lifo)
     {}
     bool init() {
         return sigMap_.init();
     }
-    bool setMemory(Limits memory) {
+    bool setMemory(ResizableLimits memory) {
         if (memory_)
             return false;
         memory_.emplace(memory);
         return true;
     }
     bool hasMemory() const {
         return !!memory_;
     }
-    const Limits& memory() const {
+    const ResizableLimits& memory() const {
         return *memory_;
     }
-    bool setTable(Limits table) {
+    bool setTable(ResizableLimits table) {
         if (table_)
             return false;
         table_.emplace(table);
         return true;
     }
     bool hasTable() const {
         return !!table_;
     }
-    const Limits& table() const {
+    const ResizableLimits& table() const {
         return *table_;
     }
     bool append(AstDataSegment* seg) {
         return dataSegments_.append(seg);
     }
     const AstDataSegmentVector& dataSegments() const {
         return dataSegments_;
     }
--- a/js/src/asmjs/WasmBinary.cpp
+++ b/js/src/asmjs/WasmBinary.cpp
@@ -137,17 +137,17 @@ wasm::DecodeGlobalType(Decoder& d, ValTy
 
     if (*flags & ~uint32_t(GlobalFlags::AllowedMask))
         return d.fail("unexpected bits set in global flags");
 
     return true;
 }
 
 bool
-wasm::DecodeLimits(Decoder& d, Limits* limits)
+wasm::DecodeResizable(Decoder& d, ResizableLimits* limits)
 {
     uint32_t flags;
     if (!d.readVarU32(&flags))
         return d.fail("expected flags");
 
     if (flags & ~uint32_t(ResizableFlags::AllowedMask))
         return d.fail("unexpected bits set in flags: %lu",
                       (flags & ~uint32_t(ResizableFlags::AllowedMask)));
--- a/js/src/asmjs/WasmBinary.h
+++ b/js/src/asmjs/WasmBinary.h
@@ -1091,20 +1091,20 @@ MOZ_MUST_USE bool
 EncodeLocalEntries(Encoder& d, const ValTypeVector& locals);
 
 MOZ_MUST_USE bool
 DecodeLocalEntries(Decoder& d, ValTypeVector* locals);
 
 MOZ_MUST_USE bool
 DecodeGlobalType(Decoder& d, ValType* type, uint32_t* flags);
 
-struct Limits;
+struct ResizableLimits;
 
 MOZ_MUST_USE bool
-DecodeLimits(Decoder& d, Limits* limits);
+DecodeResizable(Decoder& d, ResizableLimits* resizable);
 
 MOZ_MUST_USE bool
 DecodeUnknownSections(Decoder& d);
 
 } // namespace wasm
 } // namespace js
 
 #endif // wasm_binary_h
--- a/js/src/asmjs/WasmBinaryToAST.cpp
+++ b/js/src/asmjs/WasmBinaryToAST.cpp
@@ -1506,18 +1506,18 @@ AstDecodeTableSection(AstDecodeContext& 
 
     uint32_t typeConstructorValue;
     if (!c.d.readVarU32(&typeConstructorValue))
         return c.d.fail("expected type constructor kind");
 
     if (typeConstructorValue != uint32_t(TypeConstructor::AnyFunc))
         return c.d.fail("unknown type constructor kind");
 
-    Limits table;
-    if (!DecodeLimits(c.d, &table))
+    ResizableLimits table;
+    if (!DecodeResizable(c.d, &table))
         return false;
 
     if (table.initial > MaxTableElems)
         return c.d.fail("too many table elements");
 
     if (!c.module().setTable(table))
         return c.d.fail("already have a table");
 
@@ -1542,26 +1542,26 @@ AstDecodeName(AstDecodeContext& c, AstNa
     for (size_t i = 0; i < length; i++)
         buffer[i] = bytes[i];
 
     *name = AstName(buffer, length);
     return true;
 }
 
 static bool
-AstDecodeLimitsTable(AstDecodeContext& c, Limits* limits)
+AstDecodeResizableTable(AstDecodeContext& c, ResizableLimits* resizable)
 {
     uint32_t kind;
     if (!c.d.readVarU32(&kind))
         return false;
 
     if (kind != uint32_t(TypeConstructor::AnyFunc))
         return c.d.fail("unknown type constructor kind");
 
-    if (!DecodeLimits(c.d, limits))
+    if (!DecodeResizable(c.d, resizable))
         return false;
 
     return true;
 }
 
 static bool
 AstDecodeImport(AstDecodeContext& c, uint32_t importIndex, AstImport** import)
 {
@@ -1606,27 +1606,27 @@ AstDecodeImport(AstDecodeContext& c, uin
         if (!c.d.readVarU32(&flags))
             return false;
 
         *import = new(c.lifo) AstImport(importName, moduleName, fieldName,
                                         AstGlobal(importName, type, flags));
         break;
       }
       case uint32_t(DefinitionKind::Table): {
-        Limits table;
-        if (!AstDecodeLimitsTable(c, &table))
+        ResizableLimits table;
+        if (!AstDecodeResizableTable(c, &table))
             return false;
 
         *import = new(c.lifo) AstImport(importName, moduleName, fieldName,
                                         DefinitionKind::Table, table);
         break;
       }
       case uint32_t(DefinitionKind::Memory): {
-        Limits memory;
-        if (!DecodeLimits(c.d, &memory))
+        ResizableLimits memory;
+        if (!DecodeResizable(c.d, &memory))
             return false;
 
         *import = new(c.lifo) AstImport(importName, moduleName, fieldName,
                                         DefinitionKind::Memory, memory);
         break;
       }
       default:
         return c.d.fail("unknown import kind");
@@ -1679,18 +1679,18 @@ AstDecodeMemorySection(AstDecodeContext&
 
     uint32_t numMemories;
     if (!c.d.readVarU32(&numMemories))
         return c.d.fail("failed to read number of memories");
 
     if (numMemories != 1)
         return c.d.fail("the number of memories must be exactly one");
 
-    Limits memory;
-    if (!DecodeLimits(c.d, &memory))
+    ResizableLimits memory;
+    if (!DecodeResizable(c.d, &memory))
         return false;
 
     if (!c.d.finishSection(sectionStart, sectionSize, "memory"))
         return false;
 
     c.module().setMemory(memory);
     return true;
 }
--- a/js/src/asmjs/WasmCompile.cpp
+++ b/js/src/asmjs/WasmCompile.cpp
@@ -604,18 +604,18 @@ DecodeName(Decoder& d)
 }
 
 static bool
 DecodeResizableMemory(Decoder& d, ModuleGeneratorData* init)
 {
     if (UsesMemory(init->memoryUsage))
         return d.fail("already have default memory");
 
-    Limits limits;
-    if (!DecodeLimits(d, &limits))
+    ResizableLimits limits;
+    if (!DecodeResizable(d, &limits))
         return false;
 
     init->memoryUsage = MemoryUsage::Unshared;
 
     CheckedInt<uint32_t> initialBytes = limits.initial;
     initialBytes *= PageSize;
     if (!initialBytes.isValid() || initialBytes.value() > uint32_t(INT32_MAX))
         return d.fail("initial memory size too big");
@@ -639,18 +639,18 @@ DecodeResizableTable(Decoder& d, ModuleG
 {
     uint32_t elementType;
     if (!d.readVarU32(&elementType))
         return d.fail("expected table element type");
 
     if (elementType != uint32_t(TypeConstructor::AnyFunc))
         return d.fail("expected 'anyfunc' element type");
 
-    Limits limits;
-    if (!DecodeLimits(d, &limits))
+    ResizableLimits limits;
+    if (!DecodeResizable(d, &limits))
         return false;
 
     if (!init->tables.empty())
         return d.fail("already have default table");
 
     return init->tables.emplaceBack(TableKind::AnyFunction, limits);
 }
 
--- a/js/src/asmjs/WasmJS.cpp
+++ b/js/src/asmjs/WasmJS.cpp
@@ -447,18 +447,18 @@ ToNonWrappingUint32(JSContext* cx, Handl
     }
 
     *u32 = uint32_t(dbl);
     MOZ_ASSERT(double(*u32) == dbl);
     return true;
 }
 
 static bool
-GetLimits(JSContext* cx, HandleObject obj, uint32_t max, const char* kind,
-          Limits* limits)
+GetResizableLimits(JSContext* cx, HandleObject obj, uint32_t max, const char* kind,
+                   ResizableLimits* limits)
 {
     JSAtom* initialAtom = Atomize(cx, "initial", strlen("initial"));
     if (!initialAtom)
         return false;
     RootedId initialId(cx, AtomToId(initialAtom));
 
     RootedValue initialVal(cx);
     if (!GetProperty(cx, obj, obj, initialId, &initialVal))
@@ -934,18 +934,18 @@ WasmMemoryObject::construct(JSContext* c
         return false;
 
     if (!args.get(0).isObject()) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_DESC_ARG, "memory");
         return false;
     }
 
     RootedObject obj(cx, &args[0].toObject());
-    Limits limits;
-    if (!GetLimits(cx, obj, UINT32_MAX / PageSize, "Memory", &limits))
+    ResizableLimits limits;
+    if (!GetResizableLimits(cx, obj, UINT32_MAX / PageSize, "Memory", &limits))
         return false;
 
     limits.initial *= PageSize;
     if (limits.maximum)
         limits.maximum = Some(*limits.maximum * PageSize);
 
     RootedArrayBufferObject buffer(cx,
         ArrayBufferObject::createForWasm(cx, limits.initial, limits.maximum));
@@ -1177,17 +1177,17 @@ WasmTableObject::finalize(FreeOp* fop, J
 WasmTableObject::trace(JSTracer* trc, JSObject* obj)
 {
     WasmTableObject& tableObj = obj->as<WasmTableObject>();
     if (!tableObj.isNewborn())
         tableObj.table().tracePrivate(trc);
 }
 
 /* static */ WasmTableObject*
-WasmTableObject::create(JSContext* cx, Limits limits)
+WasmTableObject::create(JSContext* cx, ResizableLimits limits)
 {
     RootedObject proto(cx, &cx->global()->getPrototype(JSProto_WasmTable).toObject());
 
     AutoSetNewObjectMetadata metadata(cx);
     RootedWasmTableObject obj(cx, NewObjectWithGivenProto<WasmTableObject>(cx, proto));
     if (!obj)
         return nullptr;
 
@@ -1242,18 +1242,18 @@ WasmTableObject::construct(JSContext* cx
     if (!elementStr)
         return false;
 
     if (!StringEqualsAscii(elementStr, "anyfunc")) {
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_ELEMENT);
         return false;
     }
 
-    Limits limits;
-    if (!GetLimits(cx, obj, UINT32_MAX, "Table", &limits))
+    ResizableLimits limits;
+    if (!GetResizableLimits(cx, obj, UINT32_MAX, "Table", &limits))
         return false;
 
     RootedWasmTableObject table(cx, WasmTableObject::create(cx, limits));
     if (!table)
         return false;
 
     args.rval().setObject(*table);
     return true;
--- a/js/src/asmjs/WasmJS.h
+++ b/js/src/asmjs/WasmJS.h
@@ -249,15 +249,15 @@ class WasmTableObject : public NativeObj
     static const Class class_;
     static const JSPropertySpec properties[];
     static const JSFunctionSpec methods[];
     static bool construct(JSContext*, unsigned, Value*);
 
     // Note that, after creation, a WasmTableObject's table() is not initialized
     // and must be initialized before use.
 
-    static WasmTableObject* create(JSContext* cx, wasm::Limits limits);
+    static WasmTableObject* create(JSContext* cx, wasm::ResizableLimits limits);
     wasm::Table& table() const;
 };
 
 } // namespace js
 
 #endif // wasm_js_h
--- a/js/src/asmjs/WasmModule.cpp
+++ b/js/src/asmjs/WasmModule.cpp
@@ -498,33 +498,36 @@ Module::instantiateFunctions(JSContext* 
             return false;
         }
     }
 
     return true;
 }
 
 static bool
-CheckLimits(JSContext* cx, uint32_t declaredMin, Maybe<uint32_t> declaredMax, uint32_t actualLength,
-            Maybe<uint32_t> actualMax, bool isAsmJS, const char* kind)
+CheckResizableLimits(JSContext* cx, uint32_t declaredMin, Maybe<uint32_t> declaredMax,
+                     uint32_t actualLength, Maybe<uint32_t> actualMax,
+                     bool isAsmJS, const char* kind)
 {
     if (isAsmJS) {
         MOZ_ASSERT(actualLength >= declaredMin);
         MOZ_ASSERT(!declaredMax);
         MOZ_ASSERT(actualLength == actualMax.value());
         return true;
     }
 
     if (actualLength < declaredMin || actualLength > declaredMax.valueOr(UINT32_MAX)) {
-        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_IMP_SIZE, kind);
+        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_IMP_SIZE,
+                                  kind);
         return false;
     }
 
     if ((actualMax && (!declaredMax || *actualMax > *declaredMax)) || (!actualMax && declaredMax)) {
-        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_IMP_MAX, kind);
+        JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_WASM_BAD_IMP_MAX,
+                                  kind);
         return false;
     }
 
     return true;
 }
 
 // asm.js module instantiation supplies its own buffer, but for wasm, create and
 // initialize the buffer if one is requested. Either way, the buffer is wrapped
@@ -541,18 +544,19 @@ Module::instantiateMemory(JSContext* cx,
     uint32_t declaredMin = metadata_->minMemoryLength;
     Maybe<uint32_t> declaredMax = metadata_->maxMemoryLength;
 
     if (memory) {
         ArrayBufferObjectMaybeShared& buffer = memory->buffer();
         MOZ_ASSERT_IF(metadata_->isAsmJS(), buffer.isPreparedForAsmJS());
         MOZ_ASSERT_IF(!metadata_->isAsmJS(), buffer.as<ArrayBufferObject>().isWasm());
 
-        if (!CheckLimits(cx, declaredMin, declaredMax, buffer.byteLength(), buffer.wasmMaxSize(),
-                         metadata_->isAsmJS(), "Memory")) {
+        if (!CheckResizableLimits(cx, declaredMin, declaredMax,
+                                  buffer.byteLength(), buffer.wasmMaxSize(),
+                                  metadata_->isAsmJS(), "Memory")) {
             return false;
         }
     } else {
         MOZ_ASSERT(!metadata_->isAsmJS());
         MOZ_ASSERT(metadata_->memoryUsage == MemoryUsage::Unshared);
 
         RootedArrayBufferObjectMaybeShared buffer(cx,
             ArrayBufferObject::createForWasm(cx, declaredMin, declaredMax));
@@ -576,18 +580,19 @@ Module::instantiateTable(JSContext* cx, 
     if (tableObj) {
         MOZ_ASSERT(!metadata_->isAsmJS());
 
         MOZ_ASSERT(metadata_->tables.length() == 1);
         const TableDesc& td = metadata_->tables[0];
         MOZ_ASSERT(td.external);
 
         Table& table = tableObj->table();
-        if (!CheckLimits(cx, td.limits.initial, td.limits.maximum, table.length(), table.maximum(),
-                         metadata_->isAsmJS(), "Table")) {
+        if (!CheckResizableLimits(cx, td.limits.initial, td.limits.maximum,
+                                  table.length(), table.maximum(),
+                                  metadata_->isAsmJS(), "Table")) {
             return false;
         }
 
         if (!tables->append(&table)) {
             ReportOutOfMemory(cx);
             return false;
         }
     } else {
--- a/js/src/asmjs/WasmTextToBinary.cpp
+++ b/js/src/asmjs/WasmTextToBinary.cpp
@@ -2644,28 +2644,28 @@ ParseDataSegment(WasmParseContext& c)
     WasmToken text;
     if (!c.ts.getIf(WasmToken::Text, &text))
         return new(c.lifo) AstDataSegment(offset, AstName());
 
     return new(c.lifo) AstDataSegment(offset, text.text());
 }
 
 static bool
-ParseLimits(WasmParseContext& c, Limits* resizable)
+ParseResizable(WasmParseContext& c, ResizableLimits* resizable)
 {
     WasmToken initial;
     if (!c.ts.match(WasmToken::Index, &initial, c.error))
         return false;
 
     Maybe<uint32_t> maximum;
     WasmToken token;
     if (c.ts.getIf(WasmToken::Index, &token))
         maximum.emplace(token.index());
 
-    Limits r = { initial.index(), maximum };
+    ResizableLimits r = { initial.index(), maximum };
     *resizable = r;
     return true;
 }
 
 static bool
 ParseMemory(WasmParseContext& c, WasmToken token, AstModule* module)
 {
     if (c.ts.getIf(WasmToken::OpenParen)) {
@@ -2683,28 +2683,28 @@ ParseMemory(WasmParseContext& c, WasmTok
             if (!segment || !module->append(segment))
                 return false;
 
             pages = AlignBytes<size_t>(segment->text().length(), PageSize) / PageSize;
             if (pages != uint32_t(pages))
                 return false;
         }
 
-        Limits memory = { uint32_t(pages), Some(uint32_t(pages)) };
+        ResizableLimits memory = { uint32_t(pages), Some(uint32_t(pages)) };
         if (!module->setMemory(memory))
             return false;
 
         if (!c.ts.match(WasmToken::CloseParen, c.error))
             return false;
 
         return true;
     }
 
-    Limits memory;
-    if (!ParseLimits(c, &memory))
+    ResizableLimits memory;
+    if (!ParseResizable(c, &memory))
         return false;
 
     if (!module->setMemory(memory)) {
         c.ts.generateError(token, c.error);
         return false;
     }
 
     return true;
@@ -2751,27 +2751,27 @@ ParseImport(WasmParseContext& c, AstModu
     WasmToken fieldName;
     if (!c.ts.match(WasmToken::Text, &fieldName, c.error))
         return nullptr;
 
     AstRef sigRef;
     WasmToken openParen;
     if (c.ts.getIf(WasmToken::OpenParen, &openParen)) {
         if (c.ts.getIf(WasmToken::Memory)) {
-            Limits memory;
-            if (!ParseLimits(c, &memory))
+            ResizableLimits memory;
+            if (!ParseResizable(c, &memory))
                 return nullptr;
             if (!c.ts.match(WasmToken::CloseParen, c.error))
                 return nullptr;
             return new(c.lifo) AstImport(name, moduleName.text(), fieldName.text(),
                                          DefinitionKind::Memory, memory);
         }
         if (c.ts.getIf(WasmToken::Table)) {
-            Limits table;
-            if (!ParseLimits(c, &table))
+            ResizableLimits table;
+            if (!ParseResizable(c, &table))
                 return nullptr;
             if (!c.ts.match(WasmToken::CloseParen, c.error))
                 return nullptr;
             return new(c.lifo) AstImport(name, moduleName.text(), fieldName.text(),
                                          DefinitionKind::Table, table);
         }
         if (c.ts.getIf(WasmToken::Global)) {
             WasmToken typeToken;
@@ -2909,18 +2909,18 @@ ParseExport(WasmParseContext& c)
 }
 
 static bool
 ParseTable(WasmParseContext& c, WasmToken token, AstModule* module)
 {
     if (c.ts.getIf(WasmToken::OpenParen)) {
         if (!c.ts.match(WasmToken::Resizable, c.error))
             return false;
-        Limits table;
-        if (!ParseLimits(c, &table))
+        ResizableLimits table;
+        if (!ParseResizable(c, &table))
             return false;
         if (!c.ts.match(WasmToken::CloseParen, c.error))
             return false;
         if (!module->setTable(table)) {
             c.ts.generateError(token, c.error);
             return false;
         }
         return true;
@@ -2933,17 +2933,17 @@ ParseTable(WasmParseContext& c, WasmToke
         if (!elems.append(elem))
             return false;
     }
 
     uint32_t numElements = uint32_t(elems.length());
     if (numElements != elems.length())
         return false;
 
-    Limits r = { numElements, Some(numElements) };
+    ResizableLimits r = { numElements, Some(numElements) };
     if (!module->setTable(r)) {
         c.ts.generateError(token, c.error);
         return false;
     }
 
     auto* zero = new(c.lifo) AstConst(Val(uint32_t(0)));
     if (!zero)
         return false;
@@ -4067,43 +4067,43 @@ static bool
 EncodeBytes(Encoder& e, AstName wasmName)
 {
     TwoByteChars range(wasmName.begin(), wasmName.length());
     UniqueChars utf8(JS::CharsToNewUTF8CharsZ(nullptr, range).c_str());
     return utf8 && e.writeBytes(utf8.get(), strlen(utf8.get()));
 }
 
 static bool
-EncodeLimits(Encoder& e, const Limits& limits)
+EncodeResizable(Encoder& e, const ResizableLimits& resizable)
 {
     uint32_t flags = uint32_t(ResizableFlags::Default);
-    if (limits.maximum)
+    if (resizable.maximum)
         flags |= uint32_t(ResizableFlags::HasMaximum);
 
     if (!e.writeVarU32(flags))
         return false;
 
-    if (!e.writeVarU32(limits.initial))
+    if (!e.writeVarU32(resizable.initial))
         return false;
 
-    if (limits.maximum) {
-        if (!e.writeVarU32(*limits.maximum))
+    if (resizable.maximum) {
+        if (!e.writeVarU32(*resizable.maximum))
             return false;
     }
 
     return true;
 }
 
 static bool
-EncodeTableLimits(Encoder& e, const Limits& limits)
+EncodeResizableTable(Encoder& e, const ResizableLimits& resizable)
 {
     if (!e.writeVarU32(uint32_t(TypeConstructor::AnyFunc)))
         return false;
 
-    return EncodeLimits(e, limits);
+    return EncodeResizable(e, resizable);
 }
 
 static bool
 EncodeImport(Encoder& e, AstImport& imp)
 {
     if (!EncodeBytes(e, imp.module()))
         return false;
 
@@ -4121,21 +4121,21 @@ EncodeImport(Encoder& e, AstImport& imp)
       case DefinitionKind::Global:
         MOZ_ASSERT(!imp.global().hasInit());
         if (!e.writeValType(imp.global().type()))
             return false;
         if (!e.writeVarU32(imp.global().flags()))
             return false;
         break;
       case DefinitionKind::Table:
-        if (!EncodeTableLimits(e, imp.resizable()))
+        if (!EncodeResizableTable(e, imp.resizable()))
             return false;
         break;
       case DefinitionKind::Memory:
-        if (!EncodeLimits(e, imp.resizable()))
+        if (!EncodeResizable(e, imp.resizable()))
             return false;
         break;
     }
 
     return true;
 }
 
 static bool
@@ -4169,19 +4169,19 @@ EncodeMemorySection(Encoder& e, AstModul
     size_t offset;
     if (!e.startSection(SectionId::Memory, &offset))
         return false;
 
     uint32_t numMemories = 1;
     if (!e.writeVarU32(numMemories))
         return false;
 
-    const Limits& memory = module.memory();
-
-    if (!EncodeLimits(e, memory))
+    const ResizableLimits& memory = module.memory();
+
+    if (!EncodeResizable(e, memory))
         return false;
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeGlobalSection(Encoder& e, AstModule& module)
@@ -4268,18 +4268,18 @@ EncodeTableSection(Encoder& e, AstModule
     size_t offset;
     if (!e.startSection(SectionId::Table, &offset))
         return false;
 
     uint32_t numTables = 1;
     if (!e.writeVarU32(numTables))
         return false;
 
-    const Limits& table = module.table();
-    if (!EncodeTableLimits(e, table))
+    const ResizableLimits& table = module.table();
+    if (!EncodeResizableTable(e, table))
         return false;
 
     e.finishSection(offset);
     return true;
 }
 
 static bool
 EncodeFunctionBody(Encoder& e, AstFunc& func)
--- a/js/src/asmjs/WasmTypes.h
+++ b/js/src/asmjs/WasmTypes.h
@@ -930,17 +930,17 @@ struct Assumptions
 enum ModuleKind
 {
     Wasm,
     AsmJS
 };
 
 // Represents the resizable limits of memories and tables.
 
-struct Limits
+struct ResizableLimits
 {
     uint32_t initial;
     Maybe<uint32_t> maximum;
 };
 
 // TableDesc describes a table as well as the offset of the table's base pointer
 // in global memory. Currently, wasm only has "any function" and asm.js only
 // "typed function".
@@ -951,20 +951,20 @@ enum class TableKind
     TypedFunction
 };
 
 struct TableDesc
 {
     TableKind kind;
     bool external;
     uint32_t globalDataOffset;
-    Limits limits;
+    ResizableLimits limits;
 
     TableDesc() = default;
-    TableDesc(TableKind kind, Limits limits)
+    TableDesc(TableKind kind, ResizableLimits limits)
      : kind(kind),
        external(false),
        globalDataOffset(UINT32_MAX),
        limits(limits)
     {}
 };
 
 typedef Vector<TableDesc, 0, SystemAllocPolicy> TableDescVector;