Fwd: JS engine in WebView

John Smith send2jsmith at gmail.com
Fri May 10 17:42:52 PDT 2013


Forwarding to openjfx-dev list.

On Fri, May 10, 2013 at 1:12 AM, John Smith <send2jsmith at gmail.com> wrote:

> Last time I checked (JavaFX 2.2) on desktop systems, the WebView
> JavaScript JIT compiler was switched off for 64 bit Java distributions and
> only switched on for 32 bit Java distributions.  Is this still the case?
>
> Without JIT enabled, most WebView benchmarks come out 4-5 times slower.
> With JIT, JavaScript in WebView performs in the same class as most common
> browsers.
>
> I was hopeful that  64 bit processing could be much improved if Nashorn
> was swapped for JavaScriptCore.  But I guess that won't might not end up
> happening now.
>
> Will it be possible to enable JavaScriptCore to run with JIT compilation
> switched on when WebView is running under 64 bit Java?
>
>
> On May 9, 2013, at 8:25 PM, Richard Bair <richard.bair at oracle.com> wrote:
>
> > Hi John,
> >
> > On May 8, 2013, at 12:12 PM, John C. Turnbull <ozemale at ozemail.com.au>
> wrote:
> >
> >> I know that WebView uses WebKit but what actual JavaScript engine does
> it use on Windows? I don't think WebKit forces you to use any particular
> engine.
> >
> > Well…. it goes like this. WebKit comes with JavaScriptCore by default,
> and this is the JS engine that we use. It is pretty good. My understanding
> is that JavaScriptCore (aka SquirrelFish aka Nitro) is the same JS engine
> used by Safari[1]. When Chrome and Apple were both part of WebKit, one of
> the abstraction layers that Google had put into WebKit was the ability to
> swap out the JavaScript engine. When Google forked WebKit into Blink, the
> need for the WebKit project to have an abstraction for a different JS VM
> disappeared. As a consequence, the WebKit guys have been talking about
> removing those abstractions such that you won't be able to swap out the JS
> engine[2][3]. If/When that happens, it will be hard (or impossible) for us
> to switch over to Nashorn for WebView. We aren't going to fork WebKit, so
> we sort of have to follow along with what WebKit does.
> >
> >> Will WebView eventually use Nashorn instead of what it's using
> currently!
> >
> > Maybe, but maybe not for the reasons cited above. We will have to see
> how this whole Apple / Google divorce plays out.
> >
> > Richard
> >
> > [1] http://trac.webkit.org/wiki/JavaScriptCore
> > [2]http://www.theregister.co.uk/2013/04/04/webkit_to_purge_chrome_code/
> > [3]https://lists.webkit.org/pipermail/webkit-dev/2013-April/024408.html
> >
> > "Supporting V8 places a considerable burden on webkit, there are a
> number of
> > large, cumbersome and expensive abstractions required for to support
> multiple
> > JS engines (see the original discussions on the topic from many years
> ago).
> >
> > Additionally we will only be supporting JSC in WebKit2, so I don't think
> anything could
> > convince me at least that maintaining support for multiple JS engines is
> good for
> > the project." - Oliver Hunt
>
>


More information about the openjfx-dev mailing list