adjust branch names
IsXXX with xxx as condition, same as after if_xxx AlwaysBranch is back to Branch
This commit is contained in:
@ -17,8 +17,8 @@ class Object
|
||||
end
|
||||
HERE
|
||||
@expect = [[SaveReturn,LoadConstant,LoadConstant,
|
||||
OperatorInstruction,IsZeroBranch] ,
|
||||
[LoadConstant,AlwaysBranch] ,[LoadConstant] ,[] ,
|
||||
OperatorInstruction,IsZero] ,
|
||||
[LoadConstant,Branch] ,[LoadConstant] ,[] ,
|
||||
[RegisterTransfer,GetSlot,FunctionReturn]]
|
||||
check
|
||||
end
|
||||
@ -35,8 +35,8 @@ class Object
|
||||
end
|
||||
HERE
|
||||
@expect = [[SaveReturn,LoadConstant,LoadConstant,
|
||||
OperatorInstruction,IsZeroBranch] ,
|
||||
[AlwaysBranch] ,[LoadConstant] ,[] ,
|
||||
OperatorInstruction,IsZero] ,
|
||||
[Branch] ,[LoadConstant] ,[] ,
|
||||
[RegisterTransfer,GetSlot,FunctionReturn]]
|
||||
check
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ class Object
|
||||
end
|
||||
end
|
||||
HERE
|
||||
@expect = [[SaveReturn],[LoadConstant,IsZeroBranch,LoadConstant,AlwaysBranch],
|
||||
@expect = [[SaveReturn],[LoadConstant,IsZero,LoadConstant,Branch],
|
||||
[],[RegisterTransfer,GetSlot,FunctionReturn]]
|
||||
check
|
||||
end
|
||||
@ -32,7 +32,7 @@ class Object
|
||||
end
|
||||
HERE
|
||||
@expect = [[SaveReturn,LoadConstant,GetSlot,SetSlot],[GetSlot,GetSlot,LoadConstant,OperatorInstruction,
|
||||
IsZeroBranch,GetSlot,GetSlot,LoadConstant,OperatorInstruction,GetSlot,SetSlot,AlwaysBranch],
|
||||
IsZero,GetSlot,GetSlot,LoadConstant,OperatorInstruction,GetSlot,SetSlot,Branch],
|
||||
[],[RegisterTransfer,GetSlot,FunctionReturn]]
|
||||
check
|
||||
end
|
||||
@ -51,9 +51,9 @@ class Object
|
||||
end
|
||||
HERE
|
||||
@expect = [[SaveReturn,LoadConstant,GetSlot,SetSlot],
|
||||
[GetSlot,GetSlot,LoadConstant,OperatorInstruction,IsZeroBranch,GetSlot,
|
||||
[GetSlot,GetSlot,LoadConstant,OperatorInstruction,IsZero,GetSlot,
|
||||
GetSlot,LoadConstant,OperatorInstruction,GetSlot,SetSlot,GetSlot,
|
||||
GetSlot,AlwaysBranch] ,
|
||||
GetSlot,Branch] ,
|
||||
[],[RegisterTransfer,GetSlot,FunctionReturn]]
|
||||
check
|
||||
end
|
||||
|
@ -26,7 +26,7 @@ class AddTest < MiniTest::Test
|
||||
|
||||
def test_branch
|
||||
was = @interpreter.block
|
||||
assert_equal Register::AlwaysBranch , ticks(1).class
|
||||
assert_equal Register::Branch , ticks(1).class
|
||||
assert was != @interpreter.block
|
||||
end
|
||||
def test_load
|
||||
@ -66,7 +66,7 @@ class AddTest < MiniTest::Test
|
||||
|
||||
def test_chain
|
||||
#show_ticks # get output of what is
|
||||
["AlwaysBranch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","SaveReturn","LoadConstant","LoadConstant","OperatorInstruction",
|
||||
"RegisterTransfer","GetSlot","FunctionReturn","RegisterTransfer","Syscall",
|
||||
"NilClass"].each_with_index do |name , index|
|
||||
|
@ -59,7 +59,7 @@ HERE
|
||||
@interpreter = Interpreter::Interpreter.new
|
||||
@interpreter.start Virtual.machine.init
|
||||
#show_ticks # get output of what is
|
||||
["AlwaysBranch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","SaveReturn","GetSlot","LoadConstant","SetSlot",
|
||||
"LoadConstant","SetSlot","RegisterTransfer","FunctionCall","SaveReturn",
|
||||
"LoadConstant","GetSlot","SetSlot","GetSlot","GetSlot",
|
||||
@ -67,22 +67,22 @@ HERE
|
||||
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
|
||||
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
|
||||
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
|
||||
"GetSlot","SetSlot","LoadConstant","SetSlot","GetSlot",
|
||||
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
|
||||
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
|
||||
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
|
||||
"GetSlot","SetSlot","LoadConstant","SetSlot","GetSlot",
|
||||
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
|
||||
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
|
||||
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
|
||||
"GetSlot","SetSlot","LoadConstant","SetSlot","GetSlot",
|
||||
"SetSlot","RegisterTransfer","FunctionCall","SaveReturn","GetSlot",
|
||||
"LoadConstant","OperatorInstruction","GetSlot","SetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","OperatorInstruction","GetSlot","SetSlot",
|
||||
"GetSlot","GetSlot","IsZeroBranch","GetSlot","GetSlot",
|
||||
"GetSlot","GetSlot","IsZero","GetSlot","GetSlot",
|
||||
"GetSlot"].each_with_index do |name , index|
|
||||
got = ticks(1)
|
||||
assert got.class.name.index(name) , "Wrong class for #{index+1}, expect #{name} , got #{got}"
|
||||
|
@ -26,7 +26,7 @@ class TestPuts < MiniTest::Test
|
||||
|
||||
def test_branch
|
||||
was = @interpreter.block
|
||||
assert_equal Register::AlwaysBranch , ticks(1).class
|
||||
assert_equal Register::Branch , ticks(1).class
|
||||
assert was != @interpreter.block
|
||||
end
|
||||
def test_load
|
||||
@ -56,7 +56,7 @@ class TestPuts < MiniTest::Test
|
||||
|
||||
def test_chain
|
||||
#show_ticks # get output of what is
|
||||
["AlwaysBranch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
["Branch","LoadConstant","GetSlot","SetSlot","RegisterTransfer",
|
||||
"FunctionCall","SaveReturn","GetSlot","LoadConstant","SetSlot",
|
||||
"LoadConstant","SetSlot","RegisterTransfer","FunctionCall","SaveReturn",
|
||||
"GetSlot","RegisterTransfer","Syscall","RegisterTransfer","RegisterTransfer",
|
||||
|
Reference in New Issue
Block a user