[pypy-dev] .py -> .pyc -> (.pyc2 + .so) ?

Armin Rigo arigo at tunes.org
Sun Dec 11 18:32:38 CET 2011


Hi Bengt,

On Sun, Dec 11, 2011 at 18:13, Bengt Richter <bokr at oz.net> wrote:
>> Basically, no. JIT compiled functions have lots of their runtime
>> context (like memory addresses) hardcoded into thme.
>
> How many address spaces are used, (...)

The JIT generates machine code containing a large number of constant
addresses --- constant at the time the machine code is written.  The
vast majority is probably not at all constants that you find in the
executable, with a nice link name.  E.g.  the addresses of Python
classes are used all the time, but Python classes don't come statically
from the executable; they are created anew every time you restart your
program.  This makes saving and reloading machine code completely
impossible without some very advanced way of mapping addresses in the
old (now-dead) process to addresses in the new process, including
checking that all the previous assumptions about the (now-dead) object
are still true about the new object.

(Added as a FAQ entry :-)


A bientôt,

Armin.


More information about the pypy-dev mailing list