[Webkit-unassigned] [Bug 28071] V8 bindings: speed up lookupDOMWrapper by using new V8 API function.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 7 09:51:00 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=28071


Dimitri Glazkov (Google) <dglazkov at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #34283|review?                     |review-
               Flag|                            |




--- Comment #2 from Dimitri Glazkov (Google) <dglazkov at chromium.org>  2009-08-07 09:51:00 PDT ---
(From update of attachment 34283)
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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list