Skip to content

Conversation

@sagudev
Copy link
Member

@sagudev sagudev commented Nov 18, 2025

We replace many places that use SafeJSContext with JSContext and I also rewrote is_platform_object_same_origin to use new JSContext. 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

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>
@sagudev sagudev requested a review from jdm November 18, 2025 12:14
@sagudev sagudev requested a review from gterzian as a code owner November 18, 2025 12:14
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 18, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 18, 2025
@sagudev sagudev added this pull request to the merge queue Nov 19, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 19, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 19, 2025
@servo-highfive servo-highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Nov 19, 2025
@sagudev sagudev added this pull request to the merge queue Nov 19, 2025
@servo-highfive servo-highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Nov 19, 2025
Merged via the queue into servo:main with commit c27f8c5 Nov 19, 2025
41 checks passed
@sagudev sagudev deleted the more_safe_cx branch November 19, 2025 06:50
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 19, 2025
@yezhizhen
Copy link
Member

This seems to bloat the binary size. I don't know enough about bindings, but is this expected?

cc @jschwe

@sagudev
Copy link
Member Author

sagudev commented Nov 19, 2025

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?

@jschwe
Copy link
Member

jschwe commented Nov 19, 2025

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.

github-merge-queue bot pushed a commit that referenced this pull request Dec 25, 2025
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>
@sagudev sagudev mentioned this pull request Dec 25, 2025
1 task
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.

5 participants