• kozyatinskiy's avatar
    [inspector] change target promise for kDebugWillHandle & kDebugDidHandle · cb545a8c
    kozyatinskiy authored
    - kDebugPromiseCreated(task, parent_task)
    This event occurs when promise is created (PromiseHookType::Init). V8Debugger uses this event to maintain task -> parent task map.
    
    - kDebugEnqueueAsyncFunction(task)
    This event occurs when first internal promise for async function is created. V8Debugger collects stack trace at this point.
    
    - kDebugEnqueuePromiseResolve(task),
    This event occurs when Promise fulfills with resolved status. V8Debugger collects stack trace at this point.
    
    - kDebugEnqueuePromiseReject(task),
    This event occurs when Promise fulfills with rejected status. V8Debugger collects stack trace at this point.
    
    - kDebugPromiseCollected,
    This event occurs when Promise is collected and no other chained callbacks can be added. V8Debugger removes information about async task for this promise.
    
    - kDebugWillHandle,
    This event occurs when chained promise function (either resolve or reject handler) is called. V8Debugger installs parent promise's stack (based on task -> parent_task map) as current if available or current promise's scheduled stack otherwise.
    
    - kDebugDidHandle,
    This event occurs after chained promise function has finished. V8Debugger restores asynchronous call chain to previous one.
    
    With this change all instrumentation calls are related to current promise (before WillHandle and DidHandle were related to next async task).
    
    Before V8Debugger supported only the following:
    - asyncTaskScheduled(task1)
    - asyncTaskStarted(task1)
    - asyncTaskFinished(task1)
    
    Now V8Debugger supports the following:
    - asyncTaskScheduled(parent_task)
    ..
    - asyncTaskCreated(task, parent_task),
    - asyncTaskStarted(task), uses parent_task scheduled stack
    - asyncTaskScheduled(task)
    - asyncTaskFinished(task)
    
    Additionally: WillHandle and DidHandle were migrated to PromiseHook API.
    
    More details: https://docs.google.com/document/d/1u19N45f1gSF7M39mGsycJEK3IPyJgIXCBnWyiPeuJFE
    
    BUG=v8:5738
    R=dgozman@chromium.org,gsathya@chromium.org,yangguo@chromium.org
    
    Review-Url: https://codereview.chromium.org/2650803003
    Cr-Commit-Position: refs/heads/master@{#42644}
    cb545a8c
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...