Summary: | [V8] Speed up lookupDOMWrapper by using new V8 API function. | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Vitaly Repeshko <vitalyr> | ||||||
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | abarth, dglazkov | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Vitaly Repeshko
2009-08-07 09:38:55 PDT
Created attachment 34283 [details]
patch
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. Created attachment 34286 [details]
more succinct patch
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.
Comment on attachment 34286 [details]
more succinct patch
Boo. Tabs in changelog. I'll land manually.
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 |