optimize Struct getter/setter

Introduce new optimized method type
`OPTIMIZED_METHOD_TYPE_STRUCT_AREF/ASET` with index information.
This commit is contained in:
Koichi Sasada 2021-11-18 11:01:31 +09:00
parent be71c95b88
commit 82ea287018
Notes: git 2021-11-19 08:32:59 +09:00
10 changed files with 181 additions and 238 deletions

6
proc.c
View file

@ -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;
}