• jarin's avatar
    [profiler] Fix attribution for the top-most interpreted frame. · e82880b6
    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-Original-Commit-Position: refs/heads/master@{#42894}
    Committed: https://chromium.googlesource.com/v8/v8/+/d07f6540c1f9628ed2ba1fa6507c90db07ccc5f5
    Review-Url: https://codereview.chromium.org/2667253004
    Cr-Commit-Position: refs/heads/master@{#42924}
    e82880b6
Name
Last commit
Last update
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...