Bug 112719 - Cache a pointer to V8DOMActivityLogger in PerContextData
Summary: Cache a pointer to V8DOMActivityLogger in PerContextData
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-19 11:12 PDT by Ankur Taly
Modified: 2013-03-19 19:41 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.09 KB, patch)
2013-03-19 17:29 PDT, Ankur Taly
no flags Details | Formatted Diff | Diff
Patch (3.36 KB, patch)
2013-03-19 18:04 PDT, Ankur Taly
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ankur Taly 2013-03-19 11:12:54 PDT
Add a data member (and getter, setter methods) to V8PerContextData that holds a pointer
to V8DOMActivityLogger. This member is set while initializing the context for a V8DOMWindowShell.
Ownership of the pointer is still retained by the HashMap in DOMWrapperWorld.
Comment 1 Ankur Taly 2013-03-19 15:25:57 PDT
Subsequent patches (addressing Bug: 107207) will then obtain a reference to the V8DOMActivityLogger directly from PerContextData attached to the current context. The assumption is that this is faster than getting the reference from the HashMap in DOMWrapperWorld
Comment 2 Ankur Taly 2013-03-19 17:29:48 PDT
Created attachment 193953 [details]
Patch
Comment 3 Kentaro Hara 2013-03-19 17:39:23 PDT
Comment on attachment 193953 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=193953&action=review

Looks OK

> Source/WebCore/ChangeLog:16
> +        Cache a pointer to V8DOMActivityLogger in PerContextData.
> +        Adds a data member (and getter, setter methods) to V8PerContextData
> +        that holds a pointer to a V8DOMActivityLogger. This member is set while
> +        initializing the context for a V8DOMWindowShell. Ownership of the pointer
> +        is still retained by the HashMap in DOMWrapperWorld.
> +        As a result of this patch, subsequent patches that will implement logging
> +        for DOM API access (See bug 107207) will be able to obtain a reference to
> +        the logger directly from PerContextData. This will benefit performance as it
> +        will be faster than looking up the logger in the HashMap in DOMWrapperWorld.
> +        https://bugs.webkit.org/show_bug.cgi?id=112719
> +
> +        Reviewed by NOBODY (OOPS!).
> +
> +        There are no new tests as there is no change in behavior.

Nit: In WebKit we write a bug title (which should be in one line), a bug URL, a bug description, and a test, in this order. Please fix it before landing.

> Source/WebCore/bindings/v8/V8PerContextData.h:128
> +    V8DOMActivityLogger* m_activityLogger;

Would you add a comment about the lifetime?
Comment 4 Ankur Taly 2013-03-19 18:04:31 PDT
Created attachment 193960 [details]
Patch
Comment 5 Kentaro Hara 2013-03-19 18:05:18 PDT
Comment on attachment 193960 [details]
Patch

Thanks!
Comment 6 WebKit Review Bot 2013-03-19 19:41:15 PDT
Comment on attachment 193960 [details]
Patch

Clearing flags on attachment: 193960

Committed r146295: <http://trac.webkit.org/changeset/146295>
Comment 7 WebKit Review Bot 2013-03-19 19:41:18 PDT
All reviewed patches have been landed.  Closing bug.