Skip to content

Wasm: Store the symbols of private JS fields on the JS side. #5220

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sjrd
Copy link
Member

@sjrd sjrd commented Aug 11, 2025

They always have to be manipulated on the JS side: at declaration time in the custom JS helper that creates the JS class; and at usage site for selection. Therefore, it was wasteful to store them as Wasm globals, only to pass them to JS helpers every time.

We now declare them as JS variables, and we directly use those JS variables from the JS class. For selection, we define a pair of getter/setter helpers for each private JS field. This should be more efficient than passing symbols from Wasm to a unique pair of jsSelect/jsSelectSet helpers.

They always have to be manipulated on the JS side: at declaration
time in the custom JS helper that creates the JS class; and at
usage site for selection. Therefore, it was wasteful to store them
as Wasm globals, only to pass them to JS helpers every time.

We now declare them as JS variables, and we directly use those JS
variables from the JS class. For selection, we define a pair of
getter/setter helpers for each private JS field. This should be
more efficient than passing symbols from Wasm to a unique pair of
`jsSelect`/`jsSelectSet` helpers.
@sjrd sjrd requested a review from gzm0 August 11, 2025 14:10
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.

1 participant