Conversation
3566b65 to
0a88c6e
Compare
and `RELOCATABLE` now implies `IMPORTED_TABLE`. Resolves issue 26217
0a88c6e to
3d9563a
Compare
| table_import = module.get_function_table_import() | ||
| if not table_import: | ||
| exit_with_error('IMPORTED_TABLE requires a table import in the wasm module') | ||
| settings.INITIAL_TABLE = table_import.limits.initial |
There was a problem hiding this comment.
INITIAL_TABLE is only ever used in RELOCATABLE mode so I think this part can maybe reverted? (Along with the webassembly.py file?
There was a problem hiding this comment.
It's used when we set IMPORTED_TABLE too so I'm pretty sure the change is necessary.
There was a problem hiding this comment.
How about if IMPORTED_TABLE means "user must define the table"? Rather than "emcc defines the table in JS"? Then you could revert the libcore.js change along with this one?
Or, in your use case would you prefer if emcc itself defined the table in JS?
There was a problem hiding this comment.
I'd prefer it if emcc defines the table itself. For instance, otherwise I'd need to implement similar logic that looks at the import section and checks how big the initial size is. I just want wasmTable to be defined during --pre-js execution like the test asserts.
| $wasmTable__docs: '/** @type {WebAssembly.Table} */', | ||
| #if RELOCATABLE | ||
| // In RELOCATABLE mode we create the table in JS. | ||
| #if IMPORTED_TABLE |
There was a problem hiding this comment.
I'm less sure about this part. Don't you want to define the table externally in the cases of IMPORTED_TABLE?
There was a problem hiding this comment.
I'm a little sad to make this change because I was hoping to completely remove this block of code. Since we no longer use -sRELOCTABLE for dynamic linking I was hoping to remove all support for -sRELOCATABLE.
|
Okay I added an IMPORTED_MEMORY test and made the other edits. |
|
One thing that makes this a little different to IMPORTED_MEMORY is the most used of IMPORTED_MEMORY I believe want to be able to define their own memory. In this case the only user who benefits is the user who wants the table to be available early (during |
Also,
RELOCATABLEnow impliesIMPORTED_TABLE.Fixes: #26217