use frame type rather than the indexed construct

This commit is contained in:
Torsten Ruger 2016-12-21 18:59:07 +02:00
parent 93ba5543b3
commit 0e99ff33ae
4 changed files with 4 additions and 7 deletions

View File

@ -25,7 +25,7 @@ module Typed
# TODO, check type @method.locals[index].type
named_list = use_reg(:NamedList)
add_code Register.get_slot(statement , :message , :named_list , named_list )
return Register.set_slot(statement , value , named_list , Parfait::NamedList.get_indexed(index) )
return Register.set_slot(statement , value , named_list , index )
end
end
end

View File

@ -29,7 +29,7 @@ module Typed
named_list = use_reg :NamedList
add_code Register.get_slot(statement , :message , :named_list , named_list )
ret = use_reg @method.locals_type( index )
add_code Register.get_slot(statement , named_list , Parfait::NamedList.get_indexed(index), ret )
add_code Register.get_slot(statement , named_list , index, ret )
return ret
end

View File

@ -23,8 +23,5 @@ module Parfait
class NamedList < Object
attribute :next_list
include Indexed
self.offset(2) # 1 == the next_list attributes above + type. (indexed_length gets added)
end
end

View File

@ -48,7 +48,7 @@ class TestAssignStatement < MiniTest::Test
was = check
get = was.next(5)
assert_equal GetSlot , get.class
assert_equal 4, get.index , "Get to named_list index must be offset, not #{get.index}"
assert_equal 1, get.index , "Get to named_list index must be offset, not #{get.index}"
end
def test_assign_int
@ -58,7 +58,7 @@ class TestAssignStatement < MiniTest::Test
was = check
set = was.next(3)
assert_equal SetSlot , set.class
assert_equal 4, set.index , "Set to named_list index must be offset, not #{set.index}"
assert_equal 1, set.index , "Set to named_list index must be offset, not #{set.index}"
end
def test_assign_arg