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

Unified Diff: src/debug.h

Issue 296693005: Move promises recorded for debugging to thread local data. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 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 | « no previous file | src/debug.cc » ('j') | no next file with comments »
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 9a110475dc9dfb3c95d7b2913de8189588a196d1..79562370452e52b5b79487f170679b2308626cac 100644
--- a/src/debug.h
+++ b/src/debug.h
@@ -519,13 +519,21 @@ 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.
- // Due to the possibility of reentry we use a list to form a stack.
- List<StackHandler*> promise_catch_handlers_;
- List<Handle<JSFunction> > promise_getters_;
+ class PromiseOnStack {
+ public:
+ PromiseOnStack(Isolate* isolate,
+ PromiseOnStack* prev,
+ Handle<JSFunction> getter);
+ ~PromiseOnStack();
+ StackHandler* handler() { return handler_; }
+ Handle<JSFunction> getter() { return getter_; }
+ PromiseOnStack* prev() { return prev_; }
+ private:
+ Isolate* isolate_;
+ StackHandler* handler_;
+ Handle<JSFunction> getter_;
+ PromiseOnStack* prev_;
+ };
// Per-thread data.
class ThreadLocal {
@@ -578,6 +586,13 @@ class Debug {
// of the pointer to function being restarted. Otherwise (most of the time)
// stores NULL. This pointer is used with 'step in' implementation.
Object** restarter_frame_function_pointer_;
+
+ // When a promise is being resolved, we may want to trigger a debug event
+ // if 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.
+ // Due to the possibility of reentry we use a linked list.
+ PromiseOnStack* promise_on_stack_;
};
// Storage location for registers when handling debug break calls
« no previous file with comments | « no previous file | src/debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698