Subj : Re: Whats about a JIT? To : netscape.public.mozilla.jseng From : Clemens Eisserer Date : Sat Oct 18 2003 04:52 pm Hi again! > Well, there is already at least one JIT for JS, that is a JVM running > Rhino which is a pure Java implementation based on early SpiderMonkey > code. Rhino by default translate JS into JVM byte code which is then is > executed diectly by JVM. Wow, Rhino is faster than SpiderMonkey, that beats all :-) Of course, if the JS is converted to Java-Bytecode before execution, the code can benefit from the Sun-JIT, which is the best JIT I know! > For a benchmark such as > http://lxr.mozilla.org/mozilla/source/js/benchmarks/BenchPress.js > rhino when run under JDK 1.4.2 consitently run 2 times faster then an > optimized build of SM so given that JVM byte code is not an ideal form > to represent JS, I guess a native JIT would bring even more benefits to SM. Hmm, another point is, that it would be even hard to implement a working JIT. Building a fast JIT is another thing :( I think about a soft-jit which does only fast and easy optimizations, because most JSs run only < 5 times would be the best ide. > Given the above I guess any JIT implementation would be a reasonable > starting point, like one in Mono, for example. Another problem is, that of course there no documentation at all about howto write JITs. O.K., theres some open-source code, but its hard to understand how something works without any knowledge about it. Hmm, IŽll have a look.... lg Clemens .