[pypy-dev] The first JITing pypy-c!

Michael Hudson mwh at python.net
Fri Dec 8 11:23:26 CET 2006


Armin Rigo <arigo at tunes.org> writes:

> Hi all,
>
> Two days ago, we got our first JITing version of pypy-c!
>
> This was mostly thanks to Arre, who compiled a version even though we
> knew it would segfault due to missing support for C structures with
> non-int-sized fields.  Writing to a 1-byte-sized Bool field would
> overwrite the next 3 bytes of memory with zeroes...  Nevertheless, the
> result managed to successfully run one function (and indeed segfault on
> many other functions).  Our first JIT-run function!  A recursive
> factorial.

Hooray!

> - the above PYPYJITLOG env var causes a file called 'log' to be
>   produced, containing the generated assembler code.  It can be viewed
>   in a flowgraph-like fashion with pypy/jit/codegen/i386/viewcode.py.
>   Don't ask me yet to describe the result, nor where the while loop is
>   :-)  If you are familiar with i386 assembler, you'll laugh at the
>   obviously bad code, too.  That's where your help would be appreciated!
>   Making the backend produce more reasonable code, starting with some
>   basic register allocation, is a mostly-independent project.  The PPC
>   backend, btw, has already got this kind of techniques (I wonder what
>   speed-ups we get on PPC from a jitting pypy-c).

Well, I guess so far it just plain doesn't work, but also the PPC
register allocation is pretty horrible, especially around function
calls.  We've talked about the backend change needed to make this
sensible (giving the list of live values to the block-ending builder
methods), I guess it just has to be done at some point...

Cheers,
mwh

-- 
  You can lead an idiot to knowledge but you cannot make him 
  think.  You can, however, rectally insert the information, 
  printed on stone tablets, using a sharpened poker.        -- Nicolai
               -- http://home.xnet.com/~raven/Sysadmin/ASR.Quotes.html




More information about the Pypy-dev mailing list