From b021f6f8a74bee71aa5ce153e7c2095f0f41ed3d Mon Sep 17 00:00:00 2001 From: Randy Stauner Date: Thu, 5 Dec 2024 15:51:32 -0700 Subject: [PATCH] Use symbol.h in vm.c to get macro for faster ID to sym (#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 Co-authored-by: Takashi Kokubun (k0kubun) Co-authored-by: Maxime Chevalier-Boisvert Co-authored-by: Aaron Patterson --- common.mk | 1 + vm.c | 1 + 2 files changed, 2 insertions(+) diff --git a/common.mk b/common.mk index b5b1de712d..8dd1f1660c 100644 --- a/common.mk +++ b/common.mk @@ -20049,6 +20049,7 @@ vm.$(OBJEXT): {$(VPATH)}rubyparser.h vm.$(OBJEXT): {$(VPATH)}shape.h vm.$(OBJEXT): {$(VPATH)}st.h vm.$(OBJEXT): {$(VPATH)}subst.h +vm.$(OBJEXT): {$(VPATH)}symbol.h vm.$(OBJEXT): {$(VPATH)}thread_$(THREAD_MODEL).h vm.$(OBJEXT): {$(VPATH)}thread_native.h vm.$(OBJEXT): {$(VPATH)}variable.h diff --git a/vm.c b/vm.c index 34a1ef52ce..417ab542c8 100644 --- a/vm.c +++ b/vm.c @@ -33,6 +33,7 @@ #include "internal/variable.h" #include "iseq.h" #include "rjit.h" +#include "symbol.h" // This includes a macro for a more performant rb_id2sym. #include "yjit.h" #include "ruby/st.h" #include "ruby/vm.h"