Skip to content

Instantly share code, notes, and snippets.

@squeaky-pl
Created March 3, 2014 13:29
Show Gist options
  • Save squeaky-pl/9324941 to your computer and use it in GitHub Desktop.
Save squeaky-pl/9324941 to your computer and use it in GitHub Desktop.
def add(a, b, c):
for i in range(LOOP):
c[i] = a[i] + b[i] + 1
# Loop 4 (<code object add, file 'test.py', line 18> #13 FOR_ITER) : loop with 124 ops
[p0, p1]
+80: p2 = getfield_gc(p0, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_pycode 96>)
+91: p3 = getfield_gc(p0, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_lastblock 80>)
+95: i4 = getfield_gc(p0, descr=<FieldS pypy.interpreter.pyframe.PyFrame.inst_valuestackdepth 104>)
+99: p5 = getfield_gc(p0, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_w_f_trace 112>)
+103: p6 = getfield_gc(p0, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_last_exception 64>)
+107: p7 = getfield_gc(p0, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_w_globals 120>)
+111: i8 = getfield_gc(p0, descr=<FieldU pypy.interpreter.pyframe.PyFrame.inst_is_being_profiled 142>)
+119: i9 = getfield_gc(p0, descr=<FieldS pypy.interpreter.pyframe.PyFrame.inst_last_instr 72>)
+123: p10 = getfield_gc(p0, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_locals_stack_w 88>)
+127: p12 = getarrayitem_gc(p10, 0, descr=<ArrayP 8>)
+132: p14 = getarrayitem_gc(p10, 1, descr=<ArrayP 8>)
+137: p16 = getarrayitem_gc(p10, 2, descr=<ArrayP 8>)
+142: p18 = getarrayitem_gc(p10, 3, descr=<ArrayP 8>)
+154: p20 = getarrayitem_gc(p10, 4, descr=<ArrayP 8>)
+166: p22 = getarrayitem_gc(p10, 5, descr=<ArrayP 8>)
+178: p24 = getarrayitem_gc(p10, 6, descr=<ArrayP 8>)
+190: p26 = getarrayitem_gc(p10, 7, descr=<ArrayP 8>)
+202: p27 = getfield_gc(p0, descr=<FieldP pypy.interpreter.pyframe.PyFrame.inst_cells 24>)
+202: label(p0, p1, p2, p3, i4, p5, p6, p7, i8, i9, p12, p14, p16, p18, p20, p22, p24, p26, descr=TargetToken(140395221727016))
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #13 FOR_ITER')
+251: guard_value(i4, 5, descr=<Guard0x7fb04f49be50>) [i4, p1, p0, p2, p3, p5, p6, p7, i8, i9, p12, p14, p16, p18, p20, p22, p24, p26]
+261: guard_isnull(p5, descr=<Guard0x7fb04f4cc480>) [p1, p0, p5, p2, p3, p6, p7, i8, p12, p14, p16, p18, p20, p22, p24, p26]
+270: guard_class(p20, 25946136, descr=<Guard0x7fb04f4cc410>) [p1, p0, p20, p2, p3, p6, p7, i8, p12, p14, p16, p18, p22, p24, p26]
+289: p30 = getfield_gc(p20, descr=<FieldP pypy.objspace.std.iterobject.W_AbstractSeqIterObject.inst_w_seq 16>)
+293: guard_nonnull(p30, descr=<Guard0x7fb04f4cc3a0>) [p1, p0, p20, p30, p2, p3, p6, p7, i8, p12, p14, p16, p18, p22, p24, p26]
+302: i31 = getfield_gc(p20, descr=<FieldS pypy.objspace.std.iterobject.W_AbstractSeqIterObject.inst_index 8>)
+306: p32 = getfield_gc(p30, descr=<FieldP pypy.objspace.std.listobject.W_ListObject.inst_strategy 16>)
+310: guard_class(p32, 26029144, descr=<Guard0x7fb04f4cc330>) [p1, p0, p20, i31, p32, p30, p2, p3, p6, p7, i8, p12, p14, p16, p18, p22, p24, p26]
+324: p34 = getfield_gc(p30, descr=<FieldP pypy.objspace.std.listobject.W_ListObject.inst_lstorage 8>)
+328: i35 = getfield_gc_pure(p34, descr=<FieldS tuple3.item0 8>)
+332: i36 = getfield_gc_pure(p34, descr=<FieldS tuple3.item1 16>)
+336: i37 = getfield_gc_pure(p34, descr=<FieldS tuple3.item2 24>)
+340: i39 = int_lt(i31, 0)
guard_false(i39, descr=<Guard0x7fb04f4cc2c0>) [p1, p0, p20, i31, i37, i36, i35, p2, p3, p6, p7, i8, p12, p14, p16, p18, p22, p24, p26]
+350: i40 = int_ge(i31, i37)
guard_false(i40, descr=<Guard0x7fb04f4cc250>) [p1, p0, p20, i31, i36, i35, p2, p3, p6, p7, i8, p12, p14, p16, p18, p22, p24, p26]
+359: i41 = int_mul(i31, i36)
+366: i42 = int_add(i35, i41)
+372: i44 = int_add(i31, 1)
+376: setfield_gc(p20, i44, descr=<FieldS pypy.objspace.std.iterobject.W_AbstractSeqIterObject.inst_index 8>)
+380: guard_value(i8, 0, descr=<Guard0x7fb04f4cc1e0>) [i8, p1, p0, p2, p3, p6, p7, p12, p14, p16, p18, p20, p24, p26, i42]
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #16 STORE_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #19 LOAD_FAST')
+390: guard_nonnull_class(p12, 26178712, descr=<Guard0x7fb04f4cc170>) [p1, p0, p12, p2, p3, p6, p7, p14, p16, p20, p24, p26, i42]
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #22 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #25 BINARY_SUBSCR')
+416: i47 = getfield_gc(p12, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst_len 24>)
+420: i49 = int_lt(i42, 0)
guard_false(i49, descr=<Guard0x7fb04f4cc100>) [p1, p0, p12, i42, i47, p2, p3, p6, p7, p14, p16, p20, p26, None]
+430: i51 = int_lt(i42, i47)
guard_true(i51, descr=<Guard0x7fb04f4cc090>) [p1, p0, p12, i42, p2, p3, p6, p7, p14, p16, p20, p26, None]
+439: i52 = getfield_gc(p12, descr=<FieldU pypy.module.array.interp_array.W_ArrayTypeB.inst_buffer 32>)
+443: i53 = getarrayitem_raw(i52, i42, descr=<ArrayU 1>)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #26 LOAD_FAST')
+448: guard_nonnull_class(p14, 26178712, descr=<Guard0x7fb04f4cc020>) [p1, p0, p14, p2, p3, p6, p7, p12, p16, p20, p26, i53, i42]
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #29 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #32 BINARY_SUBSCR')
+473: i55 = getfield_gc(p14, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst_len 24>)
+477: i56 = int_lt(i42, i55)
guard_true(i56, descr=<Guard0x7fb04f4b9f30>) [p1, p0, p14, i42, p2, p3, p6, p7, p12, p16, p20, i53, None]
+486: i57 = getfield_gc(p14, descr=<FieldU pypy.module.array.interp_array.W_ArrayTypeB.inst_buffer 32>)
+497: i58 = getarrayitem_raw(i57, i42, descr=<ArrayU 1>)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #33 BINARY_ADD')
+509: i59 = int_add(i53, i58)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #34 LOAD_CONST')
+512: guard_value(p2, ConstPtr(ptr60), descr=<Guard0x7fb04f4b9ec0>) [p1, p0, p2, p3, p6, p7, p12, p14, p16, p20, i59, None, i42]
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #37 BINARY_ADD')
+531: i62 = int_add(i59, 1)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #38 LOAD_FAST')
+535: guard_nonnull_class(p16, 26180416, descr=<Guard0x7fb04f4b9e50>) [p1, p0, p16, p3, p6, p7, p12, p14, p20, i62, None, None, i42]
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #41 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #44 STORE_SUBSCR')
+560: i64 = getfield_gc(p16, descr=<FieldS pypy.module.array.interp_array.W_ArrayBase.inst_len 24>)
+564: i65 = int_lt(i42, i64)
guard_true(i65, descr=<Guard0x7fb04f4b9de0>) [p1, p0, p16, i42, p3, p6, p7, p12, p14, p20, i62, None, None, None]
+573: i66 = getfield_gc(p16, descr=<FieldU pypy.module.array.interp_array.W_ArrayTypeH.inst_buffer 32>)
+584: setarrayitem_raw(i66, i42, i62, descr=<ArrayU 2>)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #45 JUMP_ABSOLUTE')
+589: guard_not_invalidated(descr=<Guard0x7fb04f4b9d70>) [p1, p0, p3, p6, p7, p12, p14, p16, p20, None, None, None, i42]
+589: i68 = getfield_raw(50146976, descr=<FieldS pypysig_long_struct.c_value 0>)
+597: i70 = int_lt(i68, 0)
guard_false(i70, descr=<Guard0x7fb04f4b9d00>) [p1, p0, p3, p6, p7, p12, p14, p16, p20, None, None, None, i42]
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #13 FOR_ITER')
+607: label(p0, p1, p3, p6, p7, p12, p14, p16, i42, p20, i44, i37, i36, i35, i47, i52, i55, i57, i64, i66, descr=TargetToken(140395221727104))
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #13 FOR_ITER')
+614: i71 = int_ge(i44, i37)
guard_false(i71, descr=<Guard0x7fb04f4b9c90>) [p1, p0, p20, i44, i36, i35, p3, p6, p7, p12, p14, p16, i42]
+627: i72 = int_mul(i44, i36)
+634: i73 = int_add(i35, i72)
+640: i74 = int_add(i44, 1)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #16 STORE_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #19 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #22 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #25 BINARY_SUBSCR')
+644: setfield_gc(p20, i74, descr=<FieldS pypy.objspace.std.iterobject.W_AbstractSeqIterObject.inst_index 8>)
+648: i75 = int_lt(i73, 0)
guard_false(i75, descr=<Guard0x7fb04f4b9bb0>) [p1, p0, p12, i73, i47, p3, p6, p7, p14, p16, p20, None]
+658: i76 = int_lt(i73, i47)
guard_true(i76, descr=<Guard0x7fb04f4b9b40>) [p1, p0, p12, i73, p3, p6, p7, p14, p16, p20, None]
+667: i77 = getarrayitem_raw(i52, i73, descr=<ArrayU 1>)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #26 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #29 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #32 BINARY_SUBSCR')
+672: i78 = int_lt(i73, i55)
guard_true(i78, descr=<Guard0x7fb04f4b9a60>) [p1, p0, p14, i73, p3, p6, p7, p12, p16, p20, i77, None]
+685: i79 = getarrayitem_raw(i57, i73, descr=<ArrayU 1>)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #33 BINARY_ADD')
+697: i80 = int_add(i77, i79)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #34 LOAD_CONST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #37 BINARY_ADD')
+700: i81 = int_add(i80, 1)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #38 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #41 LOAD_FAST')
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #44 STORE_SUBSCR')
+704: i82 = int_lt(i73, i64)
guard_true(i82, descr=<Guard0x7fb04f4b99f0>) [p1, p0, p16, i73, p3, p6, p7, p12, p14, p20, i81, None, None]
+713: setarrayitem_raw(i66, i73, i81, descr=<ArrayU 2>)
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #45 JUMP_ABSOLUTE')
+718: guard_not_invalidated(descr=<Guard0x7fb04f4b9980>) [p1, p0, p3, p6, p7, p12, p14, p16, p20, i73, None, None, None]
+718: i83 = getfield_raw(50146976, descr=<FieldS pypysig_long_struct.c_value 0>)
+726: i84 = int_lt(i83, 0)
guard_false(i84, descr=<Guard0x7fb04f4b9910>) [p1, p0, p3, p6, p7, p12, p14, p16, p20, i73, None, None, None]
debug_merge_point(0, 0, '<code object add. file 'test.py'. line 18> #13 FOR_ITER')
+736: jump(p0, p1, p3, p6, p7, p12, p14, p16, i73, p20, i74, i37, i36, i35, i47, i52, i55, i57, i64, i66, descr=TargetToken(140395221727104))
+758: --end of the loop--
[22787f84caac] jit-log-opt-loop}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment