From f66e0212efe4f6572d5e81741e831ab735cc2fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Thu, 9 Jul 2020 21:43:42 +0900 Subject: precalc invokebuiltin destinations Noticed that struct rb_builtin_function is a purely compile-time constant. MJIT can eliminate some runtime calculations by statically generate dedicated C code generator for each builtin functions. --- struct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'struct.c') diff --git a/struct.c b/struct.c index 9390602b26..0ff0ec3722 100644 --- a/struct.c +++ b/struct.c @@ -316,9 +316,9 @@ opt_struct_aset(rb_execution_context_t *ec, VALUE self, VALUE val, VALUE idx) } static const struct rb_builtin_function struct_aref_builtin = - RB_BUILTIN_FUNCTION(0, struct_aref, opt_struct_aref, 1); + RB_BUILTIN_FUNCTION(0, struct_aref, opt_struct_aref, 1, 0); static const struct rb_builtin_function struct_aset_builtin = - RB_BUILTIN_FUNCTION(1, struct_aref, opt_struct_aset, 2); + RB_BUILTIN_FUNCTION(1, struct_aref, opt_struct_aset, 2, 0); static void define_aref_method(VALUE nstr, VALUE name, VALUE off) -- cgit v1.2.3