Anto,<br><br>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).<br>
<br>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&#39;t think it&#39;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).<br>
<br><br><div class="gmail_quote">On Fri, May 13, 2011 at 9:14 AM, Antonio Cuni <span dir="ltr">&lt;<a href="mailto:anto.cuni@gmail.com">anto.cuni@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On 12/05/11 06:39, Charles Oliver Nutter wrote:<br>
&gt; 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.<br>

<br>
</div>Hello Charles,<br>
<br>
I think that invokedynamic might be very useful for a potential JVM JIT<br>
backend, but not for the static one, because the RPython code translates quite<br>
straightforwardly to the &quot;normal&quot; JVM bytecode.<br>
<br>
About the JIT, I am very interested in hearing about the potential of<br>
invokedynamic.  For example, I think it could be useful for attaching new<br>
bridges to already compiled loops, without the need to recompile the whole<br>
loop as the CLI JIT backend does.<br>
<br>
Two questions:<br>
<br>
  - how fast/slow is an invokedynamic call compared to a local jump? (Assuming<br>
that the JVM is able to inline the target method)<br>
<br>
  - are tail calls supported by the JVM, and by invokedynamic in particular?<br>
<br>
ciao,<br>
Anto<br>
<div><div></div><div class="h5">_______________________________________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org">pypy-dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">http://mail.python.org/mailman/listinfo/pypy-dev</a><br>
</div></div></blockquote></div><br>