[webkit-dev] Sharing code between WebCore/bindings/js and WebCore/bindings/v8

Adam Barth abarth at webkit.org
Thu Dec 3 14:01:36 PST 2009


Sorry for the thread necromancy, but this has come back to the top of my list.

On Thu, May 28, 2009 at 2:07 AM, Maciej Stachowiak <mjs at apple.com> wrote:
> On May 27, 2009, at 11:47 AM, Adam Barth wrote:
>> I've been doing some work recently in our JavaScript bindings.  As
>> part of this work, I've noticed that WebCore/bindings/js and
>> WebCore/bindings/v8 have drifted apart in some details.  It's kind of
>> ridiculous that we have so much duplicated code in these two folders.
>> We should try to re-organize our bindings to share as much code as
>> possible.

[...]

> It's definitely unfortunate that the bindings keep going out of sync. I have
> two concerns though:
>
> 1) We weren't super enthusiastic about the master WebKit tree trying to
> support two different JavaScript engines. But we finally agreed when the
> Chrome folks said this was a hard requirement to merge, and promised they
> would take on absolutely 100% of the maintenance burden and impose no cost
> on the rest of the WebKit project. As a result:
>
>    1.a) We're not super keen on refactorings that wouldn't be justified just
> for JSC itself. If there is shareable code that is easily factored out
> without adding otherwise needless abstraction or layers of indirection,
> that's fine, but we don't want to add indirection that would add any code
> complexity or runtime cost.
>
>    1.b) We couldn't commit to not breaking the v8 bindings when hacking on
> the shared layer, if there was one.

We're going to address these concerns by doing the V8 bindings first
and not touching the JSC bindings at all.  Basically, the plan is to
move common code out of the V8 bindings and abstract away the
V8-specific bits with an eye towards making the code useful for JSC.
We're going to start small and see how it goes.  Once we've done
enough of that to make the direction clear, we can decide whether JSC
wants to use the common bits.

> 2) My understanding is that the v8 bindings are not even fully merged into
> the WebKit tree yet - many pieces live externally in the Chromium
> repository. So we couldn't meaningfully maintain the v8 bindings even if we
> wanted to, and would have no good way to evaluate the soundness of the
> shared layer.

This issue is now resolved because the V8 bindings are fully upstream.

Adam


More information about the webkit-dev mailing list