Skip to content
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

Fix for wasmOffsetConverter with MODULARIZE + USE_PTHREAD #14755

Merged
merged 1 commit into from
Jul 26, 2021

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jul 26, 2021

I tried to fix this in #13236 but I don't think it was ever working
correctly. In MODULARIZE mode wasmOffsetConverter was not being
defined within the module itself (where it is used). his change moves
the construction of wasmOffsetConverter and wasmSourceMap so they
always occur inside the module.

I've also improved the testing of wasmOffsetConverter so we actually
verify that it works in tests/core/test_return_address.c.

@sbc100 sbc100 force-pushed the fix_offset_converter_modularize branch 2 times, most recently from 3923890 to 5cbc2bd Compare July 26, 2021 17:20
@sbc100 sbc100 changed the title Fix for wasmOffsetConverter with MODULARIZE Fix for wasmOffsetConverter with MODULARIZE + USE_PTHREAD Jul 26, 2021
@sbc100 sbc100 force-pushed the fix_offset_converter_modularize branch from 5cbc2bd to 5b98a7a Compare July 26, 2021 18:59
@sbc100 sbc100 force-pushed the fix_offset_converter_modularize branch 2 times, most recently from bf177a4 to c8307db Compare July 26, 2021 20:13
@sbc100 sbc100 requested review from kripken and tlively July 26, 2021 21:01
sbc100 added a commit that referenced this pull request Jul 26, 2021
In all cases but one there is no need to add or remove this dependencies
since there is no way for the instance to be ready before the offset
converter.

This was probably true before #14755 but became a lot more clear once
that landed.
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % style nits

src/preamble.js Outdated Show resolved Hide resolved
@kripken
Copy link
Member

kripken commented Jul 26, 2021

And, nice cleanup!

I tried to fix this in #13236 but I don't think it was ever working
correctly.  In MODULARIZE mode `wasmOffsetConverter` was not being
defined within the module itself (where it is used).  his change moves
the contruction of `wasmOffsetConverter` and `wasmSourceMap` so they
always occur inside the module.

I've also improved the testing of `wasmOffsetConverter` so we actually
verify that it works in `tests/core/test_return_address.c`.
@sbc100 sbc100 force-pushed the fix_offset_converter_modularize branch from c8307db to 00096d9 Compare July 26, 2021 22:21
@sbc100 sbc100 enabled auto-merge (squash) July 26, 2021 22:39
@sbc100 sbc100 merged commit f4194dd into main Jul 26, 2021
@sbc100 sbc100 deleted the fix_offset_converter_modularize branch July 26, 2021 23:48
sbc100 added a commit that referenced this pull request Jul 26, 2021
In all cases but one there is no need to add or remove this dependencies
since there is no way for the instance to be ready before the offset
converter.

This was probably true before #14755 but became a lot more clear once
that landed.
sbc100 added a commit that referenced this pull request Jul 26, 2021
In all cases but one there is no need to add or remove this dependencies
since there is no way for the instance to be ready before the offset
converter.

This was probably true before #14755 but became a lot more clear once
that landed.
sbc100 added a commit that referenced this pull request Jul 27, 2021
Following up on the change made in #14611, this change forces the
`WasmOffsetConverter` before calling receiveInstantiationResult in both
code paths (instantiateArrayBuffer and instantiateAsync).

With that done (along with #14755) there are no more valid use cases for
to block executation based on the absence of `WasmOffsetConverter`.  By
the time the instance is recieved it is always defined.
sbc100 added a commit that referenced this pull request Jul 27, 2021
Following up on the change made in #14611, this change forces the
`WasmOffsetConverter` before calling receiveInstantiationResult in both
code paths (instantiateArrayBuffer and instantiateAsync).

With that done (along with #14755) there are no more valid use cases for
to block execution based on the absence of `WasmOffsetConverter`.  By
the time the instance is received it is always defined.
sbc100 added a commit that referenced this pull request Jul 27, 2021
Following up on the change made in #14611, this change forces the
`WasmOffsetConverter` before calling receiveInstantiationResult in both
code paths (instantiateArrayBuffer and instantiateAsync).

With that done (along with #14755) there are no more valid use cases for
to block execution based on the absence of `WasmOffsetConverter`.  By
the time the instance is received it is always defined.
sbc100 added a commit that referenced this pull request Jul 27, 2021
Following up on the change made in #14611, this change forces the
`WasmOffsetConverter` before calling receiveInstantiationResult in both
code paths (instantiateArrayBuffer and instantiateAsync).

With that done (along with #14755) there are no more valid use cases for
to block execution based on the absence of `WasmOffsetConverter`.  By
the time the instance is received it is always defined.
sbc100 added a commit that referenced this pull request Jul 27, 2021
Following up on the change made in #14611, this change forces the
`WasmOffsetConverter` before calling receiveInstantiationResult in both
code paths (instantiateArrayBuffer and instantiateAsync).

With that done (along with #14755) there are no more valid use cases for
to block execution based on the absence of `WasmOffsetConverter`.  By
the time the instance is received it is always defined.
sbc100 added a commit that referenced this pull request Jul 27, 2021
Following up on the change made in #14611, this change forces the
`WasmOffsetConverter` before calling receiveInstantiationResult in both
code paths (instantiateArrayBuffer and instantiateAsync).

With that done (along with #14755) there are no more valid use cases for
to block execution based on the absence of `WasmOffsetConverter`.  By
the time the instance is received it is always defined.
sbc100 added a commit that referenced this pull request Jul 27, 2021
Following up on the change made in #14611, this change forces the
`WasmOffsetConverter` before calling `receiveInstantiationResult` in both
code paths (instantiateArrayBuffer and instantiateAsync).

With that done (along with #14755) there are no more valid use cases for
to block execution based on the absence of `WasmOffsetConverter`.  By
the time the instance is received it is always defined.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants