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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « include/v8-debug.h ('k') | src/debug.cc » ('j') | src/debug.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_DEBUG_H_ 5 #ifndef V8_DEBUG_H_
6 #define V8_DEBUG_H_ 6 #define V8_DEBUG_H_
7 7
8 #include "allocation.h" 8 #include "allocation.h"
9 #include "arguments.h" 9 #include "arguments.h"
10 #include "assembler.h" 10 #include "assembler.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 Handle<Object> break_point_object, 228 Handle<Object> break_point_object,
229 int* source_position, 229 int* source_position,
230 BreakPositionAlignment alignment); 230 BreakPositionAlignment alignment);
231 void ClearBreakPoint(Handle<Object> break_point_object); 231 void ClearBreakPoint(Handle<Object> break_point_object);
232 void ClearAllBreakPoints(); 232 void ClearAllBreakPoints();
233 void FloodWithOneShot(Handle<JSFunction> function); 233 void FloodWithOneShot(Handle<JSFunction> function);
234 void FloodBoundFunctionWithOneShot(Handle<JSFunction> function); 234 void FloodBoundFunctionWithOneShot(Handle<JSFunction> function);
235 void FloodHandlerWithOneShot(); 235 void FloodHandlerWithOneShot();
236 void ChangeBreakOnException(ExceptionBreakType type, bool enable); 236 void ChangeBreakOnException(ExceptionBreakType type, bool enable);
237 bool IsBreakOnException(ExceptionBreakType type); 237 bool IsBreakOnException(ExceptionBreakType type);
238
239 void PromiseHandlePrologue(Handle<JSFunction> promise_getter);
240 void PromiseHandleEpilogue();
241 // Returns a promise if it does not have a reject handler.
242 Handle<Object> GetPromiseForUncaughtException();
243
238 void PrepareStep(StepAction step_action, 244 void PrepareStep(StepAction step_action,
239 int step_count, 245 int step_count,
240 StackFrame::Id frame_id); 246 StackFrame::Id frame_id);
241 void ClearStepping(); 247 void ClearStepping();
242 void ClearStepOut(); 248 void ClearStepOut();
243 bool IsStepping() { return thread_local_.step_count_ > 0; } 249 bool IsStepping() { return thread_local_.step_count_ > 0; }
244 bool StepNextContinue(BreakLocationIterator* break_location_iterator, 250 bool StepNextContinue(BreakLocationIterator* break_location_iterator,
245 JavaScriptFrame* frame); 251 JavaScriptFrame* frame);
246 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); 252 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared);
247 static bool HasDebugInfo(Handle<SharedFunctionInfo> shared); 253 static bool HasDebugInfo(Handle<SharedFunctionInfo> shared);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 // Cache of all scripts in the heap. 540 // Cache of all scripts in the heap.
535 ScriptCache* script_cache_; 541 ScriptCache* script_cache_;
536 542
537 // List of active debug info objects. 543 // List of active debug info objects.
538 DebugInfoListNode* debug_info_list_; 544 DebugInfoListNode* debug_info_list_;
539 545
540 bool disable_break_; 546 bool disable_break_;
541 bool break_on_exception_; 547 bool break_on_exception_;
542 bool break_on_uncaught_exception_; 548 bool break_on_uncaught_exception_;
543 549
550 // When a promise is being resolved, we may want to trigger a debug event for
551 // the case we catch a throw. For this purpose we remember the try-catch
552 // handler address that would catch the exception. We also hold onto a
553 // closure that returns a promise if the exception is considered uncaught.
554 StackHandler* current_promise_catch_handler_;
555 MaybeHandle<JSFunction> current_promise_getter_;
556
544 // Per-thread data. 557 // Per-thread data.
545 class ThreadLocal { 558 class ThreadLocal {
546 public: 559 public:
547 // Counter for generating next break id. 560 // Counter for generating next break id.
548 int break_count_; 561 int break_count_;
549 562
550 // Current break id. 563 // Current break id.
551 int break_id_; 564 int break_id_;
552 565
553 // Frame id for the frame of the current break. 566 // Frame id for the frame of the current break.
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
770 Handle<Object> break_points_hit); 783 Handle<Object> break_points_hit);
771 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( 784 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent(
772 Handle<Object> exception, 785 Handle<Object> exception,
773 bool uncaught, 786 bool uncaught,
774 Handle<Object> promise); 787 Handle<Object> promise);
775 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( 788 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent(
776 Handle<Script> script, bool before); 789 Handle<Script> script, bool before);
777 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id); 790 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id);
778 791
779 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); 792 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue);
780 void OnException(Handle<Object> exception, 793 void OnException(Handle<Object> exception, bool uncaught);
781 bool uncaught,
782 Handle<Object> promise = Handle<Object>::null());
783 void OnBeforeCompile(Handle<Script> script); 794 void OnBeforeCompile(Handle<Script> script);
784 795
785 enum AfterCompileFlags { 796 enum AfterCompileFlags {
786 NO_AFTER_COMPILE_FLAGS, 797 NO_AFTER_COMPILE_FLAGS,
787 SEND_WHEN_DEBUGGING 798 SEND_WHEN_DEBUGGING
788 }; 799 };
789 void OnAfterCompile(Handle<Script> script, 800 void OnAfterCompile(Handle<Script> script,
790 AfterCompileFlags after_compile_flags); 801 AfterCompileFlags after_compile_flags);
791 void OnScriptCollected(int id); 802 void OnScriptCollected(int id);
792 void ProcessDebugEvent(v8::DebugEvent event, 803 void ProcessDebugEvent(v8::DebugEvent event,
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1036 Mutex mutex_; 1047 Mutex mutex_;
1037 bool already_signalled_; 1048 bool already_signalled_;
1038 1049
1039 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); 1050 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread);
1040 }; 1051 };
1041 1052
1042 1053
1043 } } // namespace v8::internal 1054 } } // namespace v8::internal
1044 1055
1045 #endif // V8_DEBUG_H_ 1056 #endif // V8_DEBUG_H_
OLDNEW
« 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