• jarin's avatar
    [profiler] Fix attribution for the top-most interpreted frame. · d07f6540
    jarin authored
    Before this change, we attributed samples for the top-most interpreter frame to the second-topmost frame if we were in a bytecode handler with elided frame. With this change we try to detect that we are in a handler without a frame. If we are, we do not drop the topmost frame.
    
    For example, consider the program
    
    function inner() {
      var s = 0;
      for (var i = 0; i < 100000; i++) {
        s += i * i;
      }
      return s;
    }
    
    function trivial() {
      return inner();
    }
    
    for (var i = 0; i < 2000; i++) {
      trivial();
    }
    
    Before this change, d8 --prof --ignition --nocrankshaft and linux-tick-processor would produce:
    
      [JavaScript]:
       ticks  total  nonlib   name
       4885   83.4%   83.5%  Function: ~trivial a.js:15:17
        759   13.0%   13.0%  Function: ~inner a.js:7:15
    
    After this change, we get
    
     [JavaScript]:
       ticks  total  nonlib   name
       5486   95.9%   96.2%  Function: ~inner a.js:7:15
          4    0.1%    0.1%  Function: ~trivial a.js:15:17
    
    Review-Url: https://codereview.chromium.org/2667253004
    Cr-Commit-Position: refs/heads/master@{#42894}
    d07f6540
frames.cc 77 KB