Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (20 sloc)
660 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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_reader :cached_type, :cached_method | |
def initialize(type , method) | |
super() | |
@cached_type = type | |
@cached_method = method | |
end | |
def to_s | |
"CacheEntry" + "#{@cached_method&.name}" | |
end | |
end | |
end |