diff options
author | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-07-09 21:43:42 +0900 |
---|---|---|
committer | 卜部昌平 <shyouhei@ruby-lang.org> | 2020-07-13 08:56:18 +0900 |
commit | f66e0212efe4f6572d5e81741e831ab735cc2fee (patch) | |
tree | 94b45502a7d483489b697c3966b7d75e9cfd9b40 /struct.c | |
parent | 5d02c1dd14648d95178ac5ec756f5b03fe00d549 (diff) |
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.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3305
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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) |