shaves an instruction off resolve_method
by loading nil directly, not space first
This commit is contained in:
@ -15,32 +15,30 @@ module Risc
|
||||
SlotToReg, SlotToReg, SlotToReg, OperatorInstruction, IsZero, # 10
|
||||
SlotToReg, SlotToReg, SlotToReg, Branch, LoadConstant,
|
||||
RegToSlot, LoadConstant, LoadConstant, SlotToReg, SlotToReg, # 20
|
||||
LoadConstant, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
|
||||
OperatorInstruction, IsZero, Branch, SlotToReg, Branch, # 30
|
||||
LoadConstant, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
|
||||
OperatorInstruction, IsZero, Branch, SlotToReg, Branch, # 40
|
||||
LoadConstant, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
|
||||
OperatorInstruction, IsZero, Branch, SlotToReg, Branch, # 50
|
||||
LoadConstant, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
|
||||
OperatorInstruction, IsZero, Branch, SlotToReg, Branch, # 60
|
||||
LoadConstant, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
|
||||
OperatorInstruction, IsZero, Branch, SlotToReg, Branch, # 70
|
||||
LoadConstant, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
|
||||
OperatorInstruction, IsZero, RegToSlot, Branch, LoadConstant, # 80
|
||||
SlotToReg, LoadConstant, SlotToReg, SlotToReg, RegToSlot,
|
||||
RegToSlot, RegToSlot, RegToSlot, SlotToReg, SlotToReg, # 90
|
||||
SlotToReg, RegToSlot, Branch, LoadConstant, SlotToReg,
|
||||
RegToSlot, SlotToReg, LoadConstant, SlotToReg, DynamicJump, # 100
|
||||
SlotToReg, SlotToReg, LoadData, OperatorInstruction, LoadConstant,
|
||||
SlotToReg, SlotToReg, RegToSlot, RegToSlot, RegToSlot, # 110
|
||||
SlotToReg, SlotToReg, RegToSlot, Branch, LoadConstant,
|
||||
SlotToReg, RegToSlot, RegToSlot, SlotToReg, SlotToReg, # 120
|
||||
SlotToReg, FunctionReturn, SlotToReg, SlotToReg, RegToSlot,
|
||||
SlotToReg, SlotToReg, RegToSlot, Branch, Branch, # 130
|
||||
SlotToReg, SlotToReg, RegToSlot, LoadConstant, SlotToReg,
|
||||
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg, # 140
|
||||
FunctionReturn, Transfer, SlotToReg, SlotToReg, Syscall,
|
||||
NilClass, ]
|
||||
LoadConstant, OperatorInstruction, IsZero, SlotToReg, OperatorInstruction,
|
||||
IsZero, SlotToReg, Branch, Branch, LoadConstant, # 30
|
||||
OperatorInstruction, IsZero, SlotToReg, OperatorInstruction, IsZero,
|
||||
SlotToReg, Branch, Branch, LoadConstant, OperatorInstruction, # 40
|
||||
IsZero, SlotToReg, OperatorInstruction, IsZero, SlotToReg,
|
||||
Branch, Branch, LoadConstant, OperatorInstruction, IsZero, # 50
|
||||
SlotToReg, OperatorInstruction, IsZero, SlotToReg, Branch,
|
||||
Branch, LoadConstant, OperatorInstruction, IsZero, SlotToReg, # 60
|
||||
OperatorInstruction, IsZero, SlotToReg, Branch, Branch,
|
||||
LoadConstant, OperatorInstruction, IsZero, SlotToReg, OperatorInstruction, # 70
|
||||
IsZero, RegToSlot, LoadConstant, Branch, SlotToReg,
|
||||
LoadConstant, SlotToReg, SlotToReg, RegToSlot, RegToSlot, # 80
|
||||
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
|
||||
RegToSlot, LoadConstant, Branch, SlotToReg, RegToSlot, # 90
|
||||
SlotToReg, LoadConstant, SlotToReg, DynamicJump, SlotToReg,
|
||||
SlotToReg, LoadData, OperatorInstruction, LoadConstant, SlotToReg, # 100
|
||||
SlotToReg, RegToSlot, RegToSlot, RegToSlot, SlotToReg,
|
||||
SlotToReg, RegToSlot, Branch, LoadConstant, SlotToReg, # 110
|
||||
RegToSlot, RegToSlot, SlotToReg, SlotToReg, SlotToReg,
|
||||
FunctionReturn, SlotToReg, SlotToReg, RegToSlot, SlotToReg, # 120
|
||||
SlotToReg, RegToSlot, Branch, SlotToReg, SlotToReg,
|
||||
RegToSlot, LoadConstant, SlotToReg, RegToSlot, RegToSlot, # 130
|
||||
SlotToReg, SlotToReg, SlotToReg, FunctionReturn, Transfer,
|
||||
SlotToReg, SlotToReg, Syscall, NilClass, ]
|
||||
assert_equal Fixnum , get_return.class
|
||||
assert_equal 1 , get_return
|
||||
end
|
||||
@ -57,17 +55,17 @@ module Risc
|
||||
end
|
||||
|
||||
def test_dyn
|
||||
cal = main_ticks(100)
|
||||
cal = main_ticks(94)
|
||||
assert_equal DynamicJump , cal.class
|
||||
end
|
||||
def test_return
|
||||
ret = main_ticks(141)
|
||||
ret = main_ticks(134)
|
||||
assert_equal FunctionReturn , ret.class
|
||||
link = @interpreter.get_register( ret.register )
|
||||
assert_equal Fixnum , link.class
|
||||
end
|
||||
def test_sys
|
||||
sys = main_ticks(145)
|
||||
sys = main_ticks(138)
|
||||
assert_equal Syscall , sys.class
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user