change return sequence to return messages to space

as it was before blocks
(thought blocks would make reuse of messages impossible, but was wrong, this only appilies to lambdas)
(too) many tests affected
This commit is contained in:
Torsten Ruger
2018-08-06 14:07:17 +03:00
parent 77cbc0ad6a
commit 393ac873c9
31 changed files with 193 additions and 399 deletions

View File

@ -13,9 +13,9 @@ module Risc
#show_main_ticks # get output of what is
check_main_chain [LoadConstant, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
RegToSlot, Branch, SlotToReg, SlotToReg, RegToSlot,
SlotToReg, SlotToReg, SlotToReg, Branch, FunctionReturn,
Transfer, SlotToReg, SlotToReg, Branch, Syscall,
NilClass]
LoadConstant, SlotToReg, RegToSlot, Branch, RegToSlot,
SlotToReg, SlotToReg, SlotToReg, FunctionReturn, Transfer,
SlotToReg, SlotToReg, Branch, Syscall, NilClass]
assert_equal 15 , get_return
end
@ -31,17 +31,17 @@ module Risc
assert_equal 15 , @interpreter.get_register(load_ins.register).value
end
def test_return
ret = main_ticks(15)
ret = main_ticks(19)
assert_equal FunctionReturn , ret.class
link = @interpreter.get_register( ret.register )
assert_equal Fixnum , link.class
end
def test_transfer
transfer = main_ticks(16)
transfer = main_ticks(20)
assert_equal Transfer , transfer.class
end
def test_sys
sys = main_ticks(20)
sys = main_ticks(24)
assert_equal Syscall , sys.class
end
end

View File

@ -9,22 +9,8 @@ module Risc
super
end
def test_chain
#show_main_ticks # get output of what is
check_main_chain [LoadConstant, LoadConstant, SlotToReg, RegToSlot, RegToSlot,
SlotToReg, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
RegToSlot, RegToSlot, SlotToReg, Branch, RegToSlot,
LoadConstant, SlotToReg, RegToSlot, LoadConstant, SlotToReg,
SlotToReg, RegToSlot, LoadConstant, SlotToReg, RegToSlot,
SlotToReg, FunctionCall, SlotToReg, SlotToReg, SlotToReg,
SlotToReg, SlotToReg, OperatorInstruction, LoadConstant, SlotToReg,
SlotToReg, RegToSlot, RegToSlot, RegToSlot, SlotToReg,
Branch, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
SlotToReg, FunctionReturn, SlotToReg, SlotToReg, RegToSlot,
SlotToReg, SlotToReg, RegToSlot, Branch, SlotToReg,
SlotToReg, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
Branch, FunctionReturn, Transfer, SlotToReg, SlotToReg,
Branch, Syscall, NilClass]
def test_ret
run_all
assert_equal 10 , get_return
end
end

View File

@ -9,35 +9,8 @@ module Risc
super
end
def test_chain
#show_main_ticks # get output of what is
check_main_chain [LoadConstant, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
SlotToReg, RegToSlot, LoadConstant, LoadConstant, SlotToReg,
RegToSlot, RegToSlot, SlotToReg, Branch, SlotToReg,
RegToSlot, SlotToReg, SlotToReg, RegToSlot, RegToSlot,
SlotToReg, RegToSlot, LoadConstant, SlotToReg, RegToSlot,
SlotToReg, SlotToReg, Branch, SlotToReg, SlotToReg,
RegToSlot, LoadConstant, SlotToReg, RegToSlot, SlotToReg,
FunctionCall, SlotToReg, SlotToReg, SlotToReg, SlotToReg,
SlotToReg, OperatorInstruction, LoadConstant, SlotToReg, SlotToReg,
RegToSlot, RegToSlot, RegToSlot, SlotToReg, Branch,
SlotToReg, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
FunctionReturn, SlotToReg, SlotToReg, RegToSlot, SlotToReg,
SlotToReg, Branch, SlotToReg, RegToSlot, LoadConstant,
LoadConstant, SlotToReg, RegToSlot, RegToSlot, SlotToReg,
SlotToReg, RegToSlot, SlotToReg, SlotToReg, RegToSlot,
Branch, RegToSlot, SlotToReg, RegToSlot, LoadConstant,
SlotToReg, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
SlotToReg, RegToSlot, LoadConstant, SlotToReg, Branch,
RegToSlot, SlotToReg, FunctionCall, SlotToReg, SlotToReg,
SlotToReg, SlotToReg, SlotToReg, OperatorInstruction, LoadConstant,
SlotToReg, SlotToReg, RegToSlot, RegToSlot, RegToSlot,
SlotToReg, Branch, SlotToReg, RegToSlot, SlotToReg,
SlotToReg, SlotToReg, FunctionReturn, SlotToReg, SlotToReg,
RegToSlot, SlotToReg, SlotToReg, RegToSlot, Branch,
SlotToReg, SlotToReg, RegToSlot, Branch, SlotToReg,
SlotToReg, SlotToReg, FunctionReturn, Transfer, SlotToReg,
SlotToReg, Branch, Syscall, NilClass]
def test_all
run_all
assert_equal 15 , get_return
end

View File

@ -9,24 +9,8 @@ module Risc
super
end
def test_chain
#show_main_ticks # get output of what is
check_main_chain [LoadConstant, SlotToReg, RegToSlot, SlotToReg, SlotToReg,
SlotToReg, RegToSlot, LoadConstant, LoadConstant, SlotToReg,
RegToSlot, RegToSlot, SlotToReg, Branch, SlotToReg,
RegToSlot, SlotToReg, SlotToReg, RegToSlot, RegToSlot,
SlotToReg, RegToSlot, LoadConstant, SlotToReg, RegToSlot,
SlotToReg, SlotToReg, Branch, SlotToReg, SlotToReg,
RegToSlot, LoadConstant, SlotToReg, RegToSlot, SlotToReg,
FunctionCall, SlotToReg, SlotToReg, SlotToReg, SlotToReg,
SlotToReg, OperatorInstruction, LoadConstant, SlotToReg, SlotToReg,
RegToSlot, RegToSlot, RegToSlot, SlotToReg, Branch,
SlotToReg, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
FunctionReturn, SlotToReg, SlotToReg, RegToSlot, SlotToReg,
SlotToReg, Branch, RegToSlot, Branch, SlotToReg,
SlotToReg, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
FunctionReturn, Transfer, SlotToReg, SlotToReg, Branch,
Syscall, NilClass]
def test_ret
run_all
assert_equal 10 , get_return
end
end