Psyco internals (was: Re:PDF parser)

Christopher T King squirrel at WPI.EDU
Fri Jul 30 18:20:00 CEST 2004


On Fri, 30 Jul 2004, Christian Tismer wrote:

> I tell you this is not trivial.

What makes it so difficult?  Does Psyco not keep its state on the stack,
like CPython does?  I'm trying to form a picture of the Psyco internals on 
my mind, but I can't find any in-depth documentation of them (aside from 
the source, of course), so I'm basing my thoughts on (possibly 
naive) assumptions.

Implementing generators in C is trivial: since all the state of a C
function is contained on the stack, you need only use setjmp/longjmp (or
equivalent) augmented with stack saving/restoring routines to make it
work.  I just fail to see how implementing them in generated machine code
can be that much different, unless local state isn't kept on the stack
(which you seem to imply that it is), or the dynamic profiling / code
generation routines make a mess of this whole scheme (in which case I'll
keep quiet).




More information about the Python-list mailing list