summaryrefslogtreecommitdiff
path: root/insns.def
diff options
context:
space:
mode:
authorEileen M. Uchitelle <eileencodes@users.noreply.github.com>2021-11-18 12:11:53 -0500
committerGitHub <noreply@github.com>2021-11-18 12:11:53 -0500
commitec574ab3453709490b53b5cc761ec158103fe42a (patch)
tree9fec6338decfd4dbb013ca3981df5159510a9bd4 /insns.def
parentd48f5082e5b5af56bc9a0986eb83bb18520f4233 (diff)
Refactor getclassvariable (#5137)
* Refactor getclassvariable We only need the cref when we have a cache miss so don't look it up until we need it. This speeds up class variable reads in the interpreter but also simplifies the jit code. Benchmarks for master vs this branch (without yjit): Before: ``` Warming up -------------------------------------- read a cvar 1.276M i/100ms Calculating ------------------------------------- read a cvar 12.596M (± 1.7%) i/s - 63.781M in 5.064902s ``` After: ``` Warming up -------------------------------------- read a cvar 1.336M i/100ms Calculating ------------------------------------- read a cvar 13.114M (± 3.6%) i/s - 65.488M in 5.000584s ``` Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org> * Clean up function signatures / remove dead code rb_vm_getclassvariable signature has changed and we don't need rb_vm_get_cref. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def3
1 files changed, 1 insertions, 2 deletions
diff --git a/insns.def b/insns.def
index 7dfeed202b..018e3112ba 100644
--- a/insns.def
+++ b/insns.def
@@ -236,9 +236,8 @@ getclassvariable
/* "class variable access from toplevel" warning can be hooked. */
// attr bool leaf = false; /* has rb_warning() */
{
- rb_cref_t * cref = vm_get_cref(GET_EP());
rb_control_frame_t *cfp = GET_CFP();
- val = vm_getclassvariable(GET_ISEQ(), cref, cfp, id, (ICVARC)ic);
+ val = vm_getclassvariable(GET_ISEQ(), cfp, id, (ICVARC)ic);
}
/* Set value of class variable id of klass as val. */