Bug 151470
| Summary: | Web Inspector: Code hotness visualizer: introduce "isScope: true" property | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Nikita Vasilyev <nvasilyev> |
| Component: | Web Inspector | Assignee: | Nikita Vasilyev <nvasilyev> |
| Status: | ASSIGNED | ||
| Severity: | Normal | CC: | graouts, inspector-bugzilla-changes, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Local Build | ||
| Hardware: | All | ||
| OS: | All | ||
| Bug Depends on: | |||
| Bug Blocks: | 146115 | ||
Nikita Vasilyev
TL;DR
https://github.com/WebKit/webkit/blob/a7970c63ab35ad903f6060e2ba28eaf1bd562801/Source/JavaScriptCore/runtime/ControlFlowProfiler.cpp#L97
Instead emitting "executionCount: 1" for scopes, we should introduce a separate property. We could name it "parsed: true" instead of "executionCount: 1". I'm not sure if "parsed" is technically accurate, so bike-shedding is welcome.
Longer explanation:
var x = 1;
function foo() {
return 42;
}
Upon reading executing the JS code above, one of the ranges RuntimeAgent.getBasicBlocks would emit be:
{
startOffset: 0,
endOffset: // end of the file
hasExecuted: true,
executionCount: 1
}
This is a bit misleading, since function foo hasn't been executed.
I suggest to instead emit:
{
startOffset: 0,
endOffset: // end of the file
hasExecuted: true,
parsed: true
}
Having a different property would allow to style these ranges differently.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/23623352>
Nikita Vasilyev
(In reply to comment #0)
> TL;DR
> https://github.com/WebKit/webkit/blob/
> a7970c63ab35ad903f6060e2ba28eaf1bd562801/Source/JavaScriptCore/runtime/
> ControlFlowProfiler.cpp#L97
> Instead emitting "executionCount: 1" for scopes, we should introduce a
> separate property. We could name it "parsed: true" instead of
> "executionCount: 1". I'm not sure if "parsed" is technically accurate, so
> bike-shedding is welcome.
I renamed it from "parsed" to "isScope".