Bug 155916 - Web Inspector: Improve handling of Bound functions in samples
Summary: Web Inspector: Improve handling of Bound functions in samples
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-03-25 20:26 PDT by Joseph Pecoraro
Modified: 2016-12-13 15:38 PST (History)
4 users (show)

See Also:


Attachments
[IMAGE] Call Tree with "bound" clutter (110.42 KB, image/png)
2016-03-25 20:26 PDT, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2016-03-25 20:26:59 PDT
Created attachment 274968 [details]
[IMAGE] Call Tree with "bound" clutter

* SUMMARY
Improve handling of Bound functions in samples.

Currently bound functions show up in the sample twice. The "[N] bound foo" and its immediate call to "[ƒ] foo". Ending up with:

    [ƒ] doStuff
      [N] bound foo
        [ƒ] foo
          [N] bound foo
            [ƒ] foo

Note we do not show these bound functions in our call stack. If we were paused in the inner foo here we would have a call stack like:

    [ƒ] foo
    [ƒ] foo
    [ƒ] doStuff

So the profile here could be:

    [ƒ] doStuff
      [ƒ] foo
        [ƒ] foo

Or:

    [ƒ] doStuff
      [ƒ] bound foo
        [ƒ] bound foo

Removing a bunch of extra, unnecessary duplication in the call tree.

* TEST
<script>
setInterval(function() { // anonymous
    (function foo() { // bound foo => foo
        var until = Date.now() + 2;
        while (Date.now() <= until);
        console.log(Date.now());
    }).bind(null)()
}, 1000);
</script>
Comment 1 Radar WebKit Bug Importer 2016-03-25 20:28:31 PDT
<rdar://problem/25371989>