adding cache entry to parfait

This commit is contained in:
Torsten Ruger
2018-03-17 19:03:39 +05:30
parent 16c8fcbf66
commit 642f16b73a
4 changed files with 21 additions and 4 deletions

View File

@ -0,0 +1,17 @@
# 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 TypedMethod that is to be called
# This is used in DynamicCall, see there
#
module Parfait
class CacheEntry < Object
attr :cached_type
attr :cached_method
def initialize(type , method)
@cached_type = type
@cached_method = method
end
end
end