Skip to content

Commit 8c70def

Browse files
jhawthornluke-gru
andcommitted
Use ALWAYS_INLINE for vm_getinstancevariable
Recently rb_vm_getinstancevariable was introduced exposing this method to ZJIT. On clang specifically this ended up causing the compiler not to inline into vm_exec_core and cause a significant performance regression in optcarrot for the interpreter. Co-authored-by: Luke Gruber <[email protected]>
1 parent 191bfcb commit 8c70def

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

vm_insnhelper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1680,6 +1680,7 @@ rb_vm_setclassvariable(const rb_iseq_t *iseq, const rb_control_frame_t *cfp, ID
16801680
vm_setclassvariable(iseq, cfp, id, val, ic);
16811681
}
16821682

1683+
ALWAYS_INLINE(static VALUE vm_getinstancevariable(const rb_iseq_t *iseq, VALUE obj, ID id, IVC ic));
16831684
static inline VALUE
16841685
vm_getinstancevariable(const rb_iseq_t *iseq, VALUE obj, ID id, IVC ic)
16851686
{

0 commit comments

Comments
 (0)