mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-15 08:50:45 -07:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user