Skip to content

Commit 120241d

Browse files
authored
Use JSPI to refer to ASYNCIFY=2 rather than stack switching. NFC (#19564)
It seems we have transitions to using that name when we talk about this feature. It also avoids confusion with true stack switching which is a different proposal.
1 parent 1f3aab6 commit 120241d

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ jobs:
467467
asan.test_dyncall_specific_minimal_runtime
468468
asan.test_async_hello
469469
asan.test_dlfcn_basic
470-
asan.test_async_hello_stack_switching
470+
asan.test_async_hello_jspi
471471
asan.test_cubescript
472472
asan.test_wasm_worker_hello
473473
lsan.test_stdio_locking

emcc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2825,7 +2825,7 @@ def get_full_import_name(name):
28252825
settings.ASYNCIFY_IMPORTS = [get_full_import_name(i) for i in settings.ASYNCIFY_IMPORTS]
28262826

28272827
if settings.ASYNCIFY == 2:
2828-
diagnostics.warning('experimental', 'ASYNCIFY with stack switching is experimental')
2828+
diagnostics.warning('experimental', '-sASYNCIFY=2 (JSPI) is still experimental')
28292829

28302830
if settings.WASM2JS:
28312831
if settings.GENERATE_SOURCE_MAP:

test/test_core.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -224,11 +224,11 @@ def metafunc(self, standalone):
224224
return decorated
225225

226226

227-
def with_asyncify_and_stack_switching(f):
227+
def with_asyncify_and_jspi(f):
228228
assert callable(f)
229229

230-
def metafunc(self, stack_switching):
231-
if stack_switching:
230+
def metafunc(self, jspi):
231+
if jspi:
232232
self.set_setting('ASYNCIFY', 2)
233233
self.require_jspi()
234234
if not self.is_wasm():
@@ -242,7 +242,7 @@ def metafunc(self, stack_switching):
242242
f(self)
243243

244244
metafunc._parameterize = {'': (False,),
245-
'stack_switching': (True,)}
245+
'jspi': (True,)}
246246
return metafunc
247247

248248

@@ -8150,7 +8150,7 @@ def test_vswprintf_utf8(self):
81508150

81518151
# Test that a main with arguments is automatically asyncified.
81528152
@no_wasm64('TODO: asyncify for wasm64')
8153-
@with_asyncify_and_stack_switching
8153+
@with_asyncify_and_jspi
81548154
def test_async_main(self):
81558155
create_file('main.c', r'''
81568156
#include <stdio.h>
@@ -8164,7 +8164,7 @@ def test_async_main(self):
81648164
self.do_runf('main.c', 'argc=2 argv=hello', args=['hello'])
81658165

81668166
@no_wasm64('TODO: asyncify for wasm64')
8167-
@with_asyncify_and_stack_switching
8167+
@with_asyncify_and_jspi
81688168
def test_async_hello(self):
81698169
# needs to flush stdio streams
81708170
self.set_setting('EXIT_RUNTIME')
@@ -8189,7 +8189,7 @@ def test_async_hello(self):
81898189
self.do_runf('main.c', 'HelloWorld!99')
81908190

81918191
@no_wasm64('TODO: asyncify for wasm64')
8192-
@with_asyncify_and_stack_switching
8192+
@with_asyncify_and_jspi
81938193
def test_async_loop(self):
81948194
# needs to flush stdio streams
81958195
self.set_setting('EXIT_RUNTIME')
@@ -8245,7 +8245,7 @@ def test_async_ccall_bad(self):
82458245
self.do_runf('main.c', 'The call to main is running asynchronously.')
82468246

82478247
@no_wasm64('TODO: asyncify for wasm64')
8248-
@with_asyncify_and_stack_switching
8248+
@with_asyncify_and_jspi
82498249
def test_async_ccall_good(self):
82508250
# check reasonable ccall use
82518251
# needs to flush stdio streams
@@ -8322,7 +8322,7 @@ def test_fibers_asyncify(self):
83228322
self.do_runf(test_file('test_fibers.cpp'), '*leaf-0-100-1-101-1-102-2-103-3-104-5-105-8-106-13-107-21-108-34-109-*')
83238323

83248324
@no_wasm64('TODO: asyncify for wasm64')
8325-
@with_asyncify_and_stack_switching
8325+
@with_asyncify_and_jspi
83268326
def test_asyncify_unused(self):
83278327
# test a program not using asyncify, but the pref is set
83288328
self.do_core_test('test_hello_world.c')
@@ -8442,7 +8442,7 @@ def test_asyncify_during_exit(self):
84428442
@no_lsan('undefined symbol __global_base')
84438443
@no_wasm2js('dynamic linking support in wasm2js')
84448444
@no_wasm64('TODO: asyncify for wasm64')
8445-
@with_asyncify_and_stack_switching
8445+
@with_asyncify_and_jspi
84468446
def test_asyncify_main_module(self):
84478447
self.set_setting('MAIN_MODULE', 2)
84488448
self.do_core_test('test_hello_world.c')
@@ -9686,7 +9686,7 @@ def test_embind_lib_with_asyncify(self, args):
96869686

96879687
@no_asan('asyncify stack operations confuse asan')
96889688
@no_wasm64('TODO: asyncify for wasm64')
9689-
@with_asyncify_and_stack_switching
9689+
@with_asyncify_and_jspi
96909690
def test_em_async_js(self):
96919691
self.uses_es6 = True
96929692
if not self.get_setting('ASYNCIFY'):

test/test_other.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12857,7 +12857,7 @@ def test_multiple_g_flags(self):
1285712857
self.assertNotIn(b'.debug', read_binary('hello_world.o'))
1285812858

1285912859
@requires_v8
12860-
def test_stack_switching_size(self):
12860+
def test_jspi_code_size(self):
1286112861
# use iostream code here to purposefully get a fairly large wasm file, so
1286212862
# that our size comparisons later are meaningful
1286312863
create_file('main.cpp', r'''

0 commit comments

Comments
 (0)