Skip to content

Commit a9cfb55

Browse files
authored
Merge branch 'incoming' into asan-mt
2 parents 800821d + e0dd370 commit a9cfb55

File tree

6 files changed

+17
-38
lines changed

6 files changed

+17
-38
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ See docs/process.md for how version tagging works.
1919
Current Trunk
2020
-------------
2121
- `__builtin_return_address` now requires `-s USE_OFFSET_CONVERTER=1` to work. (#9073)
22+
- Remove fastcomp's implementation of Asyncify. This has been deprecated for
23+
a long time, since we added Emterpreter-Async, and now we have a new Asyncify
24+
implementation in the upstream wasm backend. It is recommended to upgrade to
25+
the upstream backend and use Asyncify there if you need it. (If you do still
26+
need the older version, you can use 1.38.40.)
2227

2328
v.1.38.40: 07/24/2019
2429
---------------------

emcc.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,10 @@ def check(input_file):
12231223
shared.Settings.ERROR_ON_UNDEFINED_SYMBOLS = 0
12241224
shared.Settings.WARN_ON_UNDEFINED_SYMBOLS = 0
12251225

1226+
if shared.Settings.ASYNCIFY:
1227+
if not shared.Settings.WASM_BACKEND:
1228+
exit_with_error('ASYNCIFY has been removed from fastcomp. There is a new implementation which can be used in the upstream wasm backend.')
1229+
12261230
if shared.Settings.EMTERPRETIFY:
12271231
shared.Settings.FINALIZE_ASM_JS = 0
12281232
shared.Settings.SIMPLIFY_IFS = 0 # this is just harmful for emterpreting

emscripten.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -589,10 +589,6 @@ def create_backend_cmd(infile, temp_js):
589589
args += ['-enable-emscripten-cpp-exceptions']
590590
if shared.Settings.DISABLE_EXCEPTION_CATCHING == 2:
591591
args += ['-emscripten-cpp-exceptions-whitelist=' + ','.join(shared.Settings.EXCEPTION_CATCHING_WHITELIST or ['fake'])]
592-
if shared.Settings.ASYNCIFY:
593-
args += ['-emscripten-asyncify']
594-
args += ['-emscripten-asyncify-functions=' + ','.join(shared.Settings.ASYNCIFY_FUNCTIONS)]
595-
args += ['-emscripten-asyncify-whitelist=' + ','.join(shared.Settings.ASYNCIFY_WHITELIST)]
596592
if not shared.Settings.EXIT_RUNTIME:
597593
args += ['-emscripten-no-exit-runtime']
598594
if shared.Settings.WORKAROUND_IOS_9_RIGHT_SHIFT_BUG:
@@ -917,8 +913,6 @@ def get_exported_implemented_functions(all_exported_functions, all_implemented,
917913
funcs += ['emterpret']
918914
if shared.Settings.EMTERPRETIFY_ASYNC:
919915
funcs += ['setAsyncState', 'emtStackSave', 'emtStackRestore', 'getEmtStackMax', 'setEmtStackMax']
920-
if shared.Settings.ASYNCIFY and need_asyncify(funcs):
921-
funcs += ['setAsync']
922916

923917
return sorted(set(funcs))
924918

@@ -1487,10 +1481,6 @@ def make_simd_types(metadata):
14871481
}
14881482

14891483

1490-
def need_asyncify(exported_implemented_functions):
1491-
return '_emscripten_alloc_async_context' in exported_implemented_functions
1492-
1493-
14941484
def asm_safe_heap():
14951485
"""optimized safe heap in asm, when we can"""
14961486
return shared.Settings.SAFE_HEAP and not shared.Settings.SAFE_HEAP_LOG and not shared.Settings.RELOCATABLE
@@ -1610,11 +1600,6 @@ def create_basic_vars(exported_implemented_functions, forwarded_json, metadata):
16101600
# wasm side modules have a specific convention for these
16111601
basic_vars += ['__memory_base', '__table_base']
16121602

1613-
# See if we need ASYNCIFY functions
1614-
# We might not need them even if ASYNCIFY is enabled
1615-
if need_asyncify(exported_implemented_functions):
1616-
basic_vars += ['___async', '___async_unwind', '___async_retval', '___async_cur_frame']
1617-
16181603
if shared.Settings.EMTERPRETIFY:
16191604
basic_vars += ['EMTSTACKTOP', 'EMT_STACK_MAX', 'eb']
16201605

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

1886-
if need_asyncify(exports):
1887-
funcs.append('''
1888-
function setAsync() {
1889-
___async = 1;
1890-
}
1891-
''')
1892-
18931871
if shared.Settings.EMTERPRETIFY:
18941872
funcs.append('''
18951873
function emterpret(pc) { // this will be replaced when the emterpreter code is generated; adding it here allows validation until then

site/source/docs/porting/asyncify.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ for general background and details of how it works internally. The following
2323
expands on the Emscripten examples from that post.
2424

2525
.. note:: This post talks about Asyncify using the new LLVM wasm backend.
26-
There is also an older Asyncify implementation for the old fastcomp
26+
There was an older Asyncify implementation for the old fastcomp
2727
backend. The two algorithms and implementations are entirely separate,
2828
so if you are using fastcomp, these docs may not be accurate - you
2929
should upgrade to the wasm backend and new Asyncify!

tests/test_browser.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2666,14 +2666,7 @@ def test_codemods(self):
26662666

26672667
def test_wget(self):
26682668
create_test_file('test.txt', 'emscripten')
2669-
if not self.is_wasm_backend():
2670-
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'ASYNCIFY=1'])
2671-
print('asyncify+emterpreter')
2672-
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'ASYNCIFY=1', '-s', 'EMTERPRETIFY=1'])
2673-
print('emterpreter by itself')
2674-
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'EMTERPRETIFY=1', '-s', 'EMTERPRETIFY_ASYNC=1'])
2675-
else:
2676-
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=['-s', 'ASYNCIFY=1'])
2669+
self.btest(path_from_root('tests', 'test_wget.c'), expected='1', args=self.get_async_args())
26772670

26782671
def test_wget_data(self):
26792672
create_test_file('test.txt', 'emscripten')

tests/test_core.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7168,14 +7168,11 @@ def test_async(self, emterpretify=False):
71687168

71697169
if self.is_wasm_backend():
71707170
self.set_setting('ASYNCIFY', 1)
7171+
elif emterpretify:
7172+
self.set_setting('EMTERPRETIFY', 1)
7173+
self.set_setting('EMTERPRETIFY_ASYNC', 1)
71717174
else:
7172-
if not emterpretify:
7173-
if self.is_emterpreter():
7174-
self.skipTest("don't test both emterpretify and asyncify at once")
7175-
self.set_setting('ASYNCIFY', 1)
7176-
else:
7177-
self.set_setting('EMTERPRETIFY', 1)
7178-
self.set_setting('EMTERPRETIFY_ASYNC', 1)
7175+
self.skipTest('fastcomp Asyncify was removed')
71797176

71807177
src = r'''
71817178
#include <stdio.h>
@@ -7474,10 +7471,12 @@ def do_test_coroutine(self, additional_settings):
74747471
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-*')
74757472

74767473
@no_wasm_backend('ASYNCIFY coroutines are not yet supported in the LLVM wasm backend')
7474+
@no_fastcomp('ASYNCIFY has been removed from fastcomp')
74777475
def test_coroutine_asyncify(self):
74787476
self.do_test_coroutine({'ASYNCIFY': 1})
74797477

74807478
@no_wasm_backend('ASYNCIFY is not supported in the LLVM wasm backend')
7479+
@no_fastcomp('ASYNCIFY has been removed from fastcomp')
74817480
def test_asyncify_unused(self):
74827481
# test a program not using asyncify, but the pref is set
74837482
self.set_setting('ASYNCIFY', 1)

0 commit comments

Comments
 (0)