Skip to content

ZJIT: Precise GC writebarriers #13935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 17, 2025

Conversation

jhawthorn
Copy link
Member

This issues writebarriers for objects added via gc_offsets or by profiling. This may be slower than writebarrier_remember, but we would like it to be more debuggable.

We found the lack of gc_offset writebarriers via wbcheck

This issues writebarriers for objects added via gc_offsets or by
profiling. This may be slower than writebarrier_remember, but we would
like it to be more debuggable.

Co-authored-by: Max Bernstein <ruby@bernsteinbear.com>
Co-authored-by: Stan Lo <stan001212@gmail.com>
@matzbot matzbot requested a review from a team July 17, 2025 17:59
Copy link
Contributor

@tekknolagi tekknolagi left a comment

Choose a reason for hiding this comment

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

lgtm (but I was there) -- wdyt @XrXr ?

@tekknolagi tekknolagi requested a review from a team July 17, 2025 18:01
Copy link
Member

@XrXr XrXr left a comment

Choose a reason for hiding this comment

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

Sounds good to me.

Side note: we should really have a proper object pool instead of baking VALUEs directly into code. It's one of those things that we never got around to doing for YJIT. Should be faster to mark an array of VALUEs than to scavenge VALUEs everywhere in generated code.

@tekknolagi tekknolagi enabled auto-merge (squash) July 17, 2025 18:12
@k0kubun
Copy link
Member

k0kubun commented Jul 17, 2025

looks good to me too.

This issues writebarriers for objects added via gc_offsets or by profiling. This may be slower than writebarrier_remember, but we would like it to be more debuggable.

seems fair.


Side note: we should really have a proper object pool instead of baking VALUEs directly into code.

About the object pool idea, I'm still worried about a potential overhead added by introducing one indirection that doesn't exist today. If production gets better CoW efficiency, it'd be a fair trade-off in terms of overall performance, but I'd like us to carefully evaluate the speed when we get to work on it.

@tekknolagi tekknolagi disabled auto-merge July 17, 2025 18:15
@k0kubun
Copy link
Member

k0kubun commented Jul 17, 2025

tekknolagi disabled auto-merge

Sorry, the latter half of my comment might have confused you, but it has nothing to do with this PR. You don't need to disable auto-merge 😅 I'll issue one again.

@k0kubun k0kubun enabled auto-merge (squash) July 17, 2025 18:16
@tekknolagi
Copy link
Contributor

Haha, no, unrelated to your comment -- I got excited and forgot about how we have been normally letting committers merge on their own post-review and non-committers expressly request a merge

@k0kubun
Copy link
Member

k0kubun commented Jul 17, 2025

ok, I'll disable mine too then

@k0kubun k0kubun disabled auto-merge July 17, 2025 18:31
@jhawthorn jhawthorn merged commit cb33f22 into ruby:master Jul 17, 2025
85 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.

5 participants