Skip to content

added more information on gc and rooting#212

Merged
jdm merged 19 commits intoservo:mainfrom
Narfinger:gc
Apr 15, 2026
Merged

added more information on gc and rooting#212
jdm merged 19 commits intoservo:mainfrom
Narfinger:gc

Conversation

@Narfinger
Copy link
Copy Markdown
Contributor

This adds more information on Gc and rooting.

Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script/index.md
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
@Narfinger
Copy link
Copy Markdown
Contributor Author

Narfinger commented Mar 12, 2026

Thanks for the comments! Currently I can't look at the formatting and how it looks in compiled form that is why it is in draft mode (and so other people can check the correctness).
If somebody could contribute a small section how to use the rooted1 macro that would also be awesome.

Copy link
Copy Markdown
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.

In-progress review because I need to think more about this, and also sleep. We jump from a very simplistic view of the GC (it can happen anywhere! at any time!) to suddenly passing around a mutable pointer to the context and talking about unrooted values. I think we probably want to introduce the idea of &mut JSContext much earlier in this documentation, possibly in the first example.

Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script/index.md
Comment thread src/design-documentation/script.md Outdated
Comment thread src/design-documentation/script/index.md
Comment thread src/design-documentation/script.md Outdated
@Narfinger Narfinger force-pushed the gc branch 2 times, most recently from a36ea0f to 8d649e0 Compare March 12, 2026 10:22
@Narfinger
Copy link
Copy Markdown
Contributor Author

Ok github screwed up a bit so I hope I got all the suggestions in.
I can think about a bit more how to include the JSContext stuff.

But I feel like it might not make sense to have it at the start. The start should be imho about why we need Gc anyway, What the rooted types are and how crown fits in all this.

Then (probably before performance subsection) we can introduce JSContext. Something like: "But Gc actually only runs when we do specific spidermonkey apis and having CanGC everywhere is hazardous".

@Narfinger
Copy link
Copy Markdown
Contributor Author

Ok I added, hopefully, a better transition from rooting to CanGc and then to JSContext.

@Narfinger Narfinger marked this pull request as ready for review March 31, 2026 06:51
Narfinger and others added 9 commits April 14, 2026 11:10
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Copy link
Copy Markdown
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.

The flow makes a lot more sense to me now! I've made a bunch of editorial suggestions, but we should be good to merge this soon!

Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Comment thread src/design-documentation/script/index.md Outdated
Narfinger and others added 8 commits April 15, 2026 09:06
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Narfinger and others added 2 commits April 15, 2026 09:08
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@jdm jdm added this pull request to the merge queue Apr 15, 2026
Merged via the queue into servo:main with commit f91e6f0 Apr 15, 2026
@Narfinger Narfinger deleted the gc branch April 15, 2026 13:32
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.

3 participants