Bug 140836 - Web Inspector: BasicBlockAnnotator and TypeTokenAnnotator shouldn't indefinitely ping for new information
Summary: Web Inspector: BasicBlockAnnotator and TypeTokenAnnotator shouldn't indefinit...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Saam Barati
URL:
Keywords: InRadar
Depends on: 141927
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-23 13:46 PST by Saam Barati
Modified: 2016-12-13 15:34 PST (History)
6 users (show)

See Also:


Attachments
work in progress (17.03 KB, patch)
2015-02-22 22:26 PST, Saam Barati
no flags Details | Formatted Diff | Diff
work in progress (23.03 KB, patch)
2015-02-23 00:16 PST, Saam Barati
no flags Details | Formatted Diff | Diff
work in progress (23.03 KB, patch)
2015-02-28 11:04 PST, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2015-01-23 13:46:41 PST
Currently, once the type profiler starts asking for type information, it never stops until we stop viewing a JS file or encounter an error. 
We should make the annotators smarter at pinging for information only when we know that the information could have changed.

I think a good way to approach this would be to send an inspector event when JS code executes after not executing. As Brian pointed out, on
a run loop tick where JS executes. I think another good metric would be to send an event when we clear the type profiler log.

Anybody have ideas on an effective way of accomplishing this?
Comment 1 Radar WebKit Bug Importer 2015-01-23 13:48:14 PST
<rdar://problem/19583678>
Comment 2 Saam Barati 2015-02-05 18:03:16 PST
I think this is the current plan:

Use events to drive UI updates.

What would trigger an event:

1. JSC::TypeProfilerLog being cleared. 
- This happens on GC and when the log fills up

2. Some timer in the inspector goes off and JSC::TypeProfilerLog has data in it
- This is to prevent situations where data is sitting in the log waiting to be processed, but no GC occurs and the log doesn't fill up.

3. JSC::ControlFlowProfiler will now incorporate a dirty bit. When we emit code for op_profile_control_flow, we can write to this dirty bit indicating that some code has executed. We can then have a timer in the inspector that checks for this dirty bit and issues events to signal when there is new data.
Comment 3 Saam Barati 2015-02-22 22:26:57 PST
Created attachment 247098 [details]
work in progress

it begins!
Comment 4 Saam Barati 2015-02-23 00:16:35 PST
Created attachment 247104 [details]
work in progress

events are actually being called now when the TypeProfilerLog clears its
entries. TypeProfilerLog will need to be changed to support multiple
listeners for this call back in case there is more than one inspector
inspecting the VM.
Comment 5 Saam Barati 2015-02-28 11:04:56 PST
Created attachment 247604 [details]
work in progress

Just want to upload work here so I can clear off local branch until
we get timers into JSC.