• Simon Zünd's avatar
    Store JSMessageObject on rejected promises · b15c02d0
    Simon Zünd authored
    When V8 throws an uncaught exception, we store a JSMessageObject
    with a stack trace and source positions on the isolate itself.
    The JSMessageObject can be retrieved by a TryCatch scope
    and is used by the inspector to provide additional information to the DevTools
    frontend (besides the exception).
    
    Introducing top-level await for REPL mode causes all thrown exceptions
    to be turned into a rejected promise. The implicit catch block that does this
    conversion clears the JSMessageObject from the isolate as to not leak memory.
    
    This CL preserves the JSMessageObject when the debugger is active and stores
    the JSMessageObject on the rejected promise itself. The inspector is changed
    to retrieve the JSMessageObject in the existing catch handler and pass the
    information along to the frontend.
    
    Drive-by: This CL removes a inspector test that made assumptions when a promise
    is cleaned up by the GC. These assumptions no longer hold since we hold on to
    the promise longer.
    
    Bug: chromium:1021921
    Change-Id: Id0380e2cf3bd79aca05191bc4f3c616f6ced8db7
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1967375
    Commit-Queue: Simon Zünd <szuend@chromium.org>
    Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
    Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
    Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#65497}
    b15c02d0
Name
Last commit
Last update
..
BUILD.gn Loading commit data...
DEPS Loading commit data...
OWNERS Loading commit data...
custom-preview.cc Loading commit data...
custom-preview.h Loading commit data...
injected-script.cc Loading commit data...
injected-script.h Loading commit data...
inspected-context.cc Loading commit data...
inspected-context.h Loading commit data...
inspector_protocol_config.json Loading commit data...
remote-object-id.cc Loading commit data...
remote-object-id.h Loading commit data...
search-util.cc Loading commit data...
search-util.h Loading commit data...
string-16.cc Loading commit data...
string-16.h Loading commit data...
string-util.cc Loading commit data...
string-util.h Loading commit data...
test-interface.cc Loading commit data...
test-interface.h Loading commit data...
v8-console-agent-impl.cc Loading commit data...
v8-console-agent-impl.h Loading commit data...
v8-console-message.cc Loading commit data...
v8-console-message.h Loading commit data...
v8-console.cc Loading commit data...
v8-console.h Loading commit data...
v8-debugger-agent-impl.cc Loading commit data...
v8-debugger-agent-impl.h Loading commit data...
v8-debugger-script.cc Loading commit data...
v8-debugger-script.h Loading commit data...
v8-debugger.cc Loading commit data...
v8-debugger.h Loading commit data...
v8-heap-profiler-agent-impl.cc Loading commit data...
v8-heap-profiler-agent-impl.h Loading commit data...
v8-inspector-impl.cc Loading commit data...
v8-inspector-impl.h Loading commit data...
v8-inspector-session-impl.cc Loading commit data...
v8-inspector-session-impl.h Loading commit data...
v8-profiler-agent-impl.cc Loading commit data...
v8-profiler-agent-impl.h Loading commit data...
v8-regex.cc Loading commit data...
v8-regex.h Loading commit data...
v8-runtime-agent-impl.cc Loading commit data...
v8-runtime-agent-impl.h Loading commit data...
v8-schema-agent-impl.cc Loading commit data...
v8-schema-agent-impl.h Loading commit data...
v8-stack-trace-impl.cc Loading commit data...
v8-stack-trace-impl.h Loading commit data...
v8-string-conversions.cc Loading commit data...
v8-string-conversions.h Loading commit data...
v8-value-utils.cc Loading commit data...
v8-value-utils.h Loading commit data...
value-mirror.cc Loading commit data...
value-mirror.h Loading commit data...
wasm-translation.cc Loading commit data...
wasm-translation.h Loading commit data...