rubyx/lib/parfait/cache_entry.rb
Torsten Ruger b0aefe31fe make all instances attr read writers
unfortunately the writers have to have self.var =
otherwise it is just a local var
Also need to make the type explicit for all
Protocol included memory_length on the class for now
2018-08-11 19:15:34 +03:00

23 lines
653 B
Ruby

# For dynamic calls (ie method calls where the method can not be determined at compile time)
# we resolve the method at runtime, and then cache it. Aaron has shown that over 99%
# of call sites are type stable, so one cache entry at the moment
#
# A cache entry stores the type of the object and the CallableMethod that is to be called
# This is used in DynamicCall, see there
#
module Parfait
class CacheEntry < Object
attr :type, :cached_type, :cached_method
def initialize(type , method)
self.cached_type = type
self.cached_method = method
end
def to_s
"CacheEntry" + "#{cached_method&.name}"
end
end
end