a hotspot-powered Javascript engine

Sal svferro at gmail.com
Thu Dec 11 07:28:30 PST 2008

On Wed, Dec 10, 2008 at 6:05 PM, Charles Oliver Nutter <
charles.nutter at sun.com> wrote:

> John Pampuch wrote:
>> My question: Is there any existing project(s) already doing this? I would
>>> hate to reinvent the wheel.   If not, can any experts on the list give any
>>> potential roadblocks/advice to help along the effort?
>> You definitely want to look at Rhino from the Mozilla organization.  It
>> could be a good start.
> Rhino needs work, but it would be far easier to get it running fast than
> most of the other dynamic languages. I've wanted to try to tackle it myself.
> Keep us posted on how it goes if you try it yourself.

Thanks for the references to Rhino by the way - I do remember now seeing
that project some time back but had forgotten about it.

I am looking at their implementation now.  From some benchmarks available it
seems Rhino works at almost 2x slower than actual Java.

My question - is there a theoretical reason for such a slowdown?  I have
been working with the openjdk hotspot codebase for a little bit now, and
pulling the bytecodes from a Javascript AST rather than a
Java-generated-classfile would seem fairly straightforward, I don't see
reasons yet why performance would fall to 2x - so my guess is the Rhino
implementation may need some work - what are others' thoughts?  Does
something like Javascript on the JVM really have to run that poorly?

It was nice to see their implementation, I was planning on actually using
some of the Hotspot code out of openjdk directly, dynamically generating the
bytecodes in memory directly from Javascript, and compiling/recompiling
block of dynamic bytecode in memory to deal with some of the dynamic
features for Javascript... this approach might solve some of the performance
issues the Rhino engine might be finding.

(Also - thanks for the reference to daVinci project!  I did come across this
earlier, it seems to be a great effort, very well planned that will make a
complete environment for new dynamic languages on the JVM.   I would love to
leverage their work - I just would like to evaluate if it would take more
time to complete their platform, then go on with the Javascript effort, or
if it would be faster to just less-generically hash in Javascript directly
to the Hotspot engine... I will definately look into it more.  Any thoughts
on this idea too would be great!)

Thanks again for all the help/feedback - I will definately keep persons
updated on any progress, I'm hoping after all to have an opensource codebase
that anyone can integrate into their browser(s) - and I'm thinking that it
should be the most performant Javascript engine available if it is
implemented correctly. Leveraging something like the JVM technology which
has been matured/refined over 20 years, just makes the most sense for
something like this, to me!

- Sal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20081211/ea7379bc/attachment.html 

More information about the hotspot-compiler-dev mailing list