-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Allow SHARED_MEMORY flag to be used independently.
#22683
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
3845995
Allow `SHARED_MEMORY` flag to be used independently.
eyebrowsoffire 015f279
Combined `is_ww` and `is_sm` into a single variant.
eyebrowsoffire d69c14c
Fix some CI issues.
eyebrowsoffire 8f72acf
Fix more CI issues.
eyebrowsoffire e739a23
Change minimal CI names.
eyebrowsoffire 979d9d8
Changes to expecations.
eyebrowsoffire 1d48e33
Revert a few expectations.
eyebrowsoffire a2618d9
Merge branch 'main' into shared_memory
eyebrowsoffire a297e13
Change library suffix back to -ww for a more minimal change.
eyebrowsoffire 1faaf99
Address Sam's comment.
eyebrowsoffire dcfad64
Address more of Sam's comments.
eyebrowsoffire 2b73900
Minimize the change further.
eyebrowsoffire 0d4be85
Merge branch 'main' into shared_memory
eyebrowsoffire e3b65b1
Rename wasm worker assembly file.
eyebrowsoffire File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| .extern __stack_pointer | ||
| .extern __stack_base | ||
| .extern __stack_end | ||
|
|
||
| #ifdef __wasm64__ | ||
| #define PTR i64 | ||
| #define ALIGN 3 | ||
| #define PTRSTORE .int64 | ||
| #else | ||
| #define PTR i32 | ||
| #define ALIGN 2 | ||
| #define PTRSTORE .int32 | ||
| #endif | ||
|
|
||
| .globaltype __stack_pointer, PTR | ||
| .globaltype __stack_end, PTR | ||
| .globaltype __stack_base, PTR | ||
|
|
||
| .globl _emscripten_wasm_worker_initialize | ||
| _emscripten_wasm_worker_initialize: | ||
| .functype _emscripten_wasm_worker_initialize (PTR /*stackLowestAddress*/, i32 /*stackSize*/) -> () | ||
|
|
||
| // __stack_end = stackLowestAddress + (__builtin_wasm_tls_size() + 15) & -16; | ||
| local.get 0 | ||
| .globaltype __tls_size, PTR, immutable | ||
| global.get __tls_size | ||
| PTR.add | ||
| PTR.const 0xf | ||
| PTR.add | ||
| PTR.const -0x10 | ||
| PTR.and | ||
| global.set __stack_end | ||
|
|
||
| // __stack_base = stackLowestAddress + stackSize; | ||
| local.get 0 | ||
| local.get 1 | ||
| #ifdef __wasm64__ | ||
| i64.extend_i32_u | ||
| #endif | ||
| PTR.add | ||
| global.set __stack_base | ||
|
|
||
| // TODO: We'd like to do this here to avoid JS side calls to __set_stack_limits. | ||
| // (or even better, we'd like to avoid duplicate versions of the stack variables) | ||
| // See https://github.com/emscripten-core/emscripten/issues/16496 | ||
| // global.get __stack_base | ||
| // global.get __stack_end | ||
| // .functype __set_stack_limits (PTR, PTR) -> () | ||
| // call __set_stack_limits | ||
|
|
||
| // __wasm_init_tls(stackLowestAddress); | ||
| local.get 0 | ||
| .functype __wasm_init_tls (PTR) -> () | ||
| call __wasm_init_tls | ||
|
|
||
| // N.b. The function __wasm_init_tls above does not need | ||
| // __stack_pointer initialized, and it destroys the value it was set to. | ||
| // So we must initialize __stack_pointer only *after* completing __wasm_init_tls: | ||
|
|
||
| // __stack_pointer = __stack_base; | ||
| global.get __stack_base | ||
| global.set __stack_pointer | ||
|
|
||
| end_function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| hello world… | ||
| hello world… |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| first | ||
| result: 1 1 | ||
| second | ||
| result: 2 -1 | ||
| result: 2 -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't love that these are now globals symbols...I wish we could find a way to avoid the need for divergence here between wasm workers and pthreads, but for now this seems reasonable.