<div dir="ltr"><br><br><div class="gmail_quote">On Sun, Sep 7, 2008 at 4:22 AM, Paolo Bonzini <span dir="ltr">&lt;<a href="mailto:bonzini@gnu.org">bonzini@gnu.org</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="Ih2E3d"><br>
&gt; Also, compiling code that isn&#39;t in a hotspot is a waste of time, since<br>
&gt; you spend much longer compiling the code than you would have spent<br>
&gt; interpreting it, and can cause big compile pauses if the compiler does<br>
&gt; much optimization.<br>
<br>
</div>You can use a simple 1-pass compilation (without even register<br>
allocation) that takes just a few ms for any reasonable amount of code.<br>
&nbsp;Don&#39;t forget that V8 runs (mainly) in a browser--if the browser is<br>
sufficiently snappy, the user won&#39;t notice a compilation pause of a few<br>
milliseconds.<br></blockquote></div><br><div>Such a compiler is fast, but it produces verbose code. &nbsp;I was talking about a <span class="Apple-style-span" style="font-weight: bold;">large</span>&nbsp;body of code, the sort that might begin to be used if V8 is used on the desktop for things like running an entire Smalltalk image, for example. &nbsp;In those sorts of cases,&nbsp;there is a difficult trade-off: if you use a fast compiler like the one you are talking about, it produces verbose code that consumes a lot of space, which was the problem for Self. &nbsp;On the other hand if you use a good compiler that produces more compact code, then you get large compilation pauses. &nbsp;</div>
<div><br></div><div>Using a code cache like in Visualworks or mixed-mode hotspot compilation like we did in Strongtalk and the JVM is how to get around that trade-off. &nbsp; The question is, what does V8 do to solve this problem? &nbsp;That is not yet clear. &nbsp;If they don&#39;t have some compact way of representing and executing uncommonly-used code, then it will have problems with large bodies of code.</div>
</div>