Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: Note status of memory growth errors #894

Merged
merged 1 commit into from
Oct 19, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions document/js-api/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ urlPrefix: https://webassembly.github.io/spec/core/; spec: WebAssembly; type: df
text: const
text: address; url: exec/runtime.html#addresses
text: signed_32; url: exec/numerics.html#aux-signed
text: grow_memory; url: exec/instructions.html#exec-grow-memory
text: memory.grow; url: exec/instructions.html#exec-memory-grow
text: current frame; url: exec/conventions.html#exec-notation-textual
text: 𝗆𝗈𝖽𝗎𝗅𝖾; url: exec/runtime.html#syntax-frame
text: 𝗆𝖾𝗆𝖺𝖽𝖽𝗋𝗌; url: exec/runtime.html#syntax-moduleinst
Expand Down Expand Up @@ -612,9 +612,9 @@ which can be simultaneously referenced by multiple {{Instance}} objects. Each
1. Return |ret|.
</div>

Immediately after a WebAssembly [=grow_memory=] instruction executes, perform the following steps:
Immediately after a WebAssembly [=memory.grow=] instruction executes, perform the following steps:

<div algorithm="grow_memory">
<div algorithm="memory.grow">
1. If the top of the stack is not [=𝗂𝟥𝟤.𝖼𝗈𝗇𝗌𝗍=] (−1), then:
1. Let |frame| be the [=current frame=].
1. Assert: due to validation, |frame|.[=𝗆𝗈𝖽𝗎𝗅𝖾=].[=𝗆𝖾𝗆𝖺𝖽𝖽𝗋𝗌=][0] exists.
Expand Down Expand Up @@ -996,6 +996,16 @@ The particular exception here is implementation-defined in both cases.

Note: ECMAScript doesn't specify any sort of behavior on out-of-memory conditions; implementations have been observed to throw OOMError and to crash. Either is valid here.

<div class="issue">
A failed allocation of a large table or memory may either result in
- a {{RangeError}}, as specified in the {{Memory}} {{Memory/grow()}} and {{Table}} {{Table/grow()}} operations
- returning -1 as the [=memory.grow=] instruction
- UA-specific OOM behavior as described in this section.
In a future revision, we may reconsider more reliable and recoverable errors for allocations of large amounts of memory.

See [Issue 879](https://github.com/WebAssembly/spec/issues/879) for further discussion.
</div>

<h2 id="limits">Implementation-defined Limits</h2>

The WebAssembly core specification allows an implementation to define limits on the syntactic structure of the module.
Expand Down