Skip to content
Closed
Show file tree
Hide file tree
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
14 changes: 3 additions & 11 deletions src/library_async.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ mergeInto(LibraryManager.library, {
// malloc() asyncify does (we could ifdef it out, but it's even more
// ifdefing).

// The global suspender object used with the VM's stack switching Promise
// API.
suspender: null,
// The promise that is being suspended on in the VM atm, or null.
promise: null,
// The function we should call to resolve the promise at the right time.
Expand All @@ -79,11 +76,6 @@ mergeInto(LibraryManager.library, {
instrumentWasmImports: function(imports) {
#if ASYNCIFY_DEBUG
err('asyncify instrumenting imports');
#endif
#if ASYNCIFY == 2
// TODO we could perhaps add an init function and put this there, but
// this should work for now.
Asyncify.suspender = new WebAssembly.Suspender();
#endif
var ASYNCIFY_IMPORTS = {{{ JSON.stringify(ASYNCIFY_IMPORTS) }}}.map((x) => x.split('.')[1]);
for (var x in imports) {
Expand All @@ -108,12 +100,12 @@ mergeInto(LibraryManager.library, {
#if ASYNCIFY_DEBUG
err('asyncify: suspendOnReturnedPromise for', x, original);
#endif
imports[x] = original = Asyncify.suspender.suspendOnReturnedPromise(
imports[x] = original = WebAssembly.suspendOnReturnedPromise(
new WebAssembly.Function(type, original)
);
}
#endif
#if ASSERTIONS && ASYNCIFY != 2 // We cannot apply assertions with stack switching, as the imports must not be modified from suspender.suspendOnReturnedPromise TODO find a way
#if ASSERTIONS && ASYNCIFY != 2 // We cannot apply assertions with stack switching, as the imports must not be modified from WebAssembly.suspendOnReturnedPromise TODO find a way
imports[x] = function() {
var originalAsyncifyState = Asyncify.state;
try {
Expand Down Expand Up @@ -165,7 +157,7 @@ mergeInto(LibraryManager.library, {
#if ASYNCIFY_DEBUG
err('asyncify: returnPromiseOnSuspend for', x, original);
#endif
ret[x] = original = Asyncify.suspender.returnPromiseOnSuspend(original);
ret[x] = original = WebAssembly.returnPromiseOnSuspend(original);
}
#endif
if (typeof original == 'function') {
Expand Down
2 changes: 0 additions & 2 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7963,8 +7963,6 @@ def test_vswprintf_utf8(self):
@no_wasm64('TODO: asyncify for wasm64')
@with_asyncify_and_stack_switching
def test_async_hello(self):
if self.get_setting('ASYNCIFY') == 2:
self.skipTest('https://github.com/emscripten-core/emscripten/issues/17532')
# needs to flush stdio streams
self.set_setting('EXIT_RUNTIME')

Expand Down
1 change: 0 additions & 1 deletion test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -12234,7 +12234,6 @@ def test_multiple_g_flags(self):
self.assertNotIn(b'.debug', read_binary('hello_world.o'))

@requires_v8
@disabled('https://github.com/emscripten-core/emscripten/issues/17532')
def test_stack_switching_size(self):
# use iostream code here to purposefully get a fairly large wasm file, so
# that our size comparisons later are meaningful
Expand Down