Skip to content
Open
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: 0 additions & 5 deletions src/lib/libcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2212,11 +2212,6 @@ addToLibrary({
__global_base: '{{{ GLOBAL_BASE }}}',
#endif // RELOCATABLE

#if (MAIN_MODULE || RELOCATABLE) && ASYNCIFY == 1
__asyncify_state: "new WebAssembly.Global({'value': 'i32', 'mutable': true}, 0)",
__asyncify_data: "new WebAssembly.Global({'value': '{{{ POINTER_WASM_TYPE }}}', 'mutable': true}, {{{ to64(0) }}})",
#endif

_emscripten_fs_load_embedded_files__deps: ['$FS', '$PATH'],
_emscripten_fs_load_embedded_files: (ptr) => {
#if RUNTIME_DEBUG
Expand Down
7 changes: 4 additions & 3 deletions tools/emscripten.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ def update_settings_glue(wasm_file, metadata, base_metadata):
settings.WASM_EXPORTS = metadata.all_exports
settings.HAVE_EM_ASM = bool(settings.MAIN_MODULE or len(metadata.em_asm_consts) != 0)

if settings.MAIN_MODULE:
# These will be exported from Wasm, but only once we run the asyncify pass.
settings.WASM_EXPORTS += ['__asyncify_state', '__asyncify_data']

# start with the MVP features, and add any detected features.
building.binaryen_features = ['--mvp-features'] + metadata.features
if settings.ASYNCIFY == 2:
Expand Down Expand Up @@ -351,9 +355,6 @@ def emscript(in_wasm, out_wasm, outfile_js, js_syms, finalize=True, base_metadat
if settings.INITIAL_TABLE == -1:
settings.INITIAL_TABLE = dylink_sec.table_size + 1

if settings.MAIN_MODULE and settings.ASYNCIFY == 1:
metadata.imports += ['__asyncify_state', '__asyncify_data']

if metadata.invoke_funcs:
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += ['$getWasmTableEntry']

Expand Down
11 changes: 3 additions & 8 deletions tools/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,9 @@ def get_binaryen_passes(options):
passes += ['--fpcast-emu']
if settings.ASYNCIFY == 1:
passes += ['--asyncify']
if settings.RELOCATABLE or settings.MAIN_MODULE:
if settings.MAIN_MODULE:
passes += ['--pass-arg=asyncify-export-globals']
elif settings.RELOCATABLE:
passes += ['--pass-arg=asyncify-relocatable']
if settings.ASSERTIONS:
passes += ['--pass-arg=asyncify-asserts']
Expand Down Expand Up @@ -1331,13 +1333,6 @@ def limit_incoming_module_api():
'$relocateExports',
'$GOTHandler',
]

if settings.ASYNCIFY == 1:
settings.DEFAULT_LIBRARY_FUNCS_TO_INCLUDE += [
'__asyncify_state',
'__asyncify_data',
]

# shared modules need memory utilities to allocate their memory
settings.ALLOW_TABLE_GROWTH = 1

Expand Down
1 change: 0 additions & 1 deletion tools/maint/gen_sig_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ def ignore_symbol(s, cxx):
return True
if s in {'__stack_base', '__memory_base', '__table_base', '__global_base', '__heap_base',
'__stack_pointer', '__stack_high', '__stack_low', '_load_secondary_module',
'__asyncify_state', '__asyncify_data',
# legacy aliases, not callable from native code.
'stackSave', 'stackRestore', 'stackAlloc', 'getTempRet0', 'setTempRet0',
}:
Expand Down
Loading