From 82ea2870188d66aa75a99f03b4e7fdd1750aa196 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Thu, 18 Nov 2021 11:01:31 +0900 Subject: optimize `Struct` getter/setter Introduce new optimized method type `OPTIMIZED_METHOD_TYPE_STRUCT_AREF/ASET` with index information. --- proc.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 9c62abb0c6..13996b102a 100644 --- a/proc.c +++ b/proc.c @@ -2681,6 +2681,12 @@ rb_method_entry_min_max_arity(const rb_method_entry_t *me, int *max) case OPTIMIZED_METHOD_TYPE_BLOCK_CALL: *max = UNLIMITED_ARGUMENTS; return 0; + case OPTIMIZED_METHOD_TYPE_STRUCT_AREF: + *max = 0; + return 0; + case OPTIMIZED_METHOD_TYPE_STRUCT_ASET: + *max = 1; + return 0; default: break; } -- cgit v1.2.1