Skip to content

Conversation

@sagudev
Copy link
Member

@sagudev sagudev commented Nov 11, 2025

Main usages of using global JSContext in servo are from realms, so with this PR we introduce safe realm concepts that are derived from JSContext (this allows us to enforce LIFO of realms). We also introduce counterpart to servos AlreadyInRealm and InRealm: https://github.com/servo/servo/blob/main/components/script_bindings/realms.rs. Eventually these new safe types should replace old servo types. Because this change make it hard to use runtime I removed most methods from it.

Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

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

This is clever! I'm excited to see how these pieces fit together in Servo!

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>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This allows us to use realm in place of cx without calling any methods as compiler will deref automatically.

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
@sagudev sagudev added this pull request to the merge queue Nov 12, 2025
Merged via the queue into servo:main with commit 8bf5bf8 Nov 12, 2025
68 of 71 checks passed
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