rename locals to frame
This commit is contained in:
@ -15,8 +15,8 @@ module Rubyx
|
||||
def on_def(statement)
|
||||
name , args , body = *statement
|
||||
args_type = make_type(args)
|
||||
locals_type = make_locals(body)
|
||||
@methods << Vool::VoolMethod.new(name , args_type , locals_type , body )
|
||||
frame_type = make_locals(body)
|
||||
@methods << Vool::VoolMethod.new(name , args_type , frame_type , body )
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -31,7 +31,7 @@ module Rubyx
|
||||
|
||||
def test_one_local
|
||||
method = parse_collect("def meth2(arg1); foo = 2 ;end").first
|
||||
assert method.locals_type.variable_index(:foo) , method.locals_type.inspect
|
||||
assert method.frame_type.variable_index(:foo) , method.frame_type.inspect
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -44,7 +44,7 @@ module Rubyx
|
||||
|
||||
def test_method_has_no_locals
|
||||
method = create_method
|
||||
assert_equal 1 , method.locals_type.instance_length
|
||||
assert_equal 1 , method.frame_type.instance_length
|
||||
end
|
||||
|
||||
def test_method_has_args
|
||||
@ -54,7 +54,7 @@ module Rubyx
|
||||
|
||||
def test_method_has_locals
|
||||
method = create_method_local
|
||||
assert_equal 2 , method.locals_type.instance_length
|
||||
assert_equal 2 , method.frame_type.instance_length
|
||||
end
|
||||
|
||||
def test_method_create_tmp
|
||||
@ -65,7 +65,7 @@ module Rubyx
|
||||
def test_method_add_tmp
|
||||
method = create_method_local
|
||||
method.create_tmp
|
||||
assert_equal 3 , method.locals_type.instance_length
|
||||
assert_equal 3 , method.frame_type.instance_length
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -31,7 +31,7 @@ module Vm
|
||||
raise "must define local '#{name}' before using it" unless index
|
||||
named_list = use_reg :NamedList
|
||||
add_slot_to_reg("#{name} load locals" , :message , :frame , named_list )
|
||||
ret = use_reg @method.locals_type( index )
|
||||
ret = use_reg @method.frame_type( index )
|
||||
add_slot_to_reg("#{name} load from locals" , named_list , index + 1, ret )
|
||||
return ret
|
||||
end
|
||||
|
Reference in New Issue
Block a user