summaryrefslogtreecommitdiff
path: root/yjit.c
diff options
context:
space:
mode:
authorJimmy Miller <jimmy.miller@shopify.com>2022-11-08 15:28:28 -0500
committerGitHub <noreply@github.com>2022-11-08 15:28:28 -0500
commit1a65ab20cb6519ab3d4e58141cfd812eaea5f7e0 (patch)
treed0ec67422f133161e45e00841c4c84992bb075d4 /yjit.c
parentaada904d94ece1d1b48d6275169d3f906a062247 (diff)
downloadruby-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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/yjit.c b/yjit.c
index b943277d61..aa49b3cfdc 100644
--- a/yjit.c
+++ b/yjit.c
@@ -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)