Bug 40119

Summary: Web Inspector [JSC]: Instrument JS function calls from bindings for Timeline Panel.
Product: WebKit Reporter: Pavel Feldman <pfeldman>
Component: Web Inspector (Deprecated)Assignee: Eli Fidler <efidler>
Severity: Normal CC: bweinstein, efidler, ggaren, joepeck, kpiascik, oliver, rik, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Description Flags
Patch none

Description Pavel Feldman 2010-06-03 06:40:33 PDT
timelineAgent->willCallFunction(resourceName, lineNumber); should be called each time some native event handler passes control to the JavaScript function.
Comment 1 Timothy Hatcher 2010-06-03 06:41:34 PDT
This is something V8 has, that we should consider for JSC to match Chrome.
Comment 2 Eli Fidler 2012-01-19 14:50:42 PST
Created attachment 123200 [details]
Comment 3 Pavel Feldman 2012-01-20 03:33:49 PST
Comment on attachment 123200 [details]

Web Inspector part looks good. Please have someone from the JSC team look at it (JSCallbackData changes and instrumentedCall source / line fetching).
Comment 4 Eli Fidler 2012-01-20 09:07:06 PST
CC ggaren and olliej for feedback
Comment 5 Geoffrey Garen 2012-01-20 11:40:48 PST
Comment on attachment 123200 [details]

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

> Source/WebCore/bindings/js/JSCallbackData.cpp:73
> +        Page* page = static_cast<JSDOMWindow*>(globalObject())->impl()->frame()->page();
> +        ASSERT(page);

What guarantees that frame() and page() will not be NULL here? I think you need to NULL check both.

> Source/WebCore/bindings/js/JSMainThreadExecState.h:63
> +            String resourceName("undefined");

Creating the string "undefined" should be conditional -- otherwise, it's a malloc per function call.

> Source/WebCore/bindings/js/JSMainThreadExecState.h:76
> +        InspectorInstrumentation::didCallFunction(cookie);

This code will call didCallFunction even if it didn't call willCallFunction. Is that right?
Comment 6 Eli Fidler 2012-01-20 15:17:52 PST
Created attachment 123392 [details]
Comment 7 Eli Fidler 2012-01-20 15:18:43 PST
addressed ggaren's first two comments.

The didCallFunction even if not willCallFunction paradigm is the same as the V8 implementation. It should work fine.
Comment 8 Geoffrey Garen 2012-01-26 11:25:13 PST
Comment on attachment 123392 [details]

Comment 9 WebKit Review Bot 2012-01-26 12:39:23 PST
Comment on attachment 123392 [details]

Clearing flags on attachment: 123392

Committed r106030: <http://trac.webkit.org/changeset/106030>
Comment 10 WebKit Review Bot 2012-01-26 12:39:28 PST
All reviewed patches have been landed.  Closing bug.