diff --git a/lib/risc/builtin/integer.rb b/lib/risc/builtin/integer.rb index e7d1cf0a..e404cabc 100644 --- a/lib/risc/builtin/integer.rb +++ b/lib/risc/builtin/integer.rb @@ -35,8 +35,8 @@ module Risc compiler = compiler_for(:Integer, operator ,{other: :Integer}) builder = compiler.builder(true, compiler.method) me , other = builder.self_and_int_arg("#{operator} load receiver and arg") - false_label = Risc.label(compiler.method , "false_label_#{builder.object_id}") - merge_label = Risc.label(compiler.method , "merge_label_#{builder.object_id}") + false_label = Risc.label(compiler.method , "false_label_#{builder.object_id.to_s(16)}") + merge_label = Risc.label(compiler.method , "merge_label_#{builder.object_id.to_s(16)}") builder.reduce_int( "#{operator} fix me", me ) builder.reduce_int( "#{operator} fix arg", other ) if(operator.to_s.start_with?('<') ) diff --git a/lib/risc/text_writer.rb b/lib/risc/text_writer.rb index 0ab3d291..a6e8167d 100644 --- a/lib/risc/text_writer.rb +++ b/lib/risc/text_writer.rb @@ -15,8 +15,7 @@ module Risc def initialize( machine) @machine = machine - @objects = machine.objects - @load_at = 0x8054 # this is linux/arm + @load_at = 0x10054 # this is linux/arm end # objects must be written in same order as positioned by the machine, namely @@ -35,7 +34,7 @@ module Risc # debugging loop to write out positions (in debug) def write_debug - @objects.each do |id , objekt| + @machine.objects.each do |id , objekt| next if objekt.is_a?(Risc::Label) log.debug "Linked #{objekt.class}:0x#{objekt.object_id.to_s(16)} at 0x#{Positioned.position(objekt).to_s(16)} / 0x#{objekt.padded_length.to_s(16)}" end @@ -44,7 +43,7 @@ module Risc # Write all the objects def write_objects # then the objects , not code yet - @objects.each do | id, objekt| + @machine.objects.each do | id, objekt| next if objekt.is_a? Parfait::BinaryCode next if objekt.is_a? Risc::Label # ignore write_any( objekt ) @@ -54,7 +53,7 @@ module Risc # Write the BinaryCode objects of all methods to stream. # Really like any other object, it's just about the ordering def write_code - @objects.each do |id, method| + @machine.objects.each do |id, method| next unless method.is_a? Parfait::TypedMethod binary = method.binary while(binary) do @@ -155,7 +154,7 @@ module Risc write_ref_for( code.next ) write_ref_for( code.get_type ) @stream.write_signed_int_32( MARKER ) - log.debug "Code16 witten stream 0x#{@stream.length.to_s(16)}" + log.debug "Init witten stream 0x#{@stream.length.to_s(16)}" end def write_BinaryCode( code ) diff --git a/lib/vool/statements/if_statement.rb b/lib/vool/statements/if_statement.rb index b28056a2..5a677e56 100644 --- a/lib/vool/statements/if_statement.rb +++ b/lib/vool/statements/if_statement.rb @@ -25,8 +25,8 @@ module Vool end def simple_if(method) - true_label = Mom::Label.new( "true_label_#{object_id}") - merge_label = Mom::Label.new( "merge_label_#{object_id}") + true_label = Mom::Label.new( "true_label_#{object_id.to_s(16)}") + merge_label = Mom::Label.new( "merge_label_#{object_id.to_s(16)}") head = Mom::TruthCheck.new(condition.slot_definition(method) , merge_label) head << true_label @@ -35,9 +35,9 @@ module Vool end def full_if(method) - true_label = Mom::Label.new( "true_label_#{object_id}") - false_label = Mom::Label.new( "false_label_#{object_id}") - merge_label = Mom::Label.new( "merge_label_#{object_id}") + true_label = Mom::Label.new( "true_label_#{object_id.to_s(16)}") + false_label = Mom::Label.new( "false_label_#{object_id.to_s(16)}") + merge_label = Mom::Label.new( "merge_label_#{object_id.to_s(16)}") head = Mom::TruthCheck.new(condition.slot_definition(method) , false_label) head << true_label diff --git a/lib/vool/statements/while_statement.rb b/lib/vool/statements/while_statement.rb index bfe9b1c5..c3eb58e2 100644 --- a/lib/vool/statements/while_statement.rb +++ b/lib/vool/statements/while_statement.rb @@ -17,8 +17,8 @@ module Vool end def to_mom( method ) - merge_label = Mom::Label.new( "merge_label_#{object_id}") - cond_label = Mom::Label.new( "cond_label_#{object_id}") + merge_label = Mom::Label.new( "merge_label_#{object_id.to_s(16)}") + cond_label = Mom::Label.new( "cond_label_#{object_id.to_s(16)}") codes = cond_label codes << @hoisted.to_mom(method) if @hoisted codes << Mom::TruthCheck.new(condition.slot_definition(method) , merge_label)