bytecode JUMP_IF_* always followed by POP_TOP?

Robert Brewer fumanchu at amor.org
Fri Apr 23 10:54:40 EDT 2004


Christos "TZOTZIOY" Georgiou wrote:
> On Thu, 22 Apr 2004 13:48:16 -0700, rumours say that "Robert Brewer"
> <fumanchu at amor.org> might have written:
> 
> >I notice that, whether JUMP_IF_FALSE jumps or not, the next 
> instruction
> >it executes is POP_TOP (in the above, instruction numbers 6 and 14).
> 
> The following thread is relevant <long URL>:
> 
> <URL:http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF
> -8&threadm=bpr6musc14m74uqss78iehtl72h9qrmu7o%404ax.com&rnum=1
> &prev=/groups%3Fq%3Dgroup%253Acomp.lang.python%2BPOP_TOP%2Baut
> hor%253ATZOTZIOY%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den>

It doesn't have to be *quite* that long:
http://groups.google.com/groups?threadm=bpr6musc14m74uqss78iehtl72h9qrmu
7o%404ax.com

;)


> Check also my next message in that thread.
> 
> I remember the results were not that impressive in pystone and some
> other benchmarks (1-2% or less).

Yes, as you noted, it's more of a purity issue than anything else. I
actually ran across it while writing a decompiler...wondering if I could
check "next instruction is POP_TOP" to tell me anything useful about the
current JUMP code. But I'm past that now. :)


Robert Brewer
MIS
Amor Ministries
fumanchu at amor.org




More information about the Python-list mailing list