summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-s-parser.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2020-11-13 15:54:08 -0800
committerGitHub <noreply@github.com>2020-11-13 15:54:08 -0800
commit75e61204b67e921464af14fd13ff768d88755e8c (patch)
tree969ddb2e4e2870fef662375914f16fc50713cd4c /src/wasm/wasm-s-parser.cpp
parentcc2b3e4175a6edc53487eec06da13b39eb66716b (diff)
downloadbinaryen-75e61204b67e921464af14fd13ff768d88755e8c.tar.gz
binaryen-75e61204b67e921464af14fd13ff768d88755e8c.tar.bz2
binaryen-75e61204b67e921464af14fd13ff768d88755e8c.zip
Rename atomic.notify and *.atomic.wait (#3353)
- atomic.notify -> memory.atomic.notify - i32.atomic.wait -> memory.atomic.wait32 - i64.atomic.wait -> memory.atomic.wait64 See WebAssembly/threads#149. This renames instruction name printing but not the internal data structure names, such as `AtomicNotify`, which are not always the same as printed instruction names anyway. This also does not modify C API. But this fixes interface functions in binaryen.js because it seems binaryen.js's interface functions all follow the corresponding instruction names.
Diffstat (limited to 'src/wasm/wasm-s-parser.cpp')
-rw-r--r--src/wasm/wasm-s-parser.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wasm/wasm-s-parser.cpp b/src/wasm/wasm-s-parser.cpp
index 6c552781b..34e1eb8a6 100644
--- a/src/wasm/wasm-s-parser.cpp
+++ b/src/wasm/wasm-s-parser.cpp
@@ -1463,11 +1463,12 @@ Expression* SExpressionWasmBuilder::makeAtomicWait(Element& s, Type type) {
} else if (type == Type::i64) {
expectedAlign = 8;
} else {
- WASM_UNREACHABLE("Invalid prefix for atomic.wait");
+ WASM_UNREACHABLE("Invalid prefix for memory.atomic.wait");
}
size_t i = parseMemAttributes(s, ret->offset, align, expectedAlign);
if (align != expectedAlign) {
- throw ParseException("Align of atomic.wait must match size", s.line, s.col);
+ throw ParseException(
+ "Align of memory.atomic.wait must match size", s.line, s.col);
}
ret->ptr = parseExpression(s[i]);
ret->expected = parseExpression(s[i + 1]);
@@ -1482,7 +1483,8 @@ Expression* SExpressionWasmBuilder::makeAtomicNotify(Element& s) {
Address align;
size_t i = parseMemAttributes(s, ret->offset, align, 4);
if (align != 4) {
- throw ParseException("Align of atomic.notify must be 4", s.line, s.col);
+ throw ParseException(
+ "Align of memory.atomic.notify must be 4", s.line, s.col);
}
ret->ptr = parseExpression(s[i]);
ret->notifyCount = parseExpression(s[i + 1]);