From b13b5d14f8b27380e91d1259a8ad060eb2703faa Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 22 Mar 2023 11:28:49 -0700 Subject: [PATCH 1/3] Document new implementation-defined limits in MVP.md Based on discussion in #335 and subgroup meetings. --- proposals/gc/MVP.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/proposals/gc/MVP.md b/proposals/gc/MVP.md index c7eeccb3b..aed8e49fd 100644 --- a/proposals/gc/MVP.md +++ b/proposals/gc/MVP.md @@ -779,6 +779,14 @@ The opcode for heap types is encoded as an `s33`. | 0xfb70 | `extern.internalize` | | | 0xfb71 | `extern.externalize` | | +## Implementation-defined Limits + +The following limits will be added to the Implementation-defined Limits [section](https://webassembly.github.io/spec/js-api/index.html#limits) of the JS API. + + - The maximum number of recursion groups is 1000000. (The maximum number of individual types remains unchanged and is also 1000000.) + - The maximum number of struct fields is 10000. + - The maximum number of operands to `array.new_fixed` is 10000. + - The maximum length of a supertype chain is 63. (A type declared with no supertypes has a supertype chain of length 0) ## JS API From 3ba53e1cae7fd689d6af394112ba4aa76c1a2e1b Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 22 Mar 2023 18:38:50 -0700 Subject: [PATCH 2/3] move to actual js doc --- document/js-api/index.bs | 4 ++++ proposals/gc/MVP.md | 12 +----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/document/js-api/index.bs b/document/js-api/index.bs index 2f3588843..be2b3a137 100644 --- a/document/js-api/index.bs +++ b/document/js-api/index.bs @@ -1398,6 +1398,8 @@ In practice, an implementation may run out of resources for valid modules below An implementation must throw a {{RuntimeError}} if one of the following limits is exceeded during runtime: diff --git a/proposals/gc/MVP.md b/proposals/gc/MVP.md index aed8e49fd..c8b6658cb 100644 --- a/proposals/gc/MVP.md +++ b/proposals/gc/MVP.md @@ -779,19 +779,9 @@ The opcode for heap types is encoded as an `s33`. | 0xfb70 | `extern.internalize` | | | 0xfb71 | `extern.externalize` | | -## Implementation-defined Limits - -The following limits will be added to the Implementation-defined Limits [section](https://webassembly.github.io/spec/js-api/index.html#limits) of the JS API. - - - The maximum number of recursion groups is 1000000. (The maximum number of individual types remains unchanged and is also 1000000.) - - The maximum number of struct fields is 10000. - - The maximum number of operands to `array.new_fixed` is 10000. - - The maximum length of a supertype chain is 63. (A type declared with no supertypes has a supertype chain of length 0) - ## JS API -See [GC JS API document](MVP-JS.md) . - +See [GC JS API document](../../document/js-api/index.bs). ## Questions From ab3147b532933a0046930d9274d9103b2b45af3f Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Thu, 23 Mar 2023 10:11:43 -0700 Subject: [PATCH 3/3] add to MVP-JS.md and spec docs --- proposals/gc/MVP-JS.md | 13 +++++++++++++ proposals/gc/MVP.md | 5 +++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/proposals/gc/MVP-JS.md b/proposals/gc/MVP-JS.md index eacfc4141..d8ba1d9db 100644 --- a/proposals/gc/MVP-JS.md +++ b/proposals/gc/MVP-JS.md @@ -69,3 +69,16 @@ internal reference value that is being externalized: _TODO: avoid having to patch the behavior of `extern.internalize` and `extern.internalize` by converting to/from JS numbers separately._ + +## Implementation-defined Limits + +The following limits will be added to the Implementation-defined Limits +[section](https://webassembly.github.io/spec/js-api/index.html#limits) of the JS +API. + + - The maximum number of recursion groups is 1000000. (The maximum number of + individual types remains unchanged and is also 1000000.) + - The maximum number of struct fields is 10000. + - The maximum number of operands to `array.new_fixed` is 10000. + - The maximum length of a supertype chain is 63. (A type declared with no + supertypes has a supertype chain of length 0) diff --git a/proposals/gc/MVP.md b/proposals/gc/MVP.md index c8b6658cb..9f058438d 100644 --- a/proposals/gc/MVP.md +++ b/proposals/gc/MVP.md @@ -108,7 +108,7 @@ New abbreviations are introduced for reference types in binary and text format, - `module ::= {..., types vec()}` - a `rec` definition defines a group of mutually recursive types that can refer to each other; it thereby defines several type indices at a time - a single type definition, as in Wasm before this proposal, is reinterpreted as a short-hand for a recursive group containing just one type - - Note that the number of type section entries is now the number of recursion groups rather than the number of individual types. + - Note that the number of type section entries is now the number of recursion groups rather than the number of individual types. * `subtype` is a new category of type defining a single type, as a subtype of possible other types - `subtype ::= sub final? * ` @@ -779,9 +779,10 @@ The opcode for heap types is encoded as an `s33`. | 0xfb70 | `extern.internalize` | | | 0xfb71 | `extern.externalize` | | + ## JS API -See [GC JS API document](../../document/js-api/index.bs). +See [GC JS API document](MVP-JS.md). ## Questions