Skip to content

Commit b021f6f

Browse files
rwstaunerXrXrk0kubunMaxime Chevalier-Boisverttenderlove
authored
Use symbol.h in vm.c to get macro for faster ID to sym (ruby#12272)
The macro provided by symbol.h uses STATIC_ID2SYM when it can which speeds up methods that declare keyword args. Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: Takashi Kokubun (k0kubun) <takashikkbn@gmail.com> Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
1 parent eedb30d commit b021f6f

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

common.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20049,6 +20049,7 @@ vm.$(OBJEXT): {$(VPATH)}rubyparser.h
2004920049
vm.$(OBJEXT): {$(VPATH)}shape.h
2005020050
vm.$(OBJEXT): {$(VPATH)}st.h
2005120051
vm.$(OBJEXT): {$(VPATH)}subst.h
20052+
vm.$(OBJEXT): {$(VPATH)}symbol.h
2005220053
vm.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h
2005320054
vm.$(OBJEXT): {$(VPATH)}thread_native.h
2005420055
vm.$(OBJEXT): {$(VPATH)}variable.h

vm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "internal/variable.h"
3434
#include "iseq.h"
3535
#include "rjit.h"
36+
#include "symbol.h" // This includes a macro for a more performant rb_id2sym.
3637
#include "yjit.h"
3738
#include "ruby/st.h"
3839
#include "ruby/vm.h"

0 commit comments

Comments
 (0)