• kozyatinskiy's avatar
    [inspector] better stacks for promises · f2bd913c
    kozyatinskiy authored
    - we should always set creation async stack if it's available regardless existing of current parent async stack,
    - we should cleanup parent link iff there is no creation and schedule async stack for parent.
    
    Let's consider example: Promise.resolve().then(x => x).then(x => x), there is three promises which will call following instrumentation:
    1) created #1 (Promise.resolve()) - collected stack #1
    2) scheduled #1 - collected stack #2
    3) created #2 with #1 as parent (first .then) - collected stack #3
    4) created #3 with #2 as parent (first .then) - collected stack #4
    5) started #2 - use stack #2 as scheduled
    6) scheduled #2 - collected stack #6
    7) finished #2
    8) started #3 - use stack #6 as scheduled
    9) scheduled #3 - collected stack #7
    10) finished #3
    
    If we collect stacks between step 4 and 5, it's possible to collect scheduled stack #2 but still have creation stack for #2 - stack #3 - so we always need to add creation event if scheduled is collected.
    
    If we collect stacks between created and scheduled we should not remove parent link even if parent was not scheduled yet.
    
    BUG=v8:6189
    R=dgozman@chromium.org
    
    Review-Url: https://codereview.chromium.org/2844753002
    Cr-Commit-Position: refs/heads/master@{#44990}
    f2bd913c
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...