Fix if statements hoisting, now that send is working
Same same, just have to remembe to actually execute the condition if it is a send Having send a possible expression, removes one tmp variable and associated move, for a little extra work. Next return and assign (rest)
This commit is contained in:
@ -11,19 +11,19 @@ module Vool
|
||||
end
|
||||
|
||||
def test_condition
|
||||
assert_equal TruthCheck , @ins.next(4).class
|
||||
assert_equal TruthCheck , @ins.next(3).class
|
||||
end
|
||||
def test_condition_is_slot
|
||||
assert_equal SlotDefinition , @ins.next(4).condition.class , @ins
|
||||
assert_equal SlotDefinition , @ins.next(3).condition.class , @ins
|
||||
end
|
||||
def test_hoisted_dynamic_call
|
||||
def test_hoisted_call
|
||||
assert_equal SimpleCall , @ins.next(2).class
|
||||
assert_equal :div4 , @ins.next(2).method.name
|
||||
end
|
||||
def test_array
|
||||
check_array [MessageSetup, ArgumentTransfer, SimpleCall, SlotLoad, TruthCheck,
|
||||
Label ,SlotLoad, Jump, Label, SlotLoad, Label,
|
||||
Label, ReturnSequence, Label ] , @ins
|
||||
check_array [MessageSetup, ArgumentTransfer, SimpleCall, TruthCheck, Label ,
|
||||
SlotLoad, Jump, Label, SlotLoad, Label ,
|
||||
Label, ReturnSequence, Label] , @ins
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user