[pypy-dev] Re: JIT

Michael Hudson mwh at python.net
Tue Feb 21 13:26:52 CET 2006

Ben.Young at risk.sungard.com writes:

> Hi All,
> As you probably know by now, I enjoy following the progress of the PyPy 
> project, and generally I can understand roughly what is going on, but I 
> have to admit I am stumpt by the JIT.

I'm pretty lost too :)

> Is there a document that describes what is going on anywhere? What's
> the goal of the current bit of work? I can't actually work out if
> the current JIT for the toy language is actaully jitt'ed, or if you
> are currently just working on the data structures that will produce
> the JIT? I.e will there need to be a machine code backend for the
> JIT or does it somehow magically produce fast code without a
> compiler, using some other kind of dispatch loop?

This bit I can answer to some extent.  Currently the JIT code produces
L2 graphs, which are the low level graphs that can be translated to C.
This is fine for the moment, but not in the long run, for two reasons:
one is that RPython programs cannot manipulate L2 graphs (and
eventually the JIT needs to be RPython so that it runs at a reasonable
speed) and the other is that we don't want our JIT to have to compile
it's generated code to C (or use llinterp...).

So, we need something else.  One option is indeed to generate machine
code, but first we'll probably target another representation called L3
graphs (low low level graphs, if you like) which are simple enough to
be manipulated and executed by RPython programs.  The l3
interpreter/evaluator is partially written at this point, although
some deep issues remain, particularly the interaction with garbage


  Hiro dicks about with his computer, naturally.  Being stranded 
  on a life raft in the Pacific is a perfect venue for a hacker.
                                        -- Snow Crash, Neal Stephenson

More information about the Pypy-dev mailing list