[pypy-issue] [issue985] jit bug

Alex Gaynor tracker at bugs.pypy.org
Sat Jan 7 22:25:32 CET 2012


Alex Gaynor <alex.gaynor at gmail.com> added the comment:

The opcodes:


>>>> import dis
>>>> def f():
....  for c in x:
....   if c == '0':
....    pass
.... 
>>>> dis.dis(f)
  2           0 SETUP_LOOP              29 (to 32)
              3 LOAD_GLOBAL              0 (x)
              6 GET_ITER            
        >>    7 FOR_ITER                21 (to 31)
             10 STORE_FAST               0 (c)

  3          13 LOAD_FAST                0 (c)
             16 LOAD_CONST               1 ('0')
             19 COMPARE_OP               2 (==)
             22 POP_JUMP_IF_FALSE       28

  4          25 JUMP_ABSOLUTE            7
        >>   28 JUMP_ABSOLUTE            7
        >>   31 POP_BLOCK           
        >>   32 LOAD_CONST               0 (None)
             35 RETURN_VALUE        


It's slightly nonsense (2 JUMP_ABSOLUTES with the same target, and a POP_JUMP_IF_FALSE that goes to another jump, 
which is the same as the next opcode anyways), but I don't see why it would cause the backjump to be missed.

----------
nosy: +agaynor

________________________________________
PyPy bug tracker <tracker at bugs.pypy.org>
<https://bugs.pypy.org/issue985>
________________________________________


More information about the pypy-issue mailing list