Skip to content
Merged
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
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ See docs/process.md for how version tagging works.

Current Trunk
-------------
- Remove fastcomp's implementation of Asyncify. This has been deprecated for
a long time, since we added Emterpreter-Async, and now we have a new Asyncify
implementation in the upstream wasm backend. It is recommended to upgrade to
the upstream backend and use Asyncify there if you need it. (If you do still
need the older version, you can use 1.38.40.)

v.1.38.40: 07/24/2019
---------------------
Expand Down
4 changes: 4 additions & 0 deletions emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,10 @@ def check(input_file):
shared.Settings.ERROR_ON_UNDEFINED_SYMBOLS = 0
shared.Settings.WARN_ON_UNDEFINED_SYMBOLS = 0

if shared.Settings.ASYNCIFY:
if not shared.Settings.WASM_BACKEND:
exit_with_error('ASYNCIFY has been removed from fastcomp. There is a new implementation which can be used in the upstream wasm backend.')

if shared.Settings.EMTERPRETIFY:
shared.Settings.FINALIZE_ASM_JS = 0
shared.Settings.SIMPLIFY_IFS = 0 # this is just harmful for emterpreting
Expand Down
22 changes: 0 additions & 22 deletions emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,10 +589,6 @@ def create_backend_cmd(infile, temp_js):
args += ['-enable-emscripten-cpp-exceptions']
if shared.Settings.DISABLE_EXCEPTION_CATCHING == 2:
args += ['-emscripten-cpp-exceptions-whitelist=' + ','.join(shared.Settings.EXCEPTION_CATCHING_WHITELIST or ['fake'])]
if shared.Settings.ASYNCIFY:
args += ['-emscripten-asyncify']
args += ['-emscripten-asyncify-functions=' + ','.join(shared.Settings.ASYNCIFY_FUNCTIONS)]
args += ['-emscripten-asyncify-whitelist=' + ','.join(shared.Settings.ASYNCIFY_WHITELIST)]
if not shared.Settings.EXIT_RUNTIME:
args += ['-emscripten-no-exit-runtime']
if shared.Settings.WORKAROUND_IOS_9_RIGHT_SHIFT_BUG:
Expand Down Expand Up @@ -917,8 +913,6 @@ def get_exported_implemented_functions(all_exported_functions, all_implemented,
funcs += ['emterpret']
if shared.Settings.EMTERPRETIFY_ASYNC:
funcs += ['setAsyncState', 'emtStackSave', 'emtStackRestore', 'getEmtStackMax', 'setEmtStackMax']
if shared.Settings.ASYNCIFY and need_asyncify(funcs):
funcs += ['setAsync']

return sorted(set(funcs))

Expand Down Expand Up @@ -1487,10 +1481,6 @@ def make_simd_types(metadata):
}


def need_asyncify(exported_implemented_functions):
return '_emscripten_alloc_async_context' in exported_implemented_functions


def asm_safe_heap():
"""optimized safe heap in asm, when we can"""
return shared.Settings.SAFE_HEAP and not shared.Settings.SAFE_HEAP_LOG and not shared.Settings.RELOCATABLE
Expand Down Expand Up @@ -1610,11 +1600,6 @@ def create_basic_vars(exported_implemented_functions, forwarded_json, metadata):
# wasm side modules have a specific convention for these
basic_vars += ['__memory_base', '__table_base']

# See if we need ASYNCIFY functions
# We might not need them even if ASYNCIFY is enabled
if need_asyncify(exported_implemented_functions):
basic_vars += ['___async', '___async_unwind', '___async_retval', '___async_cur_frame']

if shared.Settings.EMTERPRETIFY:
basic_vars += ['EMTSTACKTOP', 'EMT_STACK_MAX', 'eb']

Expand Down Expand Up @@ -1883,13 +1868,6 @@ def create_runtime_funcs_asmjs(exports):
# MINIMAL_RUNTIME moves stack functions to library.
funcs = []

if need_asyncify(exports):
funcs.append('''
function setAsync() {
___async = 1;
}
''')

if shared.Settings.EMTERPRETIFY:
funcs.append('''
function emterpret(pc) { // this will be replaced when the emterpreter code is generated; adding it here allows validation until then
Expand Down
2 changes: 1 addition & 1 deletion site/source/docs/porting/asyncify.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ for general background and details of how it works internally. The following
expands on the Emscripten examples from that post.

.. note:: This post talks about Asyncify using the new LLVM wasm backend.
There is also an older Asyncify implementation for the old fastcomp
There was an older Asyncify implementation for the old fastcomp
backend. The two algorithms and implementations are entirely separate,
so if you are using fastcomp, these docs may not be accurate - you
should upgrade to the wasm backend and new Asyncify!
Expand Down
9 changes: 1 addition & 8 deletions tests/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2666,14 +2666,7 @@ def test_codemods(self):

def test_wget(self):
create_test_file('test.txt', 'emscripten')
if not self.is_wasm_backend():
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'ASYNCIFY=1'])
print('asyncify+emterpreter')
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'ASYNCIFY=1', '-s', 'EMTERPRETIFY=1'])
print('emterpreter by itself')
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1'])
else:
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'ASYNCIFY=1'])
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=self.get_async_args())

def test_wget_data(self):
create_test_file('test.txt', 'emscripten')
Expand Down
13 changes: 6 additions & 7 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7168,14 +7168,11 @@ def test_async(self, emterpretify=False):

if self.is_wasm_backend():
self.set_setting('ASYNCIFY', 1)
elif emterpretify:
self.set_setting('EMTERPRETIFY', 1)
self.set_setting('EMTERPRETIFY_ASYNC', 1)
else:
if not emterpretify:
if self.is_emterpreter():
self.skipTest("don't test both emterpretify and asyncify at once")
self.set_setting('ASYNCIFY', 1)
else:
self.set_setting('EMTERPRETIFY', 1)
self.set_setting('EMTERPRETIFY_ASYNC', 1)
self.skipTest('fastcomp Asyncify was removed')

src = r'''
#include <stdio.h>
Expand Down Expand Up @@ -7474,10 +7471,12 @@ def do_test_coroutine(self, additional_settings):
self.do_run(src, '*leaf-0-100-1-101-1-102-2-103-3-104-5-105-8-106-13-107-21-108-34-109-*')

@no_wasm_backend('ASYNCIFY coroutines are not yet supported in the LLVM wasm backend')
@no_fastcomp('ASYNCIFY has been removed from fastcomp')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a simpler way to skip a test entirely?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not atm. Once we remove fastcomp this will look less silly...

def test_coroutine_asyncify(self):
self.do_test_coroutine({'ASYNCIFY': 1})

@no_wasm_backend('ASYNCIFY is not supported in the LLVM wasm backend')
@no_fastcomp('ASYNCIFY has been removed from fastcomp')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

def test_asyncify_unused(self):
# test a program not using asyncify, but the pref is set
self.set_setting('ASYNCIFY', 1)
Expand Down