Skip to content
Permalink
Browse files

update tests

  • Loading branch information
alex committed Jul 6, 2013
1 parent 38159ee commit f8f91b819526fabad9962b6807843b5110ba27cd
Showing with 92 additions and 92 deletions.
  1. +14 −14 tests/jit/test_array.py
  2. +50 −50 tests/jit/test_basic.py
  3. +17 −17 tests/jit/test_closure.py
  4. +11 −11 tests/jit/test_instance_vars.py
@@ -8,39 +8,39 @@ def test_subscript_assign_simple(self, topaz, tmpdir):
10000.times { arr[0] = true }
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p5, p6, p7, p9, p12, i66, p20, p23, p25, p27, i39, p36, p48, p63, descr=TargetToken(4323626640))
label(p0, p1, p3, p4, p5, p6, p7, p8, p10, p13, i69, p21, p24, p26, p28, i40, p37, p51, p66, descr=TargetToken(4310782200))
debug_merge_point(0, 0, 'times at LOAD_DEREF')
debug_merge_point(0, 0, 'times at LOAD_SELF')
debug_merge_point(0, 0, 'times at SEND')
setfield_gc(p27, 42, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x101c0b1f0>)
p69 = force_token()
i70 = int_lt(i66, i39)
guard_true(i70, descr=<Guard0x101c0b178>)
setfield_gc(p28, 42, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100fe5d30>)
p72 = force_token()
i73 = int_lt(i69, i40)
guard_true(i73, descr=<Guard0x100fe5cb8>)
debug_merge_point(0, 0, 'times at JUMP_IF_FALSE')
debug_merge_point(0, 0, 'times at LOAD_DEREF')
debug_merge_point(0, 0, 'times at YIELD')
p71 = force_token()
p74 = force_token()
debug_merge_point(1, 1, 'block in <main> at LOAD_DEREF')
debug_merge_point(1, 1, 'block in <main> at LOAD_CONST')
debug_merge_point(1, 1, 'block in <main> at BUILD_ARRAY')
debug_merge_point(1, 1, 'block in <main> at LOAD_CONST')
debug_merge_point(1, 1, 'block in <main> at BUILD_ARRAY')
debug_merge_point(1, 1, 'block in <main> at SEND_SPLAT')
p72 = force_token()
p75 = force_token()
debug_merge_point(1, 1, 'block in <main> at RETURN')
debug_merge_point(0, 0, 'times at DISCARD_TOP')
debug_merge_point(0, 0, 'times at LOAD_DEREF')
debug_merge_point(0, 0, 'times at LOAD_CONST')
debug_merge_point(0, 0, 'times at SEND')
p73 = force_token()
i74 = int_add(i66, 1)
p76 = force_token()
i77 = int_add(i69, 1)
debug_merge_point(0, 0, 'times at STORE_DEREF')
debug_merge_point(0, 0, 'times at DISCARD_TOP')
debug_merge_point(0, 0, 'times at JUMP')
debug_merge_point(0, 0, 'times at LOAD_DEREF')
setfield_gc(p27, 63, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
i75 = arraylen_gc(p48, descr=<ArrayP 8>)
i76 = arraylen_gc(p63, descr=<ArrayP 8>)
jump(p0, p1, p3, p4, p5, p6, p7, p9, p12, i74, p20, p23, p25, p27, i39, p36, p48, p63, descr=TargetToken(4323626640))
setfield_gc(p28, 63, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
i78 = arraylen_gc(p51, descr=<ArrayP 8>)
i79 = arraylen_gc(p66, descr=<ArrayP 8>)
jump(p0, p1, p3, p4, p5, p6, p7, p8, p10, p13, i77, p21, p24, p26, p28, i40, p37, p51, p66, descr=TargetToken(4310782200))
""")
@@ -10,27 +10,27 @@ def test_while_loop(self, topaz, tmpdir):
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p5, p6, p9, i34, p19, p21, p27, descr=TargetToken(4323625760))
label(p0, p1, p3, p4, p5, p6, p7, p10, i35, p20, p22, p28, descr=TargetToken(4310781936))
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
setfield_gc(p21, 21, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x101bf74c0>)
p36 = force_token()
i37 = int_lt(i34, 10000)
guard_true(i37, descr=<Guard0x101bf7448>)
setfield_gc(p22, 21, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100febda8>)
p37 = force_token()
i38 = int_lt(i35, 10000)
guard_true(i38, descr=<Guard0x100febcb8>)
debug_merge_point(0, 0, '<main> at JUMP_IF_FALSE')
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
p38 = force_token()
i39 = int_add(i34, 1)
p39 = force_token()
i40 = int_add(i35, 1)
debug_merge_point(0, 0, '<main> at STORE_DEREF')
debug_merge_point(0, 0, '<main> at DISCARD_TOP')
debug_merge_point(0, 0, '<main> at JUMP')
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
setfield_gc(p21, 35, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
jump(p0, p1, p3, p4, p5, p6, p9, i39, p19, p21, p27, descr=TargetToken(4323625760))
setfield_gc(p22, 35, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
jump(p0, p1, p3, p4, p5, p6, p7, p10, i40, p20, p22, p28, descr=TargetToken(4310781936))
""")

def test_ivar_while_loop(self, topaz, tmpdir):
@@ -41,35 +41,35 @@ def test_ivar_while_loop(self, topaz, tmpdir):
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p5, p6, p9, p19, p40, p30, p25, descr=TargetToken(4323625760))
label(p0, p1, p3, p4, p5, p6, p7, p10, p20, p41, p31, p26, descr=TargetToken(4310781936))
debug_merge_point(0, 0, '<main> at LOAD_SELF')
debug_merge_point(0, 0, '<main> at LOAD_INSTANCE_VAR')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
setfield_gc(p19, 23, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x101bf3c40>)
p42 = force_token()
i43 = getfield_gc_pure(p40, descr=<FieldS topaz.objects.intobject.W_FixnumObject.inst_intvalue 8>)
i44 = int_lt(i43, 10000)
guard_true(i44, descr=<Guard0x101bf3bc8>)
setfield_gc(p20, 23, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100ff1088>)
p43 = force_token()
i44 = getfield_gc_pure(p41, descr=<FieldS topaz.objects.intobject.W_FixnumObject.inst_intvalue 8>)
i45 = int_lt(i44, 10000)
guard_true(i45, descr=<Guard0x100ff1010>)
debug_merge_point(0, 0, '<main> at JUMP_IF_FALSE')
debug_merge_point(0, 0, '<main> at LOAD_SELF')
debug_merge_point(0, 0, '<main> at DUP_TOP')
debug_merge_point(0, 0, '<main> at LOAD_INSTANCE_VAR')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
p45 = force_token()
i46 = int_add(i43, 1)
p46 = force_token()
i47 = int_add(i44, 1)
debug_merge_point(0, 0, '<main> at STORE_INSTANCE_VAR')
debug_merge_point(0, 0, '<main> at DISCARD_TOP')
debug_merge_point(0, 0, '<main> at JUMP')
debug_merge_point(0, 0, '<main> at LOAD_SELF')
setfield_gc(p19, 39, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
p47 = new_with_vtable(4300487864)
setfield_gc(p47, i46, descr=<FieldS topaz.objects.intobject.W_FixnumObject.inst_intvalue 8>)
setarrayitem_gc(p25, 0, p47, descr=<ArrayP 8>)
i48 = arraylen_gc(p25, descr=<ArrayP 8>)
jump(p0, p1, p3, p4, p5, p6, p9, p19, p47, p30, p25, descr=TargetToken(4323625760))
setfield_gc(p20, 39, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
p48 = new_with_vtable(4300302336)
setfield_gc(p48, i47, descr=<FieldS topaz.objects.intobject.W_FixnumObject.inst_intvalue 8>)
setarrayitem_gc(p26, 0, p48, descr=<ArrayP 8>)
i49 = arraylen_gc(p26, descr=<ArrayP 8>)
jump(p0, p1, p3, p4, p5, p6, p7, p10, p20, p48, p31, p26, descr=TargetToken(4310781936))
""")

def test_constant_string(self, topaz, tmpdir):
@@ -80,30 +80,30 @@ def test_constant_string(self, topaz, tmpdir):
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p5, p6, p9, i35, p19, p21, p27, descr=TargetToken(4310789600))
label(p0, p1, p3, p4, p5, p6, p7, p10, i36, p20, p22, p28, descr=TargetToken(4310781936))
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
setfield_gc(p21, 21, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100fc35b0>)
p37 = force_token()
i38 = int_lt(i35, 10000)
guard_true(i38, descr=<Guard0x100fc3538>)
setfield_gc(p22, 21, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100ff6818>)
p38 = force_token()
i39 = int_lt(i36, 10000)
guard_true(i39, descr=<Guard0x100ff6728>)
debug_merge_point(0, 0, '<main> at JUMP_IF_FALSE')
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at COERCE_STRING')
debug_merge_point(0, 0, '<main> at SEND')
p39 = force_token()
debug_merge_point(0, 0, '<main> at SEND')
p40 = force_token()
i41 = int_add(i35, 1)
debug_merge_point(0, 0, '<main> at SEND')
p41 = force_token()
i42 = int_add(i36, 1)
debug_merge_point(0, 0, '<main> at STORE_DEREF')
debug_merge_point(0, 0, '<main> at DISCARD_TOP')
debug_merge_point(0, 0, '<main> at JUMP')
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
setfield_gc(p21, 41, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
jump(p0, p1, p3, p4, p5, p6, p9, i41, p19, p21, p27, descr=TargetToken(4310789600))
setfield_gc(p22, 41, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
jump(p0, p1, p3, p4, p5, p6, p7, p10, i42, p20, p22, p28, descr=TargetToken(4310781936))
""")

def test_method_missing(self, topaz, tmpdir):
@@ -115,29 +115,28 @@ def test_method_missing(self, topaz, tmpdir):
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p6, p9, i55, p18, p21, p23, p29, descr=TargetToken(4323643288))
label(p0, p1, p3, p4, p5, p7, p10, i56, p19, p22, p24, p30, descr=TargetToken(4310782288))
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
setfield_gc(p23, 21, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x101c26c50>)
p58 = force_token()
i59 = int_lt(i55, 10000)
guard_true(i59, descr=<Guard0x101c26bd8>)
setfield_gc(p24, 21, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x101e21e20>)
p59 = force_token()
i60 = int_lt(i56, 10000)
guard_true(i60, descr=<Guard0x101e209f8>)
debug_merge_point(0, 0, '<main> at JUMP_IF_FALSE')
debug_merge_point(0, 0, '<main> at LOAD_SCOPE')
debug_merge_point(0, 0, '<main> at LOAD_LOCAL_CONSTANT')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
p60 = force_token()
p61 = force_token()
debug_merge_point(1, 1, 'try_convert at LOAD_SCOPE')
debug_merge_point(1, 1, 'try_convert at LOAD_LOCAL_CONSTANT')
debug_merge_point(1, 1, 'try_convert at LOAD_DEREF')
debug_merge_point(1, 1, 'try_convert at LOAD_SCOPE')
debug_merge_point(1, 1, 'try_convert at LOAD_LOCAL_CONSTANT')
debug_merge_point(1, 1, 'try_convert at LOAD_CONST')
debug_merge_point(1, 1, 'try_convert at SEND')
p61 = force_token()
p62 = force_token()
p63 = force_token()
p64 = force_token()
@@ -148,19 +147,20 @@ def test_method_missing(self, topaz, tmpdir):
p69 = force_token()
p70 = force_token()
p71 = force_token()
debug_merge_point(1, 1, 'try_convert at RETURN')
p72 = force_token()
debug_merge_point(1, 1, 'try_convert at RETURN')
p73 = force_token()
debug_merge_point(0, 0, '<main> at DISCARD_TOP')
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
p73 = force_token()
i74 = int_add(i55, 1)
p74 = force_token()
i75 = int_add(i56, 1)
debug_merge_point(0, 0, '<main> at STORE_DEREF')
debug_merge_point(0, 0, '<main> at DISCARD_TOP')
debug_merge_point(0, 0, '<main> at JUMP')
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
setfield_gc(p23, 48, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
setfield_gc(p1, p72, descr=<FieldP topaz.frame.Frame.vable_token 32>)
jump(p0, p1, p3, p4, p6, p9, i74, p18, p21, p23, p29, descr=TargetToken(4323643288))
setfield_gc(p24, 48, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
setfield_gc(p1, p73, descr=<FieldP topaz.frame.Frame.vable_token 32>)
jump(p0, p1, p3, p4, p5, p7, p10, i75, p19, p22, p24, p30, descr=TargetToken(4310782288))
""")
@@ -10,44 +10,44 @@ def test_int_closure_cells(self, topaz, tmpdir):
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p5, p6, p7, p9, p12, i77, p20, p22, p24, p26, p28, p30, p32, p34, p37, p39, p41, i58, p52, p71, p69, descr=TargetToken(4323618096))
label(p0, p1, p3, p4, p5, p6, p7, p8, p10, p13, i80, p21, p23, p25, p27, p29, p31, p33, p35, p38, p40, p42, i59, p53, p74, p72, descr=TargetToken(4310782200))
debug_merge_point(0, 0, 'each at LOAD_DEREF')
debug_merge_point(0, 0, 'each at LOAD_SELF')
debug_merge_point(0, 0, 'each at SEND')
setfield_gc(p41, 291, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x101c222f0>)
p81 = force_token()
setfield_gc(p42, 291, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100f633d0>)
p84 = force_token()
debug_merge_point(0, 0, 'each at SEND')
p82 = force_token()
setfield_gc(p41, 296, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
i83 = int_lt(i77, i58)
guard_true(i83, descr=<Guard0x101c22278>)
p85 = force_token()
setfield_gc(p42, 296, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
i86 = int_lt(i80, i59)
guard_true(i86, descr=<Guard0x100f63358>)
debug_merge_point(0, 0, 'each at LOAD_CONST')
debug_merge_point(0, 0, 'each at SEND')
p84 = force_token()
p87 = force_token()
debug_merge_point(0, 0, 'each at JUMP_IF_FALSE')
debug_merge_point(0, 0, 'each at LOAD_DEREF')
debug_merge_point(0, 0, 'each at YIELD')
p85 = force_token()
p88 = force_token()
debug_merge_point(1, 1, 'block in <main> at LOAD_DEREF')
debug_merge_point(1, 1, 'block in <main> at STORE_DEREF')
debug_merge_point(1, 1, 'block in <main> at RETURN')
debug_merge_point(0, 0, 'each at DISCARD_TOP')
debug_merge_point(0, 0, 'each at LOAD_DEREF')
debug_merge_point(0, 0, 'each at SEND')
p86 = force_token()
p89 = force_token()
debug_merge_point(1, 2, 'succ at LOAD_SELF')
debug_merge_point(1, 2, 'succ at LOAD_CONST')
debug_merge_point(1, 2, 'succ at SEND')
p87 = force_token()
i88 = int_add(i77, 1)
p90 = force_token()
i91 = int_add(i80, 1)
debug_merge_point(1, 2, 'succ at RETURN')
debug_merge_point(0, 0, 'each at STORE_DEREF')
debug_merge_point(0, 0, 'each at DISCARD_TOP')
debug_merge_point(0, 0, 'each at JUMP')
debug_merge_point(0, 0, 'each at LOAD_DEREF')
setfield_gc(p41, 9, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
setfield_gc(p71, i77, descr=<FieldS topaz.closure.IntCell.inst_intvalue 16>)
i89 = arraylen_gc(p69, descr=<ArrayP 8>)
jump(p0, p1, p3, p4, p5, p6, p7, p9, p12, i88, p20, p22, p24, p26, p28, p30, p32, p34, p37, p39, p41, i58, p52, p71, p69, descr=TargetToken(4323618096))
setfield_gc(p42, 9, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
setfield_gc(p74, i80, descr=<FieldS topaz.closure.IntCell.inst_intvalue 16>)
i92 = arraylen_gc(p72, descr=<ArrayP 8>)
jump(p0, p1, p3, p4, p5, p6, p7, p8, p10, p13, i91, p21, p23, p25, p27, p29, p31, p33, p35, p38, p40, p42, i59, p53, p74, p72, descr=TargetToken(4310782200))
""")
@@ -18,22 +18,22 @@ def initialize
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p6, p9, i40, p18, p21, p23, p29, descr=TargetToken(4323625848))
label(p0, p1, p3, p4, p5, p7, p10, i41, p19, p22, p24, p30, descr=TargetToken(4310782288))
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
setfield_gc(p23, 34, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x101c0fbc8>)
p42 = force_token()
i43 = int_lt(i40, 10000)
guard_true(i43, descr=<Guard0x101c0fb50>)
setfield_gc(p24, 34, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100f63808>)
p43 = force_token()
i44 = int_lt(i41, 10000)
guard_true(i44, descr=<Guard0x100f63718>)
debug_merge_point(0, 0, '<main> at JUMP_IF_FALSE')
debug_merge_point(0, 0, '<main> at LOAD_SCOPE')
debug_merge_point(0, 0, '<main> at LOAD_LOCAL_CONSTANT')
debug_merge_point(0, 0, '<main> at SEND')
p44 = force_token()
p45 = force_token()
p46 = force_token()
p47 = force_token()
debug_merge_point(1, 1, 'initialize at LOAD_SELF')
debug_merge_point(1, 1, 'initialize at LOAD_CONST')
debug_merge_point(1, 1, 'initialize at STORE_INSTANCE_VAR')
@@ -50,12 +50,12 @@ def initialize
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
p47 = force_token()
i48 = int_add(i40, 1)
p48 = force_token()
i49 = int_add(i41, 1)
debug_merge_point(0, 0, '<main> at STORE_DEREF')
debug_merge_point(0, 0, '<main> at DISCARD_TOP')
debug_merge_point(0, 0, '<main> at JUMP')
debug_merge_point(0, 0, '<main> at LOAD_DEREF')
setfield_gc(p23, 58, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
jump(p0, p1, p3, p4, p6, p9, i48, p18, p21, p23, p29, descr=TargetToken(4323625848))
setfield_gc(p24, 58, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
jump(p0, p1, p3, p4, p5, p7, p10, i49, p19, p22, p24, p30, descr=TargetToken(4310782288))
""")

0 comments on commit f8f91b8

Please sign in to comment.
You can’t perform that action at this time.