Skip to content

ZJIT: Guard protected calls with the caller's self - #1111

Closed
efegokdemir wants to merge 1 commit into
Shopify:masterfrom
efegokdemir:efe/zjit-protected-methods-1109
Closed

efegokdemir wants to merge 1 commit into
Shopify:masterfrom
efegokdemir:efe/zjit-protected-methods-1109

Conversation

@efegokdemir

Copy link
Copy Markdown

ZJIT now specializes explicit protected calls with class-owned method entries after checking that the caller's self inherits the defining class. Failed checks exit to the interpreter so Ruby can raise the visibility error; module-owned and refined entries retain the generic send path. Tests cover the protected Hash#[] alias used by Active Support, an unrelated caller, and module/refinement fallbacks. Six focused ZJIT tests pass. Closes #1109.

Specialize class-owned protected calls after checking the caller's self. Exit to the interpreter when the visibility check fails.

Fixes Shopify#1109
@github-actions github-actions Bot added the jit label Nov 6, 2026
@tekknolagi

Copy link
Copy Markdown

Please file PRs to ruby/ruby.

@tekknolagi tekknolagi closed this Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZJIT: Support protected methods

2 participants