fix a whole bunch of vool to_mom

All but those requiring boot functions
This commit is contained in:
Torsten Rüger
2019-08-07 15:08:45 +03:00
parent 1237e079f7
commit d5625a70d7
26 changed files with 134 additions and 131 deletions

View File

@ -7,6 +7,7 @@ module Mom
#
class ReturnJump < Instruction
# the jump quite simple resolves to an uncondition risc Branch
def to_risc(compiler)
compiler.add_code Risc::Branch.new(self , compiler.return_label)
end

View File

@ -21,9 +21,9 @@ module Vool
# to the method compiler for further processing
def to_mom( compiler )
parfait_block = self.parfait_block(compiler)
block_compiler = Risc::BlockCompiler.new( parfait_block , compiler.get_method )
block_compiler = Mom::BlockCompiler.new( parfait_block , compiler.get_method )
head = body.to_mom( block_compiler )
block_compiler.add_mom(head)
block_compiler.add_code(head)
block_compiler
end

View File

@ -15,8 +15,8 @@ module Vool
end
def simple_if(compiler)
true_label = Mom::Label.new( "true_label_#{object_id.to_s(16)}")
merge_label = Mom::Label.new( "merge_label_#{object_id.to_s(16)}")
true_label = Mom::Label.new( self,"true_label_#{object_id.to_s(16)}")
merge_label = Mom::Label.new( self,"merge_label_#{object_id.to_s(16)}")
head = Mom::TruthCheck.new(condition.slot_definition(compiler) , merge_label)
head << true_label

View File

@ -6,9 +6,9 @@ module Vool
slot_def = compiler.slot_type_for(@name)
to = Mom::SlotDefinition.new(:message ,slot_def)
from = @value.slot_definition(compiler)
return chain_assign( Mom::SlotLoad.new(to,from) , compiler)
return chain_assign( Mom::SlotLoad.new(self,to,from) , compiler)
end
end
end

View File

@ -50,7 +50,7 @@ module Vool
arg_target = [:message , :next_message , :arguments]
args = []
@arguments.each_with_index do |arg , index| # +1 because of type
args << Mom::SlotLoad.new( arg_target + [index + 1] , arg.slot_definition(compiler))
args << Mom::SlotLoad.new(self, arg_target + [index + 1] , arg.slot_definition(compiler))
end
setup << Mom::ArgumentTransfer.new( mom_receive , args )
end

View File

@ -10,8 +10,8 @@ module Vool
end
def to_mom( compiler )
merge_label = Mom::Label.new( "merge_label_#{object_id.to_s(16)}")
cond_label = Mom::Label.new( "cond_label_#{object_id.to_s(16)}")
merge_label = Mom::Label.new(self, "merge_label_#{object_id.to_s(16)}")
cond_label = Mom::Label.new(self, "cond_label_#{object_id.to_s(16)}")
codes = cond_label
codes << @hoisted.to_mom(compiler) if @hoisted
codes << Mom::TruthCheck.new(condition.slot_definition(compiler) , merge_label)

View File

@ -33,7 +33,7 @@ module Vool
# this needs run-time variable resolution, which is just not done.
# we brace ourselves with the check, and exit (later raise) if . . .
def method_check(compiler)
ok_label = Mom::Label.new("method_ok_#{self.object_id}")
ok_label = Mom::Label.new(self,"method_ok_#{self.object_id}")
compile_method = Mom::SlotDefinition.new( compiler.get_method , [])
runtime_method = Mom::SlotDefinition.new( :message , [ :method] )
check = Mom::NotSameCheck.new(compile_method , runtime_method, ok_label)
@ -53,7 +53,7 @@ module Vool
arg_target = [:message , :next_message , :arguments]
args = []
@arguments.each_with_index do |arg , index| # +1 because of type
args << Mom::SlotLoad.new( arg_target + [index + 1] , arg.slot_definition(compiler))
args << Mom::SlotLoad.new(self, arg_target + [index + 1] , arg.slot_definition(compiler))
end
setup << Mom::ArgumentTransfer.new( mom_receive , args )
setup << Mom::BlockYield.new( arg_index )