Changeset 128242 in webkit


Ignore:
Timestamp:
Sep 11, 2012 4:49:09 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[V8] 8% regression in dom_perf
https://bugs.webkit.org/show_bug.cgi?id=96433

Patch by Adam Barth <abarth@chromium.org> on 2012-09-11
Reviewed by Kentaro Hara.

This code used to have a fast path to find the V8PerContextData for DOM
nodes. I tried a bunch of variations, but nothing I can come up with is
as fast as the old fast path, so I've added back the fast path.

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateToV8Converters):

  • bindings/v8/V8DOMWrapper.cpp:

(WebCore::V8DOMWrapper::instantiateV8Object):

  • bindings/v8/V8DOMWrapper.h:

(V8DOMWrapper):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128239 r128242  
     12012-09-11  Adam Barth  <abarth@chromium.org>
     2
     3        [V8] 8% regression in dom_perf
     4        https://bugs.webkit.org/show_bug.cgi?id=96433
     5
     6        Reviewed by Kentaro Hara.
     7
     8        This code used to have a fast path to find the V8PerContextData for DOM
     9        nodes. I tried a bunch of variations, but nothing I can come up with is
     10        as fast as the old fast path, so I've added back the fast path.
     11
     12        * bindings/scripts/CodeGeneratorV8.pm:
     13        (GenerateToV8Converters):
     14        * bindings/v8/V8DOMWrapper.cpp:
     15        (WebCore::V8DOMWrapper::instantiateV8Object):
     16        * bindings/v8/V8DOMWrapper.h:
     17        (V8DOMWrapper):
     18
    1192012-09-11  Andreas Kling  <kling@webkit.org>
    220
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r128159 r128242  
    33593359
    33603360    push(@implContent, <<END);
     3361    Document* document = 0;
     3362    UNUSED_PARAM(document);
     3363END
     3364
     3365    if (IsNodeSubType($dataNode)) {
     3366        push(@implContent, <<END);
     3367    document = impl->document();
     3368END
     3369    }
     3370
     3371    push(@implContent, <<END);
    33613372
    33623373    v8::Handle<v8::Context> context;
     
    33693380    }
    33703381
    3371     wrapper = V8DOMWrapper::instantiateV8Object(&info, impl.get());
     3382    wrapper = V8DOMWrapper::instantiateV8Object(document, &info, impl.get());
    33723383
    33733384    if (!context.IsEmpty())
  • trunk/Source/WebCore/bindings/v8/V8DOMWrapper.cpp

    r128102 r128242  
    141141}
    142142
    143 v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(WrapperTypeInfo* type, void* impl)
    144 {
    145     V8PerContextData* perContextData = V8PerContextData::current();
     143v8::Local<v8::Object> V8DOMWrapper::instantiateV8Object(Document* document, WrapperTypeInfo* type, void* impl)
     144{
     145    V8PerContextData* perContextData = 0;
     146
     147    // If we have a pointer to the frame, we cna get the V8PerContextData
     148    // directly, which is faster than going through V8.
     149    if (document && document->frame())
     150        perContextData = perContextDataForCurrentWorld(document->frame());
     151    else
     152        perContextData = V8PerContextData::current();
    146153
    147154    v8::Local<v8::Object> instance = perContextData ? perContextData->createWrapperFromCache(type) : V8ObjectConstructor::newInstance(type->getTemplate()->GetFunction());
  • trunk/Source/WebCore/bindings/v8/V8DOMWrapper.h

    r128159 r128242  
    113113        static void setNamedHiddenReference(v8::Handle<v8::Object> parent, const char* name, v8::Handle<v8::Value> child);
    114114
    115         static v8::Local<v8::Object> instantiateV8Object(WrapperTypeInfo*, void*);
     115        static v8::Local<v8::Object> instantiateV8Object(Document*, WrapperTypeInfo*, void*);
    116116
    117117        static v8::Handle<v8::Object> getCachedWrapper(Node* node)
Note: See TracChangeset for help on using the changeset viewer.