RESOLVED FIXED Bug 28071
[V8] Speed up lookupDOMWrapper by using new V8 API function.
https://bugs.webkit.org/show_bug.cgi?id=28071
Summary [V8] Speed up lookupDOMWrapper by using new V8 API function.
Vitaly Repeshko
Reported 2009-08-07 09:38:55 PDT
V8 bindings: speed up lookupDOMWrapper by using new V8 API function.
Attachments
patch (2.64 KB, patch)
2009-08-07 09:41 PDT, Vitaly Repeshko
dglazkov: review-
more succinct patch (2.53 KB, patch)
2009-08-07 09:59 PDT, Vitaly Repeshko
dglazkov: review+
abarth: commit-queue-
Vitaly Repeshko
Comment 1 2009-08-07 09:41:22 PDT
Dimitri Glazkov (Google)
Comment 2 2009-08-07 09:51:00 PDT
Comment on attachment 34283 [details] patch This looks great, except for style nits: > + > + V8 bindings: speed up lookupDOMWrapper by using new V8 API function. The convention we use is to use a bracketed V8 qualifier: [V8] Speed up lookupD.... > > - static v8::Handle<v8::Object> lookupDOMWrapper(V8ClassIndex::V8WrapperType, v8::Handle<v8::Value>); > + static v8::Handle<v8::Object> lookupDOMWrapper(V8ClassIndex::V8WrapperType type, v8::Handle<v8::Object> object) > + { > + if (object.IsEmpty()) > + return object; > + > + v8::Handle<v8::FunctionTemplate> descriptor = getTemplate(type); > + return object->FindInstanceInPrototypeChain(descriptor); Great! Can we go even more succinct here?: return object.IsEmpty() ? object : object->FindInstanceInPrototypeChain(getTemplate(type)); > + } > // A helper function extract native object pointer from a DOM wrapper > // and cast to the specified type.
Vitaly Repeshko
Comment 3 2009-08-07 09:59:50 PDT
Created attachment 34286 [details] more succinct patch
Dimitri Glazkov (Google)
Comment 4 2009-08-07 10:08:01 PDT
Comment on attachment 34286 [details] more succinct patch r=me. You forgot the ChageLog change, but it's no big deal -- doesn't affect the quality of the patch.
Adam Barth
Comment 5 2009-08-07 16:07:49 PDT
Comment on attachment 34286 [details] more succinct patch Boo. Tabs in changelog. I'll land manually.
Adam Barth
Comment 6 2009-08-07 16:11:45 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/bindings/v8/V8DOMWrapper.cpp M WebCore/bindings/v8/V8DOMWrapper.h Committed r46921
Note You need to log in before you can comment on or make changes to this bug.