always return slot definitions
fixing sends defs
This commit is contained in:
parent
642f16b73a
commit
3fecdf54a5
@ -11,7 +11,7 @@ module Vool
|
|||||||
@value = value
|
@value = value
|
||||||
end
|
end
|
||||||
def slot_definition(method)
|
def slot_definition(method)
|
||||||
return Mom::IntegerConstant.new(@value)
|
return Mom::SlotDefinition.new(Mom::IntegerConstant.new(@value) , [])
|
||||||
end
|
end
|
||||||
def ct_type
|
def ct_type
|
||||||
Parfait.object_space.get_class_by_name(:Integer).instance_type
|
Parfait.object_space.get_class_by_name(:Integer).instance_type
|
||||||
@ -65,7 +65,7 @@ module Vool
|
|||||||
@value = value
|
@value = value
|
||||||
end
|
end
|
||||||
def slot_definition(method)
|
def slot_definition(method)
|
||||||
return Mom::StringConstant.new(@value)
|
return Mom::SlotDefinition.new(Mom::StringConstant.new(@value),[])
|
||||||
end
|
end
|
||||||
def ct_type
|
def ct_type
|
||||||
Parfait.object_space.get_class_by_name(:Word).instance_type
|
Parfait.object_space.get_class_by_name(:Word).instance_type
|
||||||
|
@ -15,7 +15,7 @@ module Vool
|
|||||||
def initialize(name , receiver , arguments )
|
def initialize(name , receiver , arguments )
|
||||||
@name , @receiver , @arguments = name , receiver , arguments
|
@name , @receiver , @arguments = name , receiver , arguments
|
||||||
@arguments ||= []
|
@arguments ||= []
|
||||||
@dynamic = nil
|
@dynamic = Mom::DynamicCall.new()
|
||||||
end
|
end
|
||||||
|
|
||||||
def normalize
|
def normalize
|
||||||
@ -92,23 +92,22 @@ module Vool
|
|||||||
# this may look like a simple_call, but the difference is that we don't know
|
# this may look like a simple_call, but the difference is that we don't know
|
||||||
# the method until run-time. Alas the setup is the same
|
# the method until run-time. Alas the setup is the same
|
||||||
def call_cached_method(in_method)
|
def call_cached_method(in_method)
|
||||||
@dynamic = Mom::DynamicCall.new()
|
|
||||||
message_setup(in_method) << @dynamic
|
message_setup(in_method) << @dynamic
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def build_condition
|
def build_condition
|
||||||
cached_type = Mom::SlotDefinition.new(@dynamic , [:cached_type])
|
cached_type = Mom::SlotDefinition.new(@dynamic.cache_entry , [:cached_type])
|
||||||
current_type = Mom::SlotDefinition.new(:message , [:receiver , :type])
|
current_type = Mom::SlotDefinition.new(:message , [:receiver , :type])
|
||||||
Mom::NotSameCheck.new(cached_type , current_type)
|
Mom::NotSameCheck.new(cached_type , current_type)
|
||||||
end
|
end
|
||||||
def build_type_cache_update
|
def build_type_cache_update
|
||||||
Mom::SlotLoad.new([@dynamic, :cached_type] , [:receiver , :type])
|
Mom::SlotLoad.new([@dynamic.cache_entry, :cached_type] , [:message , :receiver , :type])
|
||||||
end
|
end
|
||||||
def build_method_cache_update(in_method)
|
def build_method_cache_update(in_method)
|
||||||
receiver = StringConstant.new(@name)
|
receiver = StringConstant.new(@name)
|
||||||
resolve = SendStatement.new(:resolve_method , receiver , [SelfExpression.new])
|
resolve = SendStatement.new(:resolve_method , receiver , [SelfExpression.new])
|
||||||
move_method = Mom::SlotLoad.new([@dynamic, :cached_method] , [:receiver , :return])
|
move_method = Mom::SlotLoad.new([@dynamic.cache_entry, :cached_method] , [:message ,:receiver , :return])
|
||||||
resolve.to_mom(in_method) << move_method
|
resolve.to_mom(in_method) << move_method
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user