diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2025-08-28 19:29:46 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2025-08-29 00:02:29 +0200 |
commit | b6d4882c05d64aa6cb5ff8761584ae910de67f21 (patch) | |
tree | adf5ec7b381d85182c1a2a5a8d2d2d800d1e8ab7 /shape.h | |
parent | b1dbcd3ce3cb61f7b136f4b1e1bb97a6f3635c3e (diff) |
YJIT: getinstancevariable cache indexes for types other than T_OBJECT
While accessing the ivars of other types is too complicated to
realistically generate the ASM for it, we can at least provide
the ivar index as to not have to lookup the shape tree every
time.
```
compare-ruby: ruby 3.5.0dev (2025-08-27T14:58:58Z merge-vm-setivar-d.. 5b749d8e53) +YJIT +PRISM [arm64-darwin24]
built-ruby: ruby 3.5.0dev (2025-08-28T17:58:32Z yjit-get-exivar efaa8c9b09) +YJIT +PRISM [arm64-darwin24]
| |compare-ruby|built-ruby|
|:--------------------------|-----------:|---------:|
|vm_ivar_get_on_obj | 930.458| 936.865|
| | -| 1.01x|
|vm_ivar_get_on_class | 134.471| 431.622|
| | -| 3.21x|
|vm_ivar_get_on_generic | 146.679| 284.408|
| | -| 1.94x|
```
Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
Diffstat (limited to 'shape.h')
-rw-r--r-- | shape.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -24,6 +24,7 @@ STATIC_ASSERT(shape_id_num_bits, SHAPE_ID_NUM_BITS == sizeof(shape_id_t) * CHAR_ // index in rb_shape_tree.shape_list. Allow to access `rb_shape_t *`. // 19-21 SHAPE_ID_HEAP_INDEX_MASK // index in rb_shape_tree.capacities. Allow to access slot size. +// Always 0 except for T_OBJECT. // 22 SHAPE_ID_FL_FROZEN // Whether the object is frozen or not. // 23 SHAPE_ID_FL_HAS_OBJECT_ID |