Monday, August 02, 2010

 

PyPy GSoC: 64-bit JIT merged to trunk

Well, that took longer than it should have. In any case, 64-bit JIT support (with Boehm GC only) has been merged to trunk. Please try it out!

The remainder of my GSoC will be work on the asmgcc-64 branch, to allow the 64-bit JIT to work with non-Boehm collectors.


Comments:
Nice work, thank you!

Could you explain why other GCs need to be ported to 64-bit? I assumed that the JIT was the hardest part, and GCs only need to be tweaked to understand 64-bit pointers.
 
There are two main ways to find roots on the stack with GCs. One way is to maintain a "shadow stack" that is kept in sync before any action that might trigger an allocation. (ie, a function call.) The other way is to generate a "stack map" which tells the garbage collector what registers or stack locations contain GC roots.

The latter method is faster, since it doesn't entail any runtime overhead in the common case when there is no collection done, and that is what the asmgcc code does in PyPy.

However, the downside is that the way asmgcc works is by parsing the assembly code that gcc generates (hence the name!) to extract the relevant information. Since x86-64 assembly differs in some respects from x86-32 assembly, work has to be done to make asmgcc work properly on 64-bit machines.
 
On 64bit OpenSuse this worked except that I needed to add -ldl to the ld flags in translator/platform/linux.py

With that, pypy-c compiled. When I start it I see a stack trace indicating that no curses is available. I don't know if that is normal or not (it needs -lncurses, not -lcureses, but I cannot see where to specify this). Ignoring the stack trace, pypy-c appears to work correctly.

Thanks!
 
Any hints on how to build with the boehm gc? If I try to specify --gc=boehm, translate.py tells me: "translate: error: cannot override value to boehm for option gctransformer". If I don't specify a gc, translate.py tells me that gcfindroots=asmgcc.
 
@terrence Hmm, that's odd. It should be enough to do "python translate.py --opt=jit targetpypystandalone.py" from pypy/translator/goal to automatically select the most appropriate GC supported.

What OS, hardware and SVN revision are you using to translate?
 
Thanks! That command works much better. The command I was trying to use was: "python2.6 translate.py --translation-jit --backend=c targetpypystandalone.py --allworkingmodules".
 
Waiting for Python 3.1 support.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?