Bug 1615434 - Increase maximum initial memory size to 2GiB. r=lth

The spec no longer has an initial memory size limit, so we should allow up to
the limit imposed upon us by ArrayBuffer.

Differential Revision: https://phabricator.services.mozilla.com/D80140
This commit is contained in:
Ryan Hunt 2020-06-23 23:06:34 +00:00
Родитель f8f16d85fd
Коммит 8e87798b9f
3 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -840,6 +840,11 @@ enum class NameType { Module = 0, Function = 1, Local = 2 };
enum class FieldFlags { Mutable = 0x01, AllowedMask = 0x01 };
// The WebAssembly spec hard-codes the virtual page size to be 64KiB and
// requires the size of linear memory to always be a multiple of 64KiB.
static const unsigned PageSize = 64 * 1024;
// These limits are agreed upon with other engines for consistency.
static const unsigned MaxTypes = 1000000;
@ -861,7 +866,7 @@ static const unsigned MaxParams = 1000;
static const unsigned MaxResults = 1000;
static const unsigned MaxStructFields = 1000;
static const unsigned MaxMemoryLimitField = 65536;
static const unsigned MaxMemoryPages = 16384;
static const unsigned MaxMemoryPages = INT32_MAX / PageSize;
static const unsigned MaxStringBytes = 100000;
static const unsigned MaxModuleBytes = 1024 * 1024 * 1024;
static const unsigned MaxFunctionBytes = 7654321;

Просмотреть файл

@ -45,6 +45,10 @@ using mozilla::MakeEnumeratedRange;
# endif
#endif
static_assert(MaxMemoryPages ==
ArrayBufferObject::MaxBufferByteLength / PageSize,
"invariant");
// All plausible targets must be able to do at least IEEE754 double
// loads/stores, hence the lower limit of 8. Some Intel processors support
// AVX-512 loads/stores, hence the upper limit of 64.

Просмотреть файл

@ -3098,11 +3098,6 @@ extern bool IsValidARMImmediate(uint32_t i);
extern uint64_t RoundUpToNextValidARMImmediate(uint64_t i);
// The WebAssembly spec hard-codes the virtual page size to be 64KiB and
// requires the size of linear memory to always be a multiple of 64KiB.
static const unsigned PageSize = 64 * 1024;
// Bounds checks always compare the base of the memory access with the bounds
// check limit. If the memory access is unaligned, this means that, even if the
// bounds check succeeds, a few bytes of the access can extend past the end of