introduces compile time type (ct_type)

to determine whether we can call directly
This commit is contained in:
Torsten Ruger
2017-04-19 20:59:13 +03:00
parent d2fba19b95
commit 3e282c083d
8 changed files with 130 additions and 12 deletions

View File

@ -41,24 +41,21 @@ module Vool
pops = [Mom::SlotConstant.new([:message , :next_message , :receiver] , @receiver) ]
@arguments.each_with_index do |arg , index|
arg_target = [:message , :next_message , :arguments]
pops << Mom::SlotConstant.new( arg_target << index , arg)
pops << Mom::SlotConstant.new( arg_target + [index] , arg)
end
pops
end
def call_instruction
if(receiver_type)
if(@receiver.ct_type)
simple_call
else
cached_call
end
end
def receiver_type
Parfait.object_space.get_class_by_name(:Integer).instance_type
end
def simple_call
type = receiver_type
type = @receiver.ct_type
method = type.get_method(@name)
[Mom::SimpleCall.new( method) ]
end