Skip to content

Commit

Permalink
Merge c591c90 into f8507a3
Browse files Browse the repository at this point in the history
  • Loading branch information
alex committed Jul 13, 2013
2 parents f8507a3 + c591c90 commit 6c6ae27
Show file tree
Hide file tree
Showing 5 changed files with 269 additions and 227 deletions.
39 changes: 0 additions & 39 deletions tests/jit/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,45 +33,6 @@ def test_while_loop(self, topaz, tmpdir):
jump(p0, p1, p3, p4, p5, p6, p7, p10, i40, p20, p22, p28, descr=TargetToken(4310781936))
""")

def test_ivar_while_loop(self, topaz, tmpdir):
traces = self.run(topaz, tmpdir, """
@i = 0
while @i < 10000
@i += 1
end
""")
self.assert_matches(traces[0].loop, """
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(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')
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(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):
traces = self.run(topaz, tmpdir, """
i = 0
Expand Down
74 changes: 74 additions & 0 deletions tests/jit/test_instance_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,77 @@ def initialize
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))
""")

def test_unboxed_int_storage(self, topaz, tmpdir):
traces = self.run(topaz, tmpdir, """
@i = 0
while @i < 10000
@i += 1
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p5, p6, p7, p10, f39, p20, p31, p26, descr=TargetToken(4310773744))
debug_merge_point(0, 0, '<main> at LOAD_SELF')
debug_merge_point(0, 0, '<main> at LOAD_INSTANCE_VAR')
i42 = convert_float_bytes_to_longlong(f39)
debug_merge_point(0, 0, '<main> at LOAD_CONST')
debug_merge_point(0, 0, '<main> at SEND')
setfield_gc(p20, 23, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100ff6bd8>)
p43 = force_token()
i44 = int_lt(i42, 10000)
guard_true(i44, descr=<Guard0x100ff6b60>)
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(i42, 1)
debug_merge_point(0, 0, '<main> at STORE_INSTANCE_VAR')
f47 = convert_longlong_bytes_to_float(i46)
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(p20, 39, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
setarrayitem_gc(p26, 0, f47, descr=<ArrayF 8>)
i48 = arraylen_gc(p26, descr=<ArrayF 8>)
jump(p0, p1, p3, p4, p5, p6, p7, p10, f47, p20, p31, p26, descr=TargetToken(4310773744))
""")

def test_unboxed_float_storage(self, topaz, tmpdir):
traces = self.run(topaz, tmpdir, """
@data = 0.0
while @data < 10000.0
@data += 1.0
end
""")
self.assert_matches(traces[0].loop, """
label(p0, p1, p3, p4, p5, p6, p7, p10, p20, f37, p30, p26, descr=TargetToken(4310773744))
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(p20, 23, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
guard_not_invalidated(descr=<Guard0x100ff1d30>)
p40 = force_token()
i41 = float_lt(f37, 10000.000000)
guard_true(i41, descr=<Guard0x100ff1cb8>)
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')
p42 = force_token()
f43 = float_add(f37, 1.000000)
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(p20, 39, descr=<FieldS topaz.executioncontext.ExecutionContext.inst_last_instr 24>)
setarrayitem_gc(p26, 0, f43, descr=<ArrayF 8>)
i44 = arraylen_gc(p26, descr=<ArrayF 8>)
jump(p0, p1, p3, p4, p5, p6, p7, p10, p20, f43, p30, p26, descr=TargetToken(4310773744))
""")
39 changes: 0 additions & 39 deletions tests/test_mapdict.py

This file was deleted.

Loading

0 comments on commit 6c6ae27

Please sign in to comment.