-
Notifications
You must be signed in to change notification settings - Fork 3.5k
JS type legalization is still performed regardless of LEGALIZE_JS_FFI #21592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -489,6 +489,10 @@ def finalize_wasm(infile, outfile, js_syms): | |
| # if we don't need to modify the wasm, don't tell finalize to emit a wasm file | ||
| modify_wasm = False | ||
|
|
||
| # If we are doing any JS type legalization (needed for passing i64 values). | ||
| # This is only fully disabled when WASM_BIGINT is available. | ||
| legalizing = True | ||
|
|
||
| if settings.WASM2JS: | ||
| # wasm2js requires full legalization (and will do extra wasm binary | ||
| # later processing later anyhow) | ||
|
|
@@ -497,6 +501,8 @@ def finalize_wasm(infile, outfile, js_syms): | |
| args.append('-g') | ||
| if settings.WASM_BIGINT: | ||
| args.append('--bigint') | ||
| legalizing = False | ||
|
|
||
| if settings.DYNCALLS: | ||
| # we need to add all dyncalls to the wasm | ||
| modify_wasm = True | ||
|
|
@@ -507,19 +513,20 @@ def finalize_wasm(infile, outfile, js_syms): | |
| args.append('--dyncalls-i64') | ||
| # we need to add some dyncalls to the wasm | ||
| modify_wasm = True | ||
|
|
||
| if settings.AUTODEBUG: | ||
| # In AUTODEBUG mode we want to delay all legalization until later. This is hack | ||
| # to force wasm-emscripten-finalize not to do any legalization at all. | ||
| args.append('--bigint') | ||
| else: | ||
| if settings.LEGALIZE_JS_FFI: | ||
| # When we dynamically link our JS loader adds functions from wasm modules to | ||
| # the table. It must add the original versions of them, not legalized ones, | ||
| # so that indirect calls have the right type, so export those. | ||
| args += building.js_legalization_pass_flags() | ||
| modify_wasm = True | ||
| else: | ||
| args.append('--no-legalize-javascript-ffi') | ||
| legalizing = False | ||
|
|
||
| if not settings.LEGALIZE_JS_FFI: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we not use
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason is that At least today. We could change that but I think we can/should consider that separately. |
||
| args.append('--no-legalize-javascript-ffi') | ||
|
|
||
| if legalizing: | ||
| args += building.js_legalization_pass_flags() | ||
| modify_wasm = True | ||
|
|
||
| if settings.SIDE_MODULE: | ||
| args.append('--side-module') | ||
| if settings.STACK_OVERFLOW_CHECK >= 2: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment was removed becasue it basically duplicate of the one in js_legalization_pass_flags