Skip to content

ZJIT: Handle ISEQ moves #14250

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 4 commits into from
Aug 18, 2025
Merged

ZJIT: Handle ISEQ moves #14250

merged 4 commits into from
Aug 18, 2025

Conversation

k0kubun
Copy link
Member

@k0kubun k0kubun commented Aug 15, 2025

This PR updates ISEQ references in IseqCall and Invariants on compaction.

@@ -231,6 +232,7 @@ fn gen_iseq(cb: &mut CodeBlock, iseq: IseqPtr) -> Option<(CodePtr, Vec<Rc<IseqCa
let result = gen_function(cb, iseq, &function);
if let Some((start_ptr, gc_offsets, jit)) = result {
payload.status = IseqStatus::Compiled(start_ptr);
payload.iseq_calls.extend(jit.iseq_calls.clone());
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we pass in a reference?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. I mean it's not a function defined by us.

error[E0271]: type mismatch resolving `<&Vec<Rc<RefCell<IseqCall>>> as IntoIterator>::Item == Rc<RefCell<IseqCall>>`
   --> zjit/src/codegen.rs:235:35
    |
235 |         payload.iseq_calls.extend(&jit.iseq_calls);
    |                            ------ ^^^^^^^^^^^^^^^ expected `Rc<RefCell<IseqCall>>`, found `&Rc<RefCell<IseqCall>>`
    |                            |
    |                            required by a bound introduced by this call
    |
    = note: expected struct `Rc<_>`
            found reference `&Rc<_>`

@k0kubun k0kubun merged commit f38ba24 into ruby:master Aug 18, 2025
80 checks passed
@k0kubun k0kubun deleted the zjit-iseq-move branch August 18, 2025 16:21
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.

ZJIT: Fix rb_zjit_iseq_update_references not handling the move of ISEQ itself
2 participants