-
Notifications
You must be signed in to change notification settings - Fork 3.4k
-s WASM=1
not working with emterpreter
#5031
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
Comments
Oh but hang on, does a wasm module need to be fully linked? I.e. is it unable to handle
? If so, I guess the two errors are unrelated. |
Yeah, the errors seem to be unrelated, as best I can guess. As to the first error, that's odd. We do set Also interesting that wasm influences things here. It actually shouldn't at this stage, this should be the same asm.js as when building the same file to asm.js. Anyhow, maybe if you just add some debug logging after the one place we do |
My link command involves 100MB across 15 different bitcode files, so might be a little inconvenient to send - I'll have a go at it :) |
Ah but i can combine files if necessary, so that's a possibility. |
Yeah, if you can combine them that's fine, if the logging suggested above doesn't turn out something obvious for you. |
Got it. See #5046. |
Now I've got a successful wasm build, the answer appears to be a definite no - it works fine. So it seems that the second problem was resolved by something else, possibly updating incoming, possibly the PR above. Not important any more. |
Aha, got the binaryen assertion again. With debugging:
i.e. the function it can't find is
|
Hmm, so it's imported and used only in a table. That should be fine, but we did fix bugs there - which version are you on? |
I was using incoming as of the merge of my asm float zero fix. Two commits before that was "update binaryen port to version_31". So pretty much the latest. After updating and wiping my cache, I now can't reproduce again. I did have a number of PRs ongoing branched off from different points that could have messed things up, so I'll close this issue since everything I was originally complaining about now :) |
The full command is pretty long, but in short I'm trying to create an async emterpreter with wasm. It works fine with asm.js, but fails with
-s WASM=1
. I've tried applying #5017 just on the off-chance with no success. I'm on incoming and have tested with both ayzim and the normal emscripten optimizer with identical behaviour.The problem comes from
js-optimizer.js
, thethrow 'bad';
in these lines:Modifying the
default
line to readdefault: { console.log('going bad'); console.log(asmData.ret); console.log(func); console.log('gone bad'); throw 'bad'; }
, I get the following output:Note that 12 corresponds to the
ASM_NONE
type.Some thoughts: when creating ayzim, I was able to remove
ASM_NONE
and make the type ofasmData.ret
be anOption<AsmType>
, i.e.ASM_NONE
is more accurately expressed as the absence of a type. Making an educated guess based on this knowledge, I changedif (asmData.ret !== undefined) {
toif (asmData.ret !== undefined && asmData.ret !== ASM_NONE) {
a couple of lines above this switch (as well as a similar check elsewhere), which then allowed the emterpreter step to complete. Sadly, it later failed in the asm2wasm step so I guess my changes may have just been putting off the inevitable crash:The text was updated successfully, but these errors were encountered: