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.
This commit is contained in:
卜部昌平 2020-07-09 21:43:42 +09:00
parent 5d02c1dd14
commit f66e0212ef
Notes: git 2020-07-13 08:56:53 +09:00
7 changed files with 77 additions and 15 deletions

View file

@ -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)