diff --git a/lib/interpreter/interpreter.rb b/lib/interpreter/interpreter.rb index b476fe42..a6ea9ae6 100644 --- a/lib/interpreter/interpreter.rb +++ b/lib/interpreter/interpreter.rb @@ -205,7 +205,7 @@ module Interpreter else raise "unimplemented '#{@instruction.operator}' #{@instruction}" end - puts "#{@instruction} == #{result} (#{left}|#{right})" + #puts "#{@instruction} == #{result} (#{left}|#{right})" right = set_register(@instruction.left , result) true end diff --git a/lib/parfait/frame.rb b/lib/parfait/frame.rb index ef501cc6..ed522dac 100644 --- a/lib/parfait/frame.rb +++ b/lib/parfait/frame.rb @@ -20,7 +20,7 @@ module Parfait attribute :next_frame def self.offset - 1 + Space.object_space.get_class_by_name(:Frame).object_layout.object_instance_length + 1 + Space.object_space.get_class_by_name(:Frame).object_layout.instance_length end end diff --git a/lib/parfait/message.rb b/lib/parfait/message.rb index d33067a7..ee4d547b 100644 --- a/lib/parfait/message.rb +++ b/lib/parfait/message.rb @@ -30,7 +30,7 @@ module Parfait end def self.offset - 1 + Space.object_space.get_class_by_name(:Message).object_layout.object_instance_length + 1 + Space.object_space.get_class_by_name(:Message).object_layout.instance_length end end end diff --git a/lib/parfait/object.rb b/lib/parfait/object.rb index 6001953d..b42f4e2f 100644 --- a/lib/parfait/object.rb +++ b/lib/parfait/object.rb @@ -73,7 +73,7 @@ module Parfait end def get_instance_variables - get_layout().object_instance_names + get_layout().instance_names end def get_instance_variable name diff --git a/lib/register/collector.rb b/lib/register/collector.rb index a52cd72b..88bfafa1 100644 --- a/lib/register/collector.rb +++ b/lib/register/collector.rb @@ -23,7 +23,7 @@ module Register layout = object.get_layout keep(layout , depth + 1) return if object.is_a? Symbol - layout.object_instance_names.each do |name| + layout.instance_names.each do |name| #puts "Keep #{name} for #{object.class}" inst = object.get_instance_variable name keep(inst , depth + 1) diff --git a/test/parfait/test_attributes.rb b/test/parfait/test_attributes.rb index cd24ce20..764f6461 100644 --- a/test/parfait/test_attributes.rb +++ b/test/parfait/test_attributes.rb @@ -12,11 +12,11 @@ class TestAttributes < MiniTest::Test end def test_message_layout_first @layout.object_class = :next_message - assert_equal :layout , @layout.object_instance_names.first + assert_equal :layout , @layout.instance_names.first assert_equal :next_message , @layout.object_class end def test_message_name_nil - last = @layout.object_instance_names.last + last = @layout.instance_names.last assert_equal :name , last assert_equal nil , @mess.name end diff --git a/test/parfait/test_layout.rb b/test/parfait/test_layout.rb index 6df8a575..7726db34 100644 --- a/test/parfait/test_layout.rb +++ b/test/parfait/test_layout.rb @@ -24,10 +24,6 @@ class TestLayout < MiniTest::Test assert_equal @mess.get_layout , @mess.internal_object_get(0) , "mess" end - def test_forbidden_index_of - assert_raises(RuntimeError) { @mess.get_layout.index_of(:name)} - end - def test_inspect assert @mess.get_layout.inspect.start_with?("Layout") end @@ -37,12 +33,12 @@ class TestLayout < MiniTest::Test end def test_length - assert_equal 8 , @mess.get_layout.object_instance_length , @mess.get_layout.inspect + assert_equal 8 , @mess.get_layout.instance_length , @mess.get_layout.inspect end def test_no_index_below_1 layout = @mess.get_layout - names = layout.object_instance_names + names = layout.instance_names assert_equal 8 , names.get_length , names.inspect names.each do |n| assert layout.variable_index(n) >= 1 @@ -54,7 +50,7 @@ class TestLayout < MiniTest::Test assert_equal Parfait::Class , oc.class layout = oc.object_layout assert_equal Parfait::Layout , layout.class - assert_equal 1 , layout.object_instance_names.get_length + assert_equal 1 , layout.instance_names.get_length assert_equal layout.first , :layout end diff --git a/test/parfait/test_object.rb b/test/parfait/test_object.rb index cf14be76..13293a41 100644 --- a/test/parfait/test_object.rb +++ b/test/parfait/test_object.rb @@ -7,7 +7,7 @@ class TestObject < MiniTest::Test end def test_object_create - assert_equal 1 , @object.get_layout.object_instance_length + assert_equal 1 , @object.get_layout.instance_length end def test_empty_object_doesnt_return