Skip to content

script: Replace uses of RootedVec<JSVal> with Rooted<Vec<JSVal>>.#41921

Merged
jdm merged 4 commits intoservo:mainfrom
jdm:rooted-vec
Jan 22, 2026
Merged

script: Replace uses of RootedVec<JSVal> with Rooted<Vec<JSVal>>.#41921
jdm merged 4 commits intoservo:mainfrom
jdm:rooted-vec

Conversation

@jdm
Copy link
Member

@jdm jdm commented Jan 15, 2026

This replaces uses of our custom RootedVec type that were storing JS GC values with stack rooting that is better integrated with the engine. This ensures that storing nursery-allocated objects in these vectors is handled correctly during GC, unlike our RootedVec implementation which trips an assertion in debug mozjs builds.

Testing: No observable difference in non-mozjs builds.
Fixes: part of #40141

@jdm
Copy link
Member Author

jdm commented Jan 15, 2026

FYI @Taym95

github-merge-queue bot pushed a commit to servo/mozjs that referenced this pull request Jan 18, 2026
We created our `RootedVec` type back before we supported storing
arbitrary traceable types in SpiderMonkey's `Rooted` class. Now that we
can do that, we can replicate SpiderMonkey's `RootedVec`, which is just
a Rooted wrapper around a vector.

Testing: New unit test added.
Servo PR: servo/servo#41921

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@sagudev
Copy link
Member

sagudev commented Jan 18, 2026

mozjs bump is here: #41971, so this PR should land after it.

@jdm jdm marked this pull request as ready for review January 18, 2026 13:38
@jdm jdm requested a review from gterzian as a code owner January 18, 2026 13:38
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 18, 2026
jdm added 2 commits January 19, 2026 00:13
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Jan 19, 2026
@jdm jdm added this pull request to the merge queue Jan 19, 2026
@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 Jan 19, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 19, 2026
@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 Jan 19, 2026
…ent list.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
@servo-highfive servo-highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 21, 2026
@jdm jdm enabled auto-merge January 21, 2026 20:09
@jdm jdm added this pull request to the merge queue Jan 21, 2026
@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 Jan 21, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 21, 2026
@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 Jan 21, 2026
@jdm jdm added this pull request to the merge queue Jan 21, 2026
@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 Jan 21, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 21, 2026
@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 Jan 21, 2026
@jdm jdm added this pull request to the merge queue Jan 22, 2026
@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 Jan 22, 2026
Merged via the queue into servo:main with commit cadcc60 Jan 22, 2026
44 checks passed
@jdm jdm deleted the rooted-vec branch January 22, 2026 05: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 Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants