Rename SlotDefinition to Slot
And the derived XXDefinitions to XXSlot Just to be more consistent And possibly free the Definition for the Language side
This commit is contained in:
@ -32,7 +32,7 @@ module Sol
|
||||
#
|
||||
# Derived classes do not implement to_slot, only slot_position
|
||||
def to_slot(compiler)
|
||||
to = SlotMachine::SlotDefinition.for(:message , self.slot_position(compiler))
|
||||
to = SlotMachine::Slot.for(:message , self.slot_position(compiler))
|
||||
from = @value.to_slot_definition(compiler)
|
||||
assign = SlotMachine::SlotLoad.new(self,to,from)
|
||||
return assign unless @value.is_a?(CallStatement)
|
||||
|
@ -10,7 +10,7 @@ module Sol
|
||||
@value = value
|
||||
end
|
||||
def to_slot_definition(_)
|
||||
return SlotMachine::SlotDefinition.for(SlotMachine::IntegerConstant.new(@value) , [])
|
||||
return SlotMachine::Slot.for(SlotMachine::IntegerConstant.new(@value) , [])
|
||||
end
|
||||
def ct_type
|
||||
Parfait.object_space.get_type_by_class_name(:Integer)
|
||||
@ -38,7 +38,7 @@ module Sol
|
||||
Parfait.object_space.get_type_by_class_name(:True)
|
||||
end
|
||||
def to_slot_definition(_)
|
||||
return SlotMachine::SlotDefinition.for(Parfait.object_space.true_object , [])
|
||||
return SlotMachine::Slot.for(Parfait.object_space.true_object , [])
|
||||
end
|
||||
def to_s(depth = 0)
|
||||
"true"
|
||||
@ -50,7 +50,7 @@ module Sol
|
||||
Parfait.object_space.get_type_by_class_name(:False)
|
||||
end
|
||||
def to_slot_definition(_)
|
||||
return SlotMachine::SlotDefinition.for(Parfait.object_space.false_object , [])
|
||||
return SlotMachine::Slot.for(Parfait.object_space.false_object , [])
|
||||
end
|
||||
def to_s(depth = 0)
|
||||
"false"
|
||||
@ -62,7 +62,7 @@ module Sol
|
||||
Parfait.object_space.get_type_by_class_name(:Nil)
|
||||
end
|
||||
def to_slot_definition(_)
|
||||
return SlotMachine::SlotDefinition.for(Parfait.object_space.nil_object , [])
|
||||
return SlotMachine::Slot.for(Parfait.object_space.nil_object , [])
|
||||
end
|
||||
def to_s(depth = 0)
|
||||
"nil"
|
||||
@ -77,7 +77,7 @@ module Sol
|
||||
end
|
||||
def to_slot_definition(compiler)
|
||||
@my_type = compiler.receiver_type
|
||||
SlotMachine::SlotDefinition.for(:message , [:receiver])
|
||||
SlotMachine::Slot.for(:message , [:receiver])
|
||||
end
|
||||
def ct_type
|
||||
@my_type
|
||||
@ -92,7 +92,7 @@ module Sol
|
||||
@value = value
|
||||
end
|
||||
def to_slot_definition(_)
|
||||
return SlotMachine::SlotDefinition.for(SlotMachine::StringConstant.new(@value),[])
|
||||
return SlotMachine::Slot.for(SlotMachine::StringConstant.new(@value),[])
|
||||
end
|
||||
def ct_type
|
||||
Parfait.object_space.get_type_by_class_name(:Word)
|
||||
|
@ -11,7 +11,7 @@ module Sol
|
||||
# When used as right hand side, this tells what data to move to get the result into
|
||||
# a varaible. It is (off course) the return value of the message
|
||||
def to_slot_definition(_)
|
||||
SlotMachine::SlotDefinition.for(:message ,[ :return_value])
|
||||
SlotMachine::Slot.for(:message ,[ :return_value])
|
||||
end
|
||||
|
||||
def to_s(depth = 0)
|
||||
|
@ -15,7 +15,7 @@ module Sol
|
||||
# fact never called)
|
||||
def to_slot_definition(compiler)
|
||||
compile(compiler) unless @parfait_block
|
||||
return SlotMachine::SlotDefinition.for(SlotMachine::LambdaConstant.new(parfait_block(compiler)) , [])
|
||||
return SlotMachine::Slot.for(SlotMachine::LambdaConstant.new(parfait_block(compiler)) , [])
|
||||
end
|
||||
|
||||
# create a block, a compiler for it, compile the block and add the compiler(code)
|
||||
|
@ -15,7 +15,7 @@ module Sol
|
||||
# When used as right hand side, this tells what data to move to get the result into
|
||||
# a varaible. It is (off course) the return value of the message
|
||||
def to_slot_definition(_)
|
||||
SlotMachine::SlotDefinition.for(:message ,[ :return_value])
|
||||
SlotMachine::Slot.for(:message ,[ :return_value])
|
||||
end
|
||||
|
||||
def to_s(depth = 0)
|
||||
|
@ -116,7 +116,7 @@ module Sol
|
||||
defi
|
||||
end
|
||||
def build_condition(ok_label, compiler)
|
||||
cached_type = SlotMachine::SlotDefinition.for(dynamic_call.cache_entry , [:cached_type])
|
||||
cached_type = SlotMachine::Slot.for(dynamic_call.cache_entry , [:cached_type])
|
||||
current_type = receiver_type_definition(compiler)
|
||||
SlotMachine::NotSameCheck.new(cached_type , current_type, ok_label)
|
||||
end
|
||||
|
@ -12,7 +12,7 @@ module Sol
|
||||
include Named
|
||||
def to_slot_definition(compiler)
|
||||
slot_def = compiler.slot_type_for(@name)
|
||||
SlotMachine::SlotDefinition.for(:message , slot_def)
|
||||
SlotMachine::Slot.for(:message , slot_def)
|
||||
end
|
||||
def to_s(depth = 0)
|
||||
name.to_s
|
||||
@ -25,7 +25,7 @@ module Sol
|
||||
class InstanceVariable < Expression
|
||||
include Named
|
||||
def to_slot_definition(_)
|
||||
SlotMachine::SlotDefinition.for(:message , [ :receiver , @name] )
|
||||
SlotMachine::Slot.for(:message , [ :receiver , @name] )
|
||||
end
|
||||
# used to collect type information
|
||||
def add_ivar( array )
|
||||
@ -52,7 +52,7 @@ module Sol
|
||||
get_named_class.single_class.instance_type
|
||||
end
|
||||
def to_slot_definition(_)
|
||||
return SlotMachine::SlotDefinition.for( get_named_class, [])
|
||||
return SlotMachine::Slot.for( get_named_class, [])
|
||||
end
|
||||
def get_named_class
|
||||
Parfait.object_space.get_class_by_name(self.name)
|
||||
|
@ -34,8 +34,8 @@ module Sol
|
||||
# we brace ourselves with the check, and exit (later raise) if . . .
|
||||
def method_check(compiler)
|
||||
ok_label = SlotMachine::Label.new(self,"method_ok_#{self.object_id}")
|
||||
compile_method = SlotMachine::SlotDefinition.for( compiler.get_method , [])
|
||||
runtime_method = SlotMachine::SlotDefinition.for( :message , [ :method] )
|
||||
compile_method = SlotMachine::Slot.for( compiler.get_method , [])
|
||||
runtime_method = SlotMachine::Slot.for( :message , [ :method] )
|
||||
check = SlotMachine::NotSameCheck.new(compile_method , runtime_method, ok_label)
|
||||
# TODO? Maybe create slot instructions for this
|
||||
#builder = compiler.builder("yield")
|
||||
|
Reference in New Issue
Block a user