[Webkit-unassigned] [Bug 153636] New: JSC Sampling Profiler: First Bound Function name inadvertently appears where all bound functions get call

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 28 21:21:15 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=153636

            Bug ID: 153636
           Summary: JSC Sampling Profiler: First Bound Function name
                    inadvertently appears where all bound functions get
                    call
    Classification: Unclassified
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: joepeck at webkit.org
                CC: sbarati at apple.com, utatane.tea at gmail.com

Created attachment 270178
  --> https://bugs.webkit.org/attachment.cgi?id=270178&action=review
[TEST] Reduction

* SUMMARY
First Bound Function name inadvertently appears where all bound functions get call.

* STEPS TO REPRODUCE
1. Profile attached test case [bind-reduction.html]

* TEST
The test creates two bound functions:

    this._boundMethodOne = this.methodOne.bind(this);
    this._boundMethodTwo = this.methodTwo.bind(this);

It then calls both of them, which spins for 100ms each:

    this._boundMethodOne();
    this._boundMethodTwo();

The CallingContextTree contains a Native frame above the actual functions. This native frame, unfortunately, gets the name of the first bound function that was sampled. So the sample looks like:

    => [f] doStuff
      => [N] methodOne (this is the magic bound function)
        => [f] methodOne
        => [f] methodTwo

I would have expected either of these, probably preferring (1):

    (1) The "bound" function implementation detail doesn't appear in the trace:

    => [f] doStuff
      => [f] methodOne
      => [f] methodTwo

    (2) The "bound" function appears in the trace, with the name of each instance

    => [f] doStuff
      => [N] methodOne
        => [f] methodOne
      => [N] methodTwo
        => [f] methodTwo

It would be unfortunate for each bound function call to have multiple call frames, so I think (2) should be avoided.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160129/16aa9461/attachment.html>


More information about the webkit-unassigned mailing list