script: Add cx_no_gc/cx/realm codegen option and demostrate them#40582
Merged
sagudev merged 7 commits intoservo:mainfrom Nov 16, 2025
Merged
script: Add cx_no_gc/cx/realm codegen option and demostrate them#40582sagudev merged 7 commits intoservo:mainfrom
cx_no_gc/cx/realm codegen option and demostrate them#40582sagudev merged 7 commits intoservo:mainfrom
Conversation
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
realm codegen option and demostrate safe realm/jscontextcx_no_gc/cx/realm codegen option and demostrate them
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
Signed-off-by: sagudev <[email protected]>
jdm
approved these changes
Nov 16, 2025
Member
jdm
left a comment
There was a problem hiding this comment.
Really nice work making this possible to integrate incrementally!
6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Companion to servo/mozjs#650
We added 3 new options to bindings.conf, each more powerful then the previous one, so one should use the least powerful as possible to keep things flexible:
1
cx_no_gcprepends argument&JSContext, which allows creating NoGC tokens and using functions that do not trigger GC.2.
cxprepends argument&mut JSContext, which allows everything that previous one allows, but it also allows calling GC triggering functions.3.
realmprepends argument&mut CurrentRealm, which can be deref_mut to&mut JSContext(so it can do everything that previous can), but it also ensures that there is current entered realm, which can be used for creation of InRealm.next steps: #40600
reviewable per commit
Testing: It's just refactoring
try run: https://github.com/sagudev/servo/actions/runs/19287700927