Bug 158413 - Web Inspector: Native frames when refreshing page during timeline recording even though frames aren't native
Summary: Web Inspector: Native frames when refreshing page during timeline recording e...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Local Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-06-05 22:18 PDT by Saam Barati
Modified: 2016-12-13 15:38 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-06-05 22:18:24 PDT
Consider this program:
```
var shouldComputeSin = false;
var shouldComputeCos = true;

function computeSin(obj, x) {
    if (shouldComputeSin)
        obj.sin = Math.sin(x);
}

function computeCos(obj, x) {
    if (shouldComputeCos)
        obj.sin = Math.cos(x);
}

function computeResults(x) {
    var obj = {};
    computeSin(obj, x);
    computeCos(obj, x);
}

for (var i = 0; i < 1000000; i++) {
    computeResults(i);
}
```

Put that in a <script> inside a page. Open Web Inspector. Record a timeline.
Refresh the page 10 times. The call tree will have 10 duplicates at the same
tree representing the above program. If you select that last of the 10 refreshes,
only that tree has frames that aren't native frames. The first 9 all have native frames
for all their frames even though they are all user defined functions/programs.
(Feel free to replace 10 with another number: Anything > 2).
Comment 1 Radar WebKit Bug Importer 2016-06-05 22:18:36 PDT
<rdar://problem/26645146>
Comment 2 Joseph Pecoraro 2016-06-06 01:00:38 PDT
Web give any call frame that doesn't have a source code location a "Native" appearance. We should see if we aren't getting a location, or maybe we get a location but it no longer makes sense. My bet is the location has a script identifier, but we clear the scripts when the page navigates.
Comment 3 Saam Barati 2016-06-06 11:04:39 PDT
(In reply to comment #2)
> Web give any call frame that doesn't have a source code location a "Native"
> appearance. We should see if we aren't getting a location, or maybe we get a
> location but it no longer makes sense. My bet is the location has a script
> identifier, but we clear the scripts when the page navigates.

Makes sense.
Comment 4 Timothy Hatcher 2016-06-07 10:26:53 PDT
As Joe says, in general we don't have source for old pages. We might want to flag these differently in the UI to have a non-native appearance but show we don't have source location anymore.