-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Use safe JSContext/AutoRealm/CurrentRealm in codegen #40716
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
Conversation
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
presummably the problems are in handles Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
|
This seems to bloat the binary size. I don't know enough about bindings, but is this expected? cc @jschwe |
It is surprising it's that noticeable, but generally we have use more symbols and more code (codegen stuff write wrapper code for each JS method). I suspect the reason for size explosion is that we currently need to do conversion to rawer types on many places (although one would expect for compiler to optimize that), but once we fully migrate to safe types we should be able to remove many more symbols and code. Is there any automated way to see symbol/asm difference of a PR/commit? |
bloaty has a size-diff feature (that I haven't tried yet). Would be cool to add that to CI, but probably we would need to figure out builds with preserved debug symbols first (in a separate file), so that the attribution works as expected. |
This is companion PR to servo/mozjs#680 but it was originally written as part of #40716. Testing: Covered by `/webidl/ecmascript-binding/global-object-implicit-this-value-cross-realm.html` Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
We replace many places that use
SafeJSContextwithJSContextand I also rewroteis_platform_object_same_originto use newJSContext. Unfortunately using wrappers2 in them causes crashes (in handle code), so I reverted that part in last commit and will fix handles in mozjs later.Testing: Refactor, but it is covered by WPT tests
Part of #40600