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

Use JS VM store instead of artificially replicate it #3534

Merged
merged 2 commits into from
Jan 26, 2023

Conversation

syrusakbary
Copy link
Member

@syrusakbary syrusakbary commented Jan 25, 2023

Use JS VM store instead of artificially replicate it.
Right now all the JS VMs use a single store (v8 isolates, for example) per process. We were replicating the store unnecessarily in Rust, when we can just leverage that store.

This PR should bring some relative speed ups on the outer interface of Wasmer (for example, when doing function calls) or getting exports of an instance

functions => VMFunction,
tables => VMTable,
// Note: we store the globals in order to be able to access them later via
// `StoreObjects::iter_globals`.
globals => VMGlobal,
Copy link
Contributor

Choose a reason for hiding this comment

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

but VMGlobal are not handled as a StoreObject anymore. Isn't there a risk of unsynchronisation here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Isn't there a risk of unsynchronisation here?

No. The only risk is the fact that the globals are stored in the Store as a side effect. But they are stored and work nonetheless.
But I think we should probably remove that after merging WASIX

Copy link
Contributor

@ptitSeb ptitSeb left a comment

Choose a reason for hiding this comment

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

My only concern is how VMGlobal can be not a StoreObject anymore, but still beeing reference as a StoreObject: seems fine after re-reading the code.

This PR make Store mostly useless in JS space.

@syrusakbary syrusakbary merged commit 59d2d90 into master Jan 26, 2023
@syrusakbary syrusakbary deleted the js-api-simplify-store branch January 26, 2023 14:09
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