[pypy-dev] JVM backend - status and future work possibilities?

Paul deGrandis paul.degrandis at gmail.com
Fri May 13 18:59:47 CEST 2011


Anto,

On your second question, the default JVM does not support TCO, but you can
trampoline.  There is a JVM version (called DiVinci Machine), that is
working to (and can somewhat) support TCO.  The DaVinci Machine is where
invokedynamic and invokevirtual came from (approved JSRs are part of JDK7
now).

Languages like Python and Ruby will see noticeable improvements for
invokedynamic, but languages like Clojure will not (since Clojure gets a
strict compilation phase before it gets executed).  For this reason, my
intuition is that (like you) I don't think it's useful for the static JIT,
but could be really cool for language hooks thereafter (since the JVM JIT
can optimize invokedynamic and invokevirtual calls).


On Fri, May 13, 2011 at 9:14 AM, Antonio Cuni <anto.cuni at gmail.com> wrote:

> On 12/05/11 06:39, Charles Oliver Nutter wrote:
> > FWIW I would be happy to help out with advice and direction, especially
> if the JVM backend could be rejiggered to take advantage of the new
> invokedynamic bytecode in Java 7. I have been using it for JRuby and have
> been very pleased with it.
>
> Hello Charles,
>
> I think that invokedynamic might be very useful for a potential JVM JIT
> backend, but not for the static one, because the RPython code translates
> quite
> straightforwardly to the "normal" JVM bytecode.
>
> About the JIT, I am very interested in hearing about the potential of
> invokedynamic.  For example, I think it could be useful for attaching new
> bridges to already compiled loops, without the need to recompile the whole
> loop as the CLI JIT backend does.
>
> Two questions:
>
>  - how fast/slow is an invokedynamic call compared to a local jump?
> (Assuming
> that the JVM is able to inline the target method)
>
>  - are tail calls supported by the JVM, and by invokedynamic in particular?
>
> ciao,
> Anto
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> http://mail.python.org/mailman/listinfo/pypy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110513/9ff713d1/attachment.html>


More information about the pypy-dev mailing list