summaryrefslogtreecommitdiff
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
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.
-rw-r--r--CHANGELOG.md4
-rwxr-xr-xscripts/gen-s-parser.py6
-rw-r--r--src/binaryen-c.h28
-rw-r--r--src/gen-s-parser.inc39
-rw-r--r--src/js/binaryen.js-post.js20
-rw-r--r--src/passes/Print.cpp6
-rw-r--r--src/wasm/wasm-s-parser.cpp8
-rw-r--r--test/atomics.wast12
-rw-r--r--test/atomics.wast.from-wast12
-rw-r--r--test/atomics.wast.fromBinary12
-rw-r--r--test/atomics.wast.fromBinary.noDebugInfo12
-rw-r--r--test/atomics64.wast12
-rw-r--r--test/atomics64.wast.from-wast12
-rw-r--r--test/atomics64.wast.fromBinary12
-rw-r--r--test/atomics64.wast.fromBinary.noDebugInfo12
-rw-r--r--test/binaryen.js/atomics.js6
-rw-r--r--test/binaryen.js/atomics.js.txt6
-rw-r--r--test/binaryen.js/expressions.js8
-rw-r--r--test/binaryen.js/expressions.js.txt4
-rw-r--r--test/binaryen.js/kitchen-sink.js4
-rw-r--r--test/binaryen.js/kitchen-sink.js.txt8
-rw-r--r--test/example/c-api-kitchen-sink.txt4
-rw-r--r--test/example/c-api-kitchen-sink.txt.txt4
-rw-r--r--test/extra-unreachable.wast6
-rw-r--r--test/extra-unreachable.wast.from-wast4
-rw-r--r--test/passes/fuzz-exec_all-features.txt4
-rw-r--r--test/passes/fuzz-exec_all-features.wast4
-rw-r--r--test/passes/remove-unused-module-elements_all-features.txt4
-rw-r--r--test/passes/remove-unused-module-elements_all-features.wast4
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.txt4
-rw-r--r--test/passes/remove-unused-nonfunction-module-elements_all-features.wast4
-rw-r--r--test/unreachable-instr-type.wast2
-rw-r--r--test/unreachable-instr-type.wast.from-wast2
-rw-r--r--test/wasm2js/atomics_32.wast6
34 files changed, 155 insertions, 140 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bfae16e89..9bfab9c04 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -15,6 +15,10 @@ full changeset diff at the end of each section.
Current Trunk
-------------
+- JS API functions for atomic notify/wait instructions are renamed.
+ - `module.atomic.notify` -> `module.memory.atomic.notify`
+ - `module.i32.atomic.wait` -> `module.memory.atomic.wait32`
+ - `module.i64.atomic.wait` -> `module.memory.atomic.wait64`
- Remove old/broken SpollPointers pass. This pass: Spills values that might be
pointers to the C stack. This allows Boehm-style GC to see them properly.
This can be revived if needed from git history (#3261).
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index 281eea185..fc3a5b522 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -201,9 +201,9 @@ instructions = [
("i64.extend16_s", "makeUnary(s, UnaryOp::ExtendS16Int64)"),
("i64.extend32_s", "makeUnary(s, UnaryOp::ExtendS32Int64)"),
# atomic instructions
- ("atomic.notify", "makeAtomicNotify(s)"),
- ("i32.atomic.wait", "makeAtomicWait(s, Type::i32)"),
- ("i64.atomic.wait", "makeAtomicWait(s, Type::i64)"),
+ ("memory.atomic.notify", "makeAtomicNotify(s)"),
+ ("memory.atomic.wait32", "makeAtomicWait(s, Type::i32)"),
+ ("memory.atomic.wait64", "makeAtomicWait(s, Type::i64)"),
("atomic.fence", "makeAtomicFence(s)"),
("i32.atomic.load8_u", "makeLoad(s, Type::i32, /*isAtomic=*/true)"),
("i32.atomic.load16_u", "makeLoad(s, Type::i32, /*isAtomic=*/true)"),
diff --git a/src/binaryen-c.h b/src/binaryen-c.h
index c185b59f4..45beb3657 100644
--- a/src/binaryen-c.h
+++ b/src/binaryen-c.h
@@ -1404,47 +1404,47 @@ BinaryenAtomicCmpxchgSetReplacement(BinaryenExpressionRef expr,
// AtomicWait
-// Gets the pointer expression of an `atomic.wait` expression.
+// Gets the pointer expression of an `memory.atomic.wait` expression.
BINARYEN_API BinaryenExpressionRef
BinaryenAtomicWaitGetPtr(BinaryenExpressionRef expr);
-// Sets the pointer expression of an `atomic.wait` expression.
+// Sets the pointer expression of an `memory.atomic.wait` expression.
BINARYEN_API void BinaryenAtomicWaitSetPtr(BinaryenExpressionRef expr,
BinaryenExpressionRef ptrExpr);
-// Gets the expression representing the expected value of an `atomic.wait`
-// expression.
+// Gets the expression representing the expected value of an
+// `memory.atomic.wait` expression.
BINARYEN_API BinaryenExpressionRef
BinaryenAtomicWaitGetExpected(BinaryenExpressionRef expr);
-// Sets the expression representing the expected value of an `atomic.wait`
-// expression.
+// Sets the expression representing the expected value of an
+// `memory.atomic.wait` expression.
BINARYEN_API void
BinaryenAtomicWaitSetExpected(BinaryenExpressionRef expr,
BinaryenExpressionRef expectedExpr);
-// Gets the timeout expression of an `atomic.wait` expression.
+// Gets the timeout expression of an `memory.atomic.wait` expression.
BINARYEN_API BinaryenExpressionRef
BinaryenAtomicWaitGetTimeout(BinaryenExpressionRef expr);
-// Sets the timeout expression of an `atomic.wait` expression.
+// Sets the timeout expression of an `memory.atomic.wait` expression.
BINARYEN_API void
BinaryenAtomicWaitSetTimeout(BinaryenExpressionRef expr,
BinaryenExpressionRef timeoutExpr);
-// Gets the expected type of an `atomic.wait` expression.
+// Gets the expected type of an `memory.atomic.wait` expression.
BINARYEN_API BinaryenType
BinaryenAtomicWaitGetExpectedType(BinaryenExpressionRef expr);
-// Sets the expected type of an `atomic.wait` expression.
+// Sets the expected type of an `memory.atomic.wait` expression.
BINARYEN_API void BinaryenAtomicWaitSetExpectedType(BinaryenExpressionRef expr,
BinaryenType expectedType);
// AtomicNotify
-// Gets the pointer expression of an `atomic.notify` expression.
+// Gets the pointer expression of an `memory.atomic.notify` expression.
BINARYEN_API BinaryenExpressionRef
BinaryenAtomicNotifyGetPtr(BinaryenExpressionRef expr);
-// Sets the pointer expression of an `atomic.notify` expression.
+// Sets the pointer expression of an `memory.atomic.notify` expression.
BINARYEN_API void BinaryenAtomicNotifySetPtr(BinaryenExpressionRef expr,
BinaryenExpressionRef ptrExpr);
-// Gets the notify count expression of an `atomic.notify` expression.
+// Gets the notify count expression of an `memory.atomic.notify` expression.
BINARYEN_API BinaryenExpressionRef
BinaryenAtomicNotifyGetNotifyCount(BinaryenExpressionRef expr);
-// Sets the notify count expression of an `atomic.notify` expression.
+// Sets the notify count expression of an `memory.atomic.notify` expression.
BINARYEN_API void
BinaryenAtomicNotifySetNotifyCount(BinaryenExpressionRef expr,
BinaryenExpressionRef notifyCountExpr);
diff --git a/src/gen-s-parser.inc b/src/gen-s-parser.inc
index 87a19fb82..a62d9fdc6 100644
--- a/src/gen-s-parser.inc
+++ b/src/gen-s-parser.inc
@@ -50,17 +50,9 @@ switch (op[0]) {
default: goto parse_error;
}
}
- case 't': {
- switch (op[7]) {
- case 'f':
- if (strcmp(op, "atomic.fence") == 0) { return makeAtomicFence(s); }
- goto parse_error;
- case 'n':
- if (strcmp(op, "atomic.notify") == 0) { return makeAtomicNotify(s); }
- goto parse_error;
- default: goto parse_error;
- }
- }
+ case 't':
+ if (strcmp(op, "atomic.fence") == 0) { return makeAtomicFence(s); }
+ goto parse_error;
default: goto parse_error;
}
}
@@ -1224,9 +1216,6 @@ switch (op[0]) {
default: goto parse_error;
}
}
- case 'w':
- if (strcmp(op, "i32.atomic.wait") == 0) { return makeAtomicWait(s, Type::i32); }
- goto parse_error;
default: goto parse_error;
}
}
@@ -1976,9 +1965,6 @@ switch (op[0]) {
default: goto parse_error;
}
}
- case 'w':
- if (strcmp(op, "i64.atomic.wait") == 0) { return makeAtomicWait(s, Type::i64); }
- goto parse_error;
default: goto parse_error;
}
}
@@ -2676,6 +2662,25 @@ switch (op[0]) {
}
case 'm': {
switch (op[7]) {
+ case 'a': {
+ switch (op[14]) {
+ case 'n':
+ if (strcmp(op, "memory.atomic.notify") == 0) { return makeAtomicNotify(s); }
+ goto parse_error;
+ case 'w': {
+ switch (op[18]) {
+ case '3':
+ if (strcmp(op, "memory.atomic.wait32") == 0) { return makeAtomicWait(s, Type::i32); }
+ goto parse_error;
+ case '6':
+ if (strcmp(op, "memory.atomic.wait64") == 0) { return makeAtomicWait(s, Type::i64); }
+ goto parse_error;
+ default: goto parse_error;
+ }
+ }
+ default: goto parse_error;
+ }
+ }
case 'c':
if (strcmp(op, "memory.copy") == 0) { return makeMemoryCopy(s); }
goto parse_error;
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js
index c35c6ed29..b78fdd996 100644
--- a/src/js/binaryen.js-post.js
+++ b/src/js/binaryen.js-post.js
@@ -629,6 +629,17 @@ function wrapModule(module, self = {}) {
},
'fill'(dest, value, size) {
return Module['_BinaryenMemoryFill'](module, dest, value, size);
+ },
+ 'atomic': {
+ 'notify'(ptr, notifyCount) {
+ return Module['_BinaryenAtomicNotify'](module, ptr, notifyCount);
+ },
+ 'wait32'(ptr, expected, timeout) {
+ return Module['_BinaryenAtomicWait'](module, ptr, expected, timeout, Module['i32']);
+ },
+ 'wait64'(ptr, expected, timeout) {
+ return Module['_BinaryenAtomicWait'](module, ptr, expected, timeout, Module['i64']);
+ }
}
}
@@ -889,9 +900,6 @@ function wrapModule(module, self = {}) {
return Module['_BinaryenAtomicCmpxchg'](module, 2, offset, ptr, expected, replacement, Module['i32'])
},
},
- 'wait'(ptr, expected, timeout) {
- return Module['_BinaryenAtomicWait'](module, ptr, expected, timeout, Module['i32']);
- }
},
'pop'() {
return Module['_BinaryenPop'](module, Module['i32']);
@@ -1193,9 +1201,6 @@ function wrapModule(module, self = {}) {
return Module['_BinaryenAtomicCmpxchg'](module, 4, offset, ptr, expected, replacement, Module['i64'])
},
},
- 'wait'(ptr, expected, timeout) {
- return Module['_BinaryenAtomicWait'](module, ptr, expected, timeout, Module['i64']);
- }
},
'pop'() {
return Module['_BinaryenPop'](module, Module['i64']);
@@ -2132,9 +2137,6 @@ function wrapModule(module, self = {}) {
};
self['atomic'] = {
- 'notify'(ptr, notifyCount) {
- return Module['_BinaryenAtomicNotify'](module, ptr, notifyCount);
- },
'fence'() {
return Module['_BinaryenAtomicFence'](module);
}
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index e653e85bd..e512d398f 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -317,13 +317,15 @@ struct PrintExpressionContents
}
void visitAtomicWait(AtomicWait* curr) {
prepareColor(o);
- o << forceConcrete(curr->expectedType) << ".atomic.wait";
+ Type type = forceConcrete(curr->expectedType);
+ assert(type == Type::i32 || type == Type::i64);
+ o << "memory.atomic.wait" << (type == Type::i32 ? "32" : "64");
if (curr->offset) {
o << " offset=" << curr->offset;
}
}
void visitAtomicNotify(AtomicNotify* curr) {
- printMedium(o, "atomic.notify");
+ printMedium(o, "memory.atomic.notify");
if (curr->offset) {
o << " offset=" << curr->offset;
}
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]);
diff --git a/test/atomics.wast b/test/atomics.wast
index 9cce84ccd..792772a51 100644
--- a/test/atomics.wast
+++ b/test/atomics.wast
@@ -138,40 +138,40 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (i32.atomic.wait offset=4 align=4
+ (memory.atomic.wait32 offset=4 align=4
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
- (atomic.notify offset=24 align=4
+ (memory.atomic.notify offset=24 align=4
(local.get $0)
(local.get $0)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $0)
(local.get $1)
(local.get $1)
)
)
(drop
- (i64.atomic.wait align=8 offset=16
+ (memory.atomic.wait64 align=8 offset=16
(local.get $0)
(local.get $1)
(local.get $1)
diff --git a/test/atomics.wast.from-wast b/test/atomics.wast.from-wast
index 70eda655a..5140f3901 100644
--- a/test/atomics.wast.from-wast
+++ b/test/atomics.wast.from-wast
@@ -138,40 +138,40 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (i32.atomic.wait offset=4
+ (memory.atomic.wait32 offset=4
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
- (atomic.notify offset=24
+ (memory.atomic.notify offset=24
(local.get $0)
(local.get $0)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $0)
(local.get $1)
(local.get $1)
)
)
(drop
- (i64.atomic.wait offset=16
+ (memory.atomic.wait64 offset=16
(local.get $0)
(local.get $1)
(local.get $1)
diff --git a/test/atomics.wast.fromBinary b/test/atomics.wast.fromBinary
index 2710c58d5..c9ce94c70 100644
--- a/test/atomics.wast.fromBinary
+++ b/test/atomics.wast.fromBinary
@@ -138,40 +138,40 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (i32.atomic.wait offset=4
+ (memory.atomic.wait32 offset=4
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
- (atomic.notify offset=24
+ (memory.atomic.notify offset=24
(local.get $0)
(local.get $0)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $0)
(local.get $1)
(local.get $1)
)
)
(drop
- (i64.atomic.wait offset=16
+ (memory.atomic.wait64 offset=16
(local.get $0)
(local.get $1)
(local.get $1)
diff --git a/test/atomics.wast.fromBinary.noDebugInfo b/test/atomics.wast.fromBinary.noDebugInfo
index 049a86282..e562f6a42 100644
--- a/test/atomics.wast.fromBinary.noDebugInfo
+++ b/test/atomics.wast.fromBinary.noDebugInfo
@@ -138,40 +138,40 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (i32.atomic.wait offset=4
+ (memory.atomic.wait32 offset=4
(local.get $0)
(local.get $0)
(local.get $1)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $0)
(local.get $0)
)
)
(drop
- (atomic.notify offset=24
+ (memory.atomic.notify offset=24
(local.get $0)
(local.get $0)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $0)
(local.get $1)
(local.get $1)
)
)
(drop
- (i64.atomic.wait offset=16
+ (memory.atomic.wait64 offset=16
(local.get $0)
(local.get $1)
(local.get $1)
diff --git a/test/atomics64.wast b/test/atomics64.wast
index c3855a717..6ccab9cfa 100644
--- a/test/atomics64.wast
+++ b/test/atomics64.wast
@@ -142,40 +142,40 @@
(local $1 i64)
(local $2 i32)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $2)
(local.get $1)
)
)
(drop
- (i32.atomic.wait offset=4 align=4
+ (memory.atomic.wait32 offset=4 align=4
(local.get $0)
(local.get $2)
(local.get $1)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $0)
(local.get $2)
)
)
(drop
- (atomic.notify offset=24 align=4
+ (memory.atomic.notify offset=24 align=4
(local.get $0)
(local.get $2)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $0)
(local.get $1)
(local.get $1)
)
)
(drop
- (i64.atomic.wait align=8 offset=16
+ (memory.atomic.wait64 align=8 offset=16
(local.get $0)
(local.get $1)
(local.get $1)
diff --git a/test/atomics64.wast.from-wast b/test/atomics64.wast.from-wast
index f9ae56d17..ee4eb1bdf 100644
--- a/test/atomics64.wast.from-wast
+++ b/test/atomics64.wast.from-wast
@@ -142,40 +142,40 @@
(local $1 i64)
(local $2 i32)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $2)
(local.get $1)
)
)
(drop
- (i32.atomic.wait offset=4
+ (memory.atomic.wait32 offset=4
(local.get $0)
(local.get $2)
(local.get $1)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $0)
(local.get $2)
)
)
(drop
- (atomic.notify offset=24
+ (memory.atomic.notify offset=24
(local.get $0)
(local.get $2)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $0)
(local.get $1)
(local.get $1)
)
)
(drop
- (i64.atomic.wait offset=16
+ (memory.atomic.wait64 offset=16
(local.get $0)
(local.get $1)
(local.get $1)
diff --git a/test/atomics64.wast.fromBinary b/test/atomics64.wast.fromBinary
index 1dcf24a1e..fc405c15c 100644
--- a/test/atomics64.wast.fromBinary
+++ b/test/atomics64.wast.fromBinary
@@ -142,40 +142,40 @@
(local $1 i64)
(local $2 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $1)
(local.get $0)
(local.get $2)
)
)
(drop
- (i32.atomic.wait offset=4
+ (memory.atomic.wait32 offset=4
(local.get $1)
(local.get $0)
(local.get $2)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $1)
(local.get $0)
)
)
(drop
- (atomic.notify offset=24
+ (memory.atomic.notify offset=24
(local.get $1)
(local.get $0)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $1)
(local.get $2)
(local.get $2)
)
)
(drop
- (i64.atomic.wait offset=16
+ (memory.atomic.wait64 offset=16
(local.get $1)
(local.get $2)
(local.get $2)
diff --git a/test/atomics64.wast.fromBinary.noDebugInfo b/test/atomics64.wast.fromBinary.noDebugInfo
index cffb1491e..afa8a3b7c 100644
--- a/test/atomics64.wast.fromBinary.noDebugInfo
+++ b/test/atomics64.wast.fromBinary.noDebugInfo
@@ -142,40 +142,40 @@
(local $1 i64)
(local $2 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $1)
(local.get $0)
(local.get $2)
)
)
(drop
- (i32.atomic.wait offset=4
+ (memory.atomic.wait32 offset=4
(local.get $1)
(local.get $0)
(local.get $2)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(local.get $1)
(local.get $0)
)
)
(drop
- (atomic.notify offset=24
+ (memory.atomic.notify offset=24
(local.get $1)
(local.get $0)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(local.get $1)
(local.get $2)
(local.get $2)
)
)
(drop
- (i64.atomic.wait offset=16
+ (memory.atomic.wait64 offset=16
(local.get $1)
(local.get $2)
(local.get $2)
diff --git a/test/binaryen.js/atomics.js b/test/binaryen.js/atomics.js
index bd4b898bd..ce68656e0 100644
--- a/test/binaryen.js/atomics.js
+++ b/test/binaryen.js/atomics.js
@@ -59,21 +59,21 @@ module.addFunction("main", binaryen.none, binaryen.none, [], module.block("", [
),
// wait and notify
module.drop(
- module.i32.atomic.wait(
+ module.memory.atomic.wait32(
module.i32.const(0),
module.i32.const(0),
module.i64.const(0)
)
),
module.drop(
- module.i64.atomic.wait(
+ module.memory.atomic.wait64(
module.i32.const(0),
module.i64.const(0),
module.i64.const(0)
)
),
module.drop(
- module.atomic.notify(
+ module.memory.atomic.notify(
module.i32.const(0),
module.i32.const(0)
)
diff --git a/test/binaryen.js/atomics.js.txt b/test/binaryen.js/atomics.js.txt
index a58647617..091298d57 100644
--- a/test/binaryen.js/atomics.js.txt
+++ b/test/binaryen.js/atomics.js.txt
@@ -45,21 +45,21 @@
)
)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(i32.const 0)
(i32.const 0)
(i64.const 0)
)
)
(drop
- (i64.atomic.wait
+ (memory.atomic.wait64
(i32.const 0)
(i64.const 0)
(i64.const 0)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(i32.const 0)
(i32.const 0)
)
diff --git a/test/binaryen.js/expressions.js b/test/binaryen.js/expressions.js
index 0d48e5551..a340adcbe 100644
--- a/test/binaryen.js/expressions.js
+++ b/test/binaryen.js/expressions.js
@@ -901,7 +901,7 @@ console.log("# AtomicWait");
var ptr = module.i32.const(2);
var expected = module.i32.const(3);
var timeout = module.i64.const(4);
- const theAtomicWait = binaryen.AtomicWait(module.i32.atomic.wait(ptr, expected, timeout));
+ const theAtomicWait = binaryen.AtomicWait(module.memory.atomic.wait32(ptr, expected, timeout));
assert(theAtomicWait instanceof binaryen.AtomicWait);
assert(theAtomicWait instanceof binaryen.Expression);
assert(theAtomicWait.ptr === ptr);
@@ -926,7 +926,7 @@ console.log("# AtomicWait");
assert(
theAtomicWait.toText()
==
- "(i64.atomic.wait\n (i32.const 5)\n (i32.const 6)\n (i64.const 7)\n)\n"
+ "(memory.atomic.wait64\n (i32.const 5)\n (i32.const 6)\n (i64.const 7)\n)\n"
);
module.dispose();
@@ -938,7 +938,7 @@ console.log("# AtomicNotify");
var ptr = module.i32.const(1);
var notifyCount = module.i32.const(2);
- const theAtomicNotify = binaryen.AtomicNotify(module.atomic.notify(ptr, notifyCount));
+ const theAtomicNotify = binaryen.AtomicNotify(module.memory.atomic.notify(ptr, notifyCount));
assert(theAtomicNotify instanceof binaryen.AtomicNotify);
assert(theAtomicNotify instanceof binaryen.Expression);
assert(theAtomicNotify.ptr === ptr);
@@ -957,7 +957,7 @@ console.log("# AtomicNotify");
assert(
theAtomicNotify.toText()
==
- "(atomic.notify\n (i32.const 3)\n (i32.const 4)\n)\n"
+ "(memory.atomic.notify\n (i32.const 3)\n (i32.const 4)\n)\n"
);
module.dispose();
diff --git a/test/binaryen.js/expressions.js.txt b/test/binaryen.js/expressions.js.txt
index e2b34e501..ba946b296 100644
--- a/test/binaryen.js/expressions.js.txt
+++ b/test/binaryen.js/expressions.js.txt
@@ -128,14 +128,14 @@
)
# AtomicWait
-(i64.atomic.wait
+(memory.atomic.wait64
(i32.const 5)
(i32.const 6)
(i64.const 7)
)
# AtomicNotify
-(atomic.notify
+(memory.atomic.notify
(i32.const 3)
(i32.const 4)
)
diff --git a/test/binaryen.js/kitchen-sink.js b/test/binaryen.js/kitchen-sink.js
index 769b1a7e0..836b7ab17 100644
--- a/test/binaryen.js/kitchen-sink.js
+++ b/test/binaryen.js/kitchen-sink.js
@@ -570,14 +570,14 @@ function test_core() {
)
),
module.drop(
- module.i32.atomic.wait(
+ module.memory.atomic.wait32(
module.i32.const(0),
module.i32.const(0),
module.i64.const(0)
)
),
module.drop(
- module.atomic.notify(
+ module.memory.atomic.notify(
module.i32.const(0),
module.i32.const(0)
)
diff --git a/test/binaryen.js/kitchen-sink.js.txt b/test/binaryen.js/kitchen-sink.js.txt
index 6c32962a7..4990c0abd 100644
--- a/test/binaryen.js/kitchen-sink.js.txt
+++ b/test/binaryen.js/kitchen-sink.js.txt
@@ -1896,14 +1896,14 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(i32.const 0)
(i32.const 0)
(i64.const 0)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(i32.const 0)
(i32.const 0)
)
@@ -3778,14 +3778,14 @@ getExpressionInfo(tuple[3])={"id":14,"type":5,"value":3.7}
)
)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(i32.const 0)
(i32.const 0)
(i64.const 0)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(i32.const 0)
(i32.const 0)
)
diff --git a/test/example/c-api-kitchen-sink.txt b/test/example/c-api-kitchen-sink.txt
index 723d81999..ab9548924 100644
--- a/test/example/c-api-kitchen-sink.txt
+++ b/test/example/c-api-kitchen-sink.txt
@@ -1803,14 +1803,14 @@ BinaryenFeatureAll: 4095
)
)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(i32.const 0)
(i32.const 0)
(i64.const 111)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(i32.const 0)
(i32.const 0)
)
diff --git a/test/example/c-api-kitchen-sink.txt.txt b/test/example/c-api-kitchen-sink.txt.txt
index d3cc32e8d..d3c8e4819 100644
--- a/test/example/c-api-kitchen-sink.txt.txt
+++ b/test/example/c-api-kitchen-sink.txt.txt
@@ -1692,14 +1692,14 @@
)
)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(i32.const 0)
(i32.const 0)
(i64.const 111)
)
)
(drop
- (atomic.notify
+ (memory.atomic.notify
(i32.const 0)
(i32.const 0)
)
diff --git a/test/extra-unreachable.wast b/test/extra-unreachable.wast
index 7c9ed8814..799665924 100644
--- a/test/extra-unreachable.wast
+++ b/test/extra-unreachable.wast
@@ -138,16 +138,16 @@
;; atomic.wait
(global.set $g
- (i32.atomic.wait
+ (memory.atomic.wait32
(unreachable)
(i32.const 0)
(i64.const 0)
)
)
- ;; atomic.notify
+ ;; memory.atomic.notify
(global.set $g
- (atomic.notify
+ (memory.atomic.notify
(unreachable)
(i32.const 0)
)
diff --git a/test/extra-unreachable.wast.from-wast b/test/extra-unreachable.wast.from-wast
index 1598abf48..e084548f8 100644
--- a/test/extra-unreachable.wast.from-wast
+++ b/test/extra-unreachable.wast.from-wast
@@ -110,14 +110,14 @@
)
)
(global.set $g
- (i32.atomic.wait
+ (memory.atomic.wait32
(unreachable)
(i32.const 0)
(i64.const 0)
)
)
(global.set $g
- (atomic.notify
+ (memory.atomic.notify
(unreachable)
(i32.const 0)
)
diff --git a/test/passes/fuzz-exec_all-features.txt b/test/passes/fuzz-exec_all-features.txt
index a6b25e8ca..cbdcf4fdb 100644
--- a/test/passes/fuzz-exec_all-features.txt
+++ b/test/passes/fuzz-exec_all-features.txt
@@ -98,7 +98,7 @@
)
)
(func $3 (result i32)
- (atomic.notify
+ (memory.atomic.notify
(i32.const 1)
(i32.const 1)
)
@@ -119,7 +119,7 @@
)
(func $5
(drop
- (atomic.notify offset=22
+ (memory.atomic.notify offset=22
(i32.const -104)
(i32.const -72)
)
diff --git a/test/passes/fuzz-exec_all-features.wast b/test/passes/fuzz-exec_all-features.wast
index fd3018502..4e5c926a5 100644
--- a/test/passes/fuzz-exec_all-features.wast
+++ b/test/passes/fuzz-exec_all-features.wast
@@ -51,7 +51,7 @@
)
)
(func "unaligned_notify" (result i32)
- (atomic.notify
+ (memory.atomic.notify
(i32.const 1) ;; unaligned
(i32.const 1)
)
@@ -70,7 +70,7 @@
)
(func "oob_notify"
(drop
- (atomic.notify offset=22
+ (memory.atomic.notify offset=22
(i32.const -104) ;; illegal address
(i32.const -72)
)
diff --git a/test/passes/remove-unused-module-elements_all-features.txt b/test/passes/remove-unused-module-elements_all-features.txt
index e79257211..81382e4f4 100644
--- a/test/passes/remove-unused-module-elements_all-features.txt
+++ b/test/passes/remove-unused-module-elements_all-features.txt
@@ -157,7 +157,7 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
@@ -170,7 +170,7 @@
(memory $0 (shared 23 256))
(export "user" (func $user))
(func $user (result i32)
- (atomic.notify
+ (memory.atomic.notify
(i32.const 0)
(i32.const 0)
)
diff --git a/test/passes/remove-unused-module-elements_all-features.wast b/test/passes/remove-unused-module-elements_all-features.wast
index 265ef0e5f..bf9d5c7ff 100644
--- a/test/passes/remove-unused-module-elements_all-features.wast
+++ b/test/passes/remove-unused-module-elements_all-features.wast
@@ -128,7 +128,7 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
@@ -140,7 +140,7 @@
(memory $0 (shared 23 256))
(export "user" $user)
(func $user (result i32)
- (atomic.notify (i32.const 0) (i32.const 0))
+ (memory.atomic.notify (i32.const 0) (i32.const 0))
)
)
(module ;; more use checks
diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
index 2091e9560..5a5406f78 100644
--- a/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.txt
@@ -172,7 +172,7 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
@@ -185,7 +185,7 @@
(memory $0 (shared 23 256))
(export "user" (func $user))
(func $user (result i32)
- (atomic.notify
+ (memory.atomic.notify
(i32.const 0)
(i32.const 0)
)
diff --git a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
index 36bc79e82..c1003ebb0 100644
--- a/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
+++ b/test/passes/remove-unused-nonfunction-module-elements_all-features.wast
@@ -128,7 +128,7 @@
(local $0 i32)
(local $1 i64)
(drop
- (i32.atomic.wait
+ (memory.atomic.wait32
(local.get $0)
(local.get $0)
(local.get $1)
@@ -140,7 +140,7 @@
(memory $0 (shared 23 256))
(export "user" $user)
(func $user (result i32)
- (atomic.notify (i32.const 0) (i32.const 0))
+ (memory.atomic.notify (i32.const 0) (i32.const 0))
)
)
(module ;; more use checks
diff --git a/test/unreachable-instr-type.wast b/test/unreachable-instr-type.wast
index 220347f0f..b7c2078ab 100644
--- a/test/unreachable-instr-type.wast
+++ b/test/unreachable-instr-type.wast
@@ -19,7 +19,7 @@
(i64.const 1)
)
- (i64.atomic.wait
+ (memory.atomic.wait64
(unreachable)
(i64.const 0)
(i64.const 0)
diff --git a/test/unreachable-instr-type.wast.from-wast b/test/unreachable-instr-type.wast.from-wast
index 4c456e59e..311c98a66 100644
--- a/test/unreachable-instr-type.wast.from-wast
+++ b/test/unreachable-instr-type.wast.from-wast
@@ -18,7 +18,7 @@
(i64.const 0)
(i64.const 1)
)
- (i64.atomic.wait
+ (memory.atomic.wait64
(unreachable)
(i64.const 0)
(i64.const 0)
diff --git a/test/wasm2js/atomics_32.wast b/test/wasm2js/atomics_32.wast
index 2c7ba9a44..e1b49d852 100644
--- a/test/wasm2js/atomics_32.wast
+++ b/test/wasm2js/atomics_32.wast
@@ -12,11 +12,11 @@
(local.set $x (i32.atomic.load16_u (i32.const 1028)))
(local.set $x (i32.atomic.load (i32.const 1028)))
(i32.atomic.store (i32.const 100) (i32.const 200))
- (local.set $x (i32.atomic.wait (i32.const 4) (i32.const 8) (i64.const -1)))
+ (local.set $x (memory.atomic.wait32 (i32.const 4) (i32.const 8) (i64.const -1)))
(memory.init 0 (i32.const 512) (i32.const 0) (i32.const 4))
(memory.init 1 (i32.const 1024) (i32.const 4) (i32.const 2))
- (local.set $x (atomic.notify (i32.const 4) (i32.const 2)))
- (local.set $x (atomic.notify offset=20 (i32.const 4) (i32.const 2)))
+ (local.set $x (memory.atomic.notify (i32.const 4) (i32.const 2)))
+ (local.set $x (memory.atomic.notify offset=20 (i32.const 4) (i32.const 2)))
(local.set $x (i32.atomic.rmw.add (i32.const 8) (i32.const 12)))
(local.set $x (i32.atomic.rmw.sub (i32.const 8) (i32.const 12)))
(local.set $x (i32.atomic.rmw.and (i32.const 8) (i32.const 12)))