move towards locals (not hardcoding registers)
This commit is contained in:
parent
570b6db659
commit
b281c24a39
@ -82,10 +82,10 @@ module Core
|
|||||||
fibo_function = Vm::Function.new(:fibo , [Vm::Integer , Vm::Integer] , Vm::Integer )
|
fibo_function = Vm::Function.new(:fibo , [Vm::Integer , Vm::Integer] , Vm::Integer )
|
||||||
result = fibo_function.args[0]
|
result = fibo_function.args[0]
|
||||||
int = fibo_function.args[1]
|
int = fibo_function.args[1]
|
||||||
count = Vm::Integer.new(2)
|
count = fibo_function.new_local
|
||||||
loop_block = Vm::Block.new("loop", nil)
|
loop_block = Vm::Block.new("loop", nil)
|
||||||
f1 = Vm::Integer.new(3)
|
f1 = fibo_function.new_local
|
||||||
f2 = Vm::Integer.new(4)
|
f2 = fibo_function.new_local
|
||||||
b = fibo_function.body.scope binding
|
b = fibo_function.body.scope binding
|
||||||
|
|
||||||
b.a int == 1
|
b.a int == 1
|
||||||
|
Loading…
Reference in New Issue
Block a user