diff options
author | Eileen M. Uchitelle <eileencodes@users.noreply.github.com> | 2021-11-18 16:17:40 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 16:17:40 -0500 |
commit | ea02b93bb95a42439631606269659dffc1981883 (patch) | |
tree | e160c058568e0de4f74911ba647a9d103a45c9ba /insns.def | |
parent | ab737b19197c63b84dad9944045a2fd2dc369264 (diff) |
Refactor setclassvariable (#5143)
We only need the cref when we have a cache miss so don't look it up until we
need it. This likely speeds up class variable writes in the interpreter but
also simplifies the jit code.
Before
```
Warming up --------------------------------------
write a cvar 192.280k i/100ms
Calculating -------------------------------------
write a cvar 1.915M (± 3.5%) i/s - 9.614M in 5.026694s
```
After
```
Warming up --------------------------------------
write a cvar 216.308k i/100ms
Calculating -------------------------------------
write a cvar 2.140M (± 3.1%) i/s - 10.815M in 5.058079s
```
Followup to ruby/ruby#5137
Notes
Notes:
Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'insns.def')
-rw-r--r-- | insns.def | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -250,7 +250,7 @@ setclassvariable // attr bool leaf = false; /* has rb_warning() */ { vm_ensure_not_refinement_module(GET_SELF()); - vm_setclassvariable(GET_ISEQ(), vm_get_cref(GET_EP()), GET_CFP(), id, val, (ICVARC)ic); + vm_setclassvariable(GET_ISEQ(), GET_CFP(), id, val, (ICVARC)ic); } /* Get constant variable id. If klass is Qnil and allow_nil is Qtrue, constants |