Initialize context to nil on the Drop class

We believe this will reduce megamorphic exits in YJIT. There are
currently 241 separate shapes generated with edge_name "@context" in
SFR. Initializing it to nil will significantly reduce this number.
This commit is contained in:
Jemma Issroff
2023-01-12 15:35:22 -05:00
parent c743936a78
commit 128b4e35be
+4
View File
@@ -25,6 +25,10 @@ module Liquid
class Drop
attr_writer :context
def initialize
@context = nil
end
# Catch all for the method
def liquid_method_missing(method)
return nil unless @context&.strict_variables