diff options
author | Jimmy Miller <jimmy.miller@shopify.com> | 2022-11-08 15:28:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-08 15:28:28 -0500 |
commit | 1a65ab20cb6519ab3d4e58141cfd812eaea5f7e0 (patch) | |
tree | d0ec67422f133161e45e00841c4c84992bb075d4 /yjit.c | |
parent | aada904d94ece1d1b48d6275169d3f906a062247 (diff) | |
download | ruby-1a65ab20cb6519ab3d4e58141cfd812eaea5f7e0.tar.gz |
Implement optimize call (#6691)
This dispatches to a c func for doing the dynamic lookup. I experimented with chain on the proc but wasn't able to detect which call sites would be monomorphic vs polymorphic. There is definitely room for optimization here, but it does reduce exits.
Diffstat (limited to 'yjit.c')
-rw-r--r-- | yjit.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -716,6 +716,15 @@ rb_get_iseq_body_param_opt_table(const rb_iseq_t *iseq) return iseq->body->param.opt_table; } +VALUE +rb_optimized_call(VALUE *recv, rb_execution_context_t *ec, int argc, VALUE *argv, int kw_splat, VALUE block_handler) +{ + rb_proc_t *proc; + GetProcPtr(recv, proc); + return rb_vm_invoke_proc(ec, proc, argc, argv, kw_splat, block_handler); +} + + // If true, the iseq is leaf and it can be replaced by a single C call. bool rb_leaf_invokebuiltin_iseq_p(const rb_iseq_t *iseq) |