-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Differentiate T_ARRAY and array subclasses #7091
Conversation
This commit teaches the YJIT context the difference between Arrays (objects with type T_ARRAY and class rb_cArray) vs Array subclasses (objects with type T_ARRAY but _not_ class rb_cArray). It uses this information to reduce the number of guards emitted when using `jit_guard_known_klass` with rb_cArray, notably opt_aref
This sounds like a useful thing. Certainly I had good luck with the same change to strings. Have you run any benchmarks on it? |
Looks like a good idea 👍 Could you include the output of |
reminder: You can see this one on CI Beforehttps://github.com/ruby/ruby/actions/runs/3878313771/jobs/6614355505
Afterhttps://github.com/ruby/ruby/actions/runs/3885204101/jobs/6628783596
|
Well done! |
This commit teaches the YJIT context the difference between Arrays (objects with type T_ARRAY and class rb_cArray) vs Array subclasses (objects with type T_ARRAY but not class rb_cArray). It uses this information to reduce the number of guards emitted when using
jit_guard_known_klass
with rb_cArray, notably opt_aref