diff --git a/lib/elf/object_writer.rb b/lib/elf/object_writer.rb index 97bebdfe..72f250e4 100644 --- a/lib/elf/object_writer.rb +++ b/lib/elf/object_writer.rb @@ -30,7 +30,9 @@ module Elf end end end - + assembler.objects.values.each do |slot| + add_symbol "#{slot.object.class.name}::#{slot.position.to_s(16)}" , slot.position + end end attr_reader :text def set_text(text) diff --git a/lib/register/assembler.rb b/lib/register/assembler.rb index dec3cdc5..00e09a33 100644 --- a/lib/register/assembler.rb +++ b/lib/register/assembler.rb @@ -22,6 +22,7 @@ module Register @space = space @objects = {} end + attr_reader :objects def link link_object(@space) diff --git a/lib/virtual/compiled_method.rb b/lib/virtual/compiled_method.rb index 6e86920f..93862d28 100644 --- a/lib/virtual/compiled_method.rb +++ b/lib/virtual/compiled_method.rb @@ -43,7 +43,7 @@ module Virtual @receiver = receiver @return_type = return_type # first block we have to create with .new , as new_block assumes a current - enter = Block.new( name , self ).add_code(MethodEnter.new()) + enter = Block.new( "enter" , self ).add_code(MethodEnter.new()) @blocks = [enter] @current = enter new_block("return").add_code(MethodReturn.new) @@ -100,8 +100,7 @@ module Virtual # In code generation , the new_block is written after this one, ie zero runtime cost # This does _not_ change the insertion point, that has do be done with insert_at(block) def new_block new_name - block_name = "#{@current.name}_#{new_name}" - new_b = Block.new( block_name , self ) + new_b = Block.new( new_name , self ) index = @blocks.index( @current ) @blocks.insert( index + 1 , new_b ) # + one because we want the ne after the insert_at return new_b