Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: src/debug.h

Issue 260723002: Trigger exception debug event for promises at the throw site. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: comments addressed Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/v8-debug.h ('k') | src/debug.cc » ('j') | src/debug.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/debug.h
diff --git a/src/debug.h b/src/debug.h
index da59526e6ae02a04c188068dca668e47ddbf4063..b76c512c9c6820bcde378a4f7dac2cdb4b7c7506 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -235,6 +235,12 @@ class Debug {
void FloodHandlerWithOneShot();
void ChangeBreakOnException(ExceptionBreakType type, bool enable);
bool IsBreakOnException(ExceptionBreakType type);
+
+ void PromiseHandlePrologue(Handle<JSFunction> promise_getter);
+ void PromiseHandleEpilogue();
+ // Returns a promise if it does not have a reject handler.
+ Handle<Object> GetPromiseForUncaughtException();
+
void PrepareStep(StepAction step_action,
int step_count,
StackFrame::Id frame_id);
@@ -541,6 +547,13 @@ class Debug {
bool break_on_exception_;
bool break_on_uncaught_exception_;
+ // When a promise is being resolved, we may want to trigger a debug event for
+ // the case we catch a throw. For this purpose we remember the try-catch
+ // handler address that would catch the exception. We also hold onto a
+ // closure that returns a promise if the exception is considered uncaught.
+ StackHandler* current_promise_catch_handler_;
+ MaybeHandle<JSFunction> current_promise_getter_;
+
// Per-thread data.
class ThreadLocal {
public:
@@ -777,9 +790,7 @@ class Debugger {
MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id);
void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue);
- void OnException(Handle<Object> exception,
- bool uncaught,
- Handle<Object> promise = Handle<Object>::null());
+ void OnException(Handle<Object> exception, bool uncaught);
void OnBeforeCompile(Handle<Script> script);
enum AfterCompileFlags {
« no previous file with comments | « include/v8-debug.h ('k') | src/debug.cc » ('j') | src/debug.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698