summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-07-09 21:43:42 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-07-13 08:56:18 +0900
commitf66e0212efe4f6572d5e81741e831ab735cc2fee (patch)
tree94b45502a7d483489b697c3966b7d75e9cfd9b40 /struct.c
parent5d02c1dd14648d95178ac5ec756f5b03fe00d549 (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.c4
1 files changed, 2 insertions, 2 deletions
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)