Bug 1308056: Rename ResizableLimits to Limits; r=luke
☠☠ backed out by 35590eb61756 ☠ ☠
authorBenjamin Bouvier <benj@benj.me>
Mon, 10 Oct 2016 17:38:11 +0200
changeset 360364 6996ca3c1ef6cb928825a91642972a2375fb1910
parent 360363 67e3ee9b41edc9d70863704fad44a50d283bb886
child 360365 7a39a87c6bb9f6cbe5cefc9d2e36f43710e1d57f
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)
reviewersluke
bugs1308056
milestone52.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 1308056: Rename ResizableLimits to Limits; r=luke MozReview-Commit-ID: 3PUQIUk3HNw
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_;
-    ResizableLimits resizable_;
+    Limits 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, ResizableLimits resizable)
+    AstImport(AstName name, AstName module, AstName field, DefinitionKind kind, Limits 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_;
     }
-    ResizableLimits resizable() const {
+    Limits 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<ResizableLimits> table_;
-    Maybe<ResizableLimits> memory_;
+    Maybe<Limits>        table_;
+    Maybe<Limits>        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(ResizableLimits memory) {
+    bool setMemory(Limits memory) {
         if (memory_)
             return false;
         memory_.emplace(memory);
         return true;
     }
     bool hasMemory() const {
         return !!memory_;
     }
-    const ResizableLimits& memory() const {
+    const Limits& memory() const {
         return *memory_;
     }
-    bool setTable(ResizableLimits table) {
+    bool setTable(Limits table) {
         if (table_)
             return false;
         table_.emplace(table);
         return true;
     }
     bool hasTable() const {
         return !!table_;
     }
-    const ResizableLimits& table() const {
+    const Limits& 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::DecodeResizable(Decoder& d, ResizableLimits* limits)
+wasm::DecodeLimits(Decoder& d, Limits* 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 ResizableLimits;
+struct Limits;
 
 MOZ_MUST_USE bool
-DecodeResizable(Decoder& d, ResizableLimits* resizable);
+DecodeLimits(Decoder& d, Limits* limits);
 
 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");
 
-    ResizableLimits table;
-    if (!DecodeResizable(c.d, &table))
+    Limits table;
+    if (!DecodeLimits(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
-AstDecodeResizableTable(AstDecodeContext& c, ResizableLimits* resizable)
+AstDecodeLimitsTable(AstDecodeContext& c, Limits* limits)
 {
     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 (!DecodeResizable(c.d, resizable))
+    if (!DecodeLimits(c.d, limits))
         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): {
-        ResizableLimits table;
-        if (!AstDecodeResizableTable(c, &table))
+        Limits table;
+        if (!AstDecodeLimitsTable(c, &table))
             return false;
 
         *import = new(c.lifo) AstImport(importName, moduleName, fieldName,
                                         DefinitionKind::Table, table);
         break;
       }
       case uint32_t(DefinitionKind::Memory): {
-        ResizableLimits memory;
-        if (!DecodeResizable(c.d, &memory))
+        Limits memory;
+        if (!DecodeLimits(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");
 
-    ResizableLimits memory;
-    if (!DecodeResizable(c.d, &memory))
+    Limits memory;
+    if (!DecodeLimits(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");
 
-    ResizableLimits limits;
-    if (!DecodeResizable(d, &limits))
+    Limits limits;
+    if (!DecodeLimits(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");
 
-    ResizableLimits limits;
-    if (!DecodeResizable(d, &limits))
+    Limits limits;
+    if (!DecodeLimits(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
-GetResizableLimits(JSContext* cx, HandleObject obj, uint32_t max, const char* kind,
-                   ResizableLimits* limits)
+GetLimits(JSContext* cx, HandleObject obj, uint32_t max, const char* kind,
+          Limits* 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());
-    ResizableLimits limits;
-    if (!GetResizableLimits(cx, obj, UINT32_MAX / PageSize, "Memory", &limits))
+    Limits limits;
+    if (!GetLimits(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, ResizableLimits limits)
+WasmTableObject::create(JSContext* cx, Limits 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;
     }
 
-    ResizableLimits limits;
-    if (!GetResizableLimits(cx, obj, UINT32_MAX, "Table", &limits))
+    Limits limits;
+    if (!GetLimits(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::ResizableLimits limits);
+    static WasmTableObject* create(JSContext* cx, wasm::Limits limits);
     wasm::Table& table() const;
 };
 
 } // namespace js
 
 #endif // wasm_js_h
--- a/js/src/asmjs/WasmModule.cpp
+++ b/js/src/asmjs/WasmModule.cpp
@@ -498,36 +498,33 @@ Module::instantiateFunctions(JSContext* 
             return false;
         }
     }
 
     return true;
 }
 
 static bool
-CheckResizableLimits(JSContext* cx, uint32_t declaredMin, Maybe<uint32_t> declaredMax,
-                     uint32_t actualLength, Maybe<uint32_t> actualMax,
-                     bool isAsmJS, const char* kind)
+CheckLimits(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
@@ -544,19 +541,18 @@ 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 (!CheckResizableLimits(cx, declaredMin, declaredMax,
-                                  buffer.byteLength(), buffer.wasmMaxSize(),
-                                  metadata_->isAsmJS(), "Memory")) {
+        if (!CheckLimits(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));
@@ -580,19 +576,18 @@ 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 (!CheckResizableLimits(cx, td.limits.initial, td.limits.maximum,
-                                  table.length(), table.maximum(),
-                                  metadata_->isAsmJS(), "Table")) {
+        if (!CheckLimits(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
-ParseResizable(WasmParseContext& c, ResizableLimits* resizable)
+ParseLimits(WasmParseContext& c, Limits* 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());
 
-    ResizableLimits r = { initial.index(), maximum };
+    Limits 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;
         }
 
-        ResizableLimits memory = { uint32_t(pages), Some(uint32_t(pages)) };
+        Limits 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;
     }
 
-    ResizableLimits memory;
-    if (!ParseResizable(c, &memory))
+    Limits memory;
+    if (!ParseLimits(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)) {
-            ResizableLimits memory;
-            if (!ParseResizable(c, &memory))
+            Limits memory;
+            if (!ParseLimits(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)) {
-            ResizableLimits table;
-            if (!ParseResizable(c, &table))
+            Limits table;
+            if (!ParseLimits(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;
-        ResizableLimits table;
-        if (!ParseResizable(c, &table))
+        Limits table;
+        if (!ParseLimits(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;
 
-    ResizableLimits r = { numElements, Some(numElements) };
+    Limits 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
-EncodeResizable(Encoder& e, const ResizableLimits& resizable)
+EncodeLimits(Encoder& e, const Limits& limits)
 {
     uint32_t flags = uint32_t(ResizableFlags::Default);
-    if (resizable.maximum)
+    if (limits.maximum)
         flags |= uint32_t(ResizableFlags::HasMaximum);
 
     if (!e.writeVarU32(flags))
         return false;
 
-    if (!e.writeVarU32(resizable.initial))
+    if (!e.writeVarU32(limits.initial))
         return false;
 
-    if (resizable.maximum) {
-        if (!e.writeVarU32(*resizable.maximum))
+    if (limits.maximum) {
+        if (!e.writeVarU32(*limits.maximum))
             return false;
     }
 
     return true;
 }
 
 static bool
-EncodeResizableTable(Encoder& e, const ResizableLimits& resizable)
+EncodeTableLimits(Encoder& e, const Limits& limits)
 {
     if (!e.writeVarU32(uint32_t(TypeConstructor::AnyFunc)))
         return false;
 
-    return EncodeResizable(e, resizable);
+    return EncodeLimits(e, limits);
 }
 
 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 (!EncodeResizableTable(e, imp.resizable()))
+        if (!EncodeTableLimits(e, imp.resizable()))
             return false;
         break;
       case DefinitionKind::Memory:
-        if (!EncodeResizable(e, imp.resizable()))
+        if (!EncodeLimits(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 ResizableLimits& memory = module.memory();
-
-    if (!EncodeResizable(e, memory))
+    const Limits& memory = module.memory();
+
+    if (!EncodeLimits(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 ResizableLimits& table = module.table();
-    if (!EncodeResizableTable(e, table))
+    const Limits& table = module.table();
+    if (!EncodeTableLimits(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 ResizableLimits
+struct Limits
 {
     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;
-    ResizableLimits limits;
+    Limits limits;
 
     TableDesc() = default;
-    TableDesc(TableKind kind, ResizableLimits limits)
+    TableDesc(TableKind kind, Limits limits)
      : kind(kind),
        external(false),
        globalDataOffset(UINT32_MAX),
        limits(limits)
     {}
 };
 
 typedef Vector<TableDesc, 0, SystemAllocPolicy> TableDescVector;