Skip to content

YJIT: Add more information to an assert message in jit_guard_known_class#14480

Merged
k0kubun merged 2 commits intoruby:masterfrom
k0kubun:yjit-class-debug
Sep 8, 2025
Merged

YJIT: Add more information to an assert message in jit_guard_known_class#14480
k0kubun merged 2 commits intoruby:masterfrom
k0kubun:yjit-class-debug

Conversation

@k0kubun
Copy link
Member

@k0kubun k0kubun commented Sep 8, 2025

This PR updates an assertion failure message to help us debug https://bugs.ruby-lang.org/issues/21565 further.

It seems like a compile-time sample_instance and the Context don't agree on each other. To see what's happening, I want to print both sample_instance (likely just a random pointer, but I just want to make sure it's not an immediate we don't handle) and the val_type in the Context.

To ensure the consistency between known_klass and sample_instance, I refactored it to extract known_klass from sample_instance as well.

@k0kubun k0kubun marked this pull request as ready for review September 8, 2025 18:33
@matzbot matzbot requested a review from a team September 8, 2025 18:33
Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
@k0kubun k0kubun merged commit 1b95afd into ruby:master Sep 8, 2025
37 of 40 checks passed
@k0kubun k0kubun deleted the yjit-class-debug branch September 8, 2025 18:52
k0kubun added a commit to k0kubun/ruby that referenced this pull request Sep 8, 2025
…ass (ruby#14480)

* YJIT: Add more information to an assert message

in jit_guard_known_class

* Say "should be a heap object" instead

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>

---------

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
k0kubun added a commit that referenced this pull request Sep 8, 2025
YJIT: Add more information to an assert message in jit_guard_known_class (#14480)

---------

Co-authored-by: Alan Wu <XrXr@users.noreply.github.com>
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