[pypy-dev] Work on the JVM backend

Michał Bendowski michal at bendowski.pl
Thu Jan 12 21:24:51 CET 2012

Hello everyone,  

Back in the summer I asked on this mailing list if there's interest in moving the JVM backend forward. Back then there was some enthusiasm, so I got back to it when I had the chance, which unfortunately was a few months later. The suggestion back then was to look into using JPype to integrate more closely with Java-side code, and that's what I would like to do.

But before that, I noticed that the JVM backend fails to translate the standard interpreter and spent some time lately getting to know the code and trying to get it to work. What I have right now is a version that outputs valid Jasmin files, which unfortunately still contain some invalid bytecodes (longs vs ints from what I've seen, I'll look into it next).

It would be awesome if someone could take a look at my changes. What's the best way to submit them? Bitbucket pull requests? They will need to go through some review  - do you have a workflow for that?

Here's a short list of stuff I found and fixed (hopefully):
- support the ll_getlength method of StringBuilders in ootype,
- make compute_unique_id work on built-ins (StringBuilders again).
- provide oo implementations (or stubs) for pypy__rotateLeft, pypy__longlong2float etc.
- handle rffi.SHORT and rffi.INT showing up in graphs. For now I try to emit something that makes sense (seemed easier), but the right solution is probably to see if the code in question (rbigint, rsha) can be implemented on the java level.
- handle the jit_is_virtual opcode - I had no idea how to "safely ignore" it for now, is False the safe answer?

I hope someone can help me to submit the changes and maybe guide with further work.

And once again thanks for all the hard work on such a great project :)

Michał Bendowski

More information about the pypy-dev mailing list