8000 YJIT: Replace Array#each only when YJIT is enabled by k0kubun · Pull Request #11955 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

YJIT: Replace Array#each only when YJIT is enabled #11955

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 12 commits into from
Nov 4, 2024
Merged
Prev Previous commit
Next Next commit
Give METHOD_ENTRY_BASIC flag to Array#each
  • Loading branch information
k0kubun committed Nov 1, 2024
commit d06ac2b85cbd44d574ebf5e4e048e70bb085085a
3 changes: 3 additions & 0 deletions yjit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,11 @@ def add_yjit_hook(hook)

# Run YJIT hooks registered by RubyVM::YJIT.with_yjit
def call_yjit_hooks
# Unset GET_VM()->running to give METHOD_ENTRY_BASIC flag to methods defined by the hooks
Primitive.cexpr! 'GET_VM()->running = 0'
@yjit_hooks.each(&:call)
@yjit_hooks.clear
Primitive.cexpr! 'GET_VM()->running = 1'
end

# Print stats and dump exit locations
Expand Down
0