OLD | NEW |
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 Loading... |
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 | |
244 void PrepareStep(StepAction step_action, | 238 void PrepareStep(StepAction step_action, |
245 int step_count, | 239 int step_count, |
246 StackFrame::Id frame_id); | 240 StackFrame::Id frame_id); |
247 void ClearStepping(); | 241 void ClearStepping(); |
248 void ClearStepOut(); | 242 void ClearStepOut(); |
249 bool IsStepping() { return thread_local_.step_count_ > 0; } | 243 bool IsStepping() { return thread_local_.step_count_ > 0; } |
250 bool StepNextContinue(BreakLocationIterator* break_location_iterator, | 244 bool StepNextContinue(BreakLocationIterator* break_location_iterator, |
251 JavaScriptFrame* frame); | 245 JavaScriptFrame* frame); |
252 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); | 246 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); |
253 static bool HasDebugInfo(Handle<SharedFunctionInfo> shared); | 247 static bool HasDebugInfo(Handle<SharedFunctionInfo> shared); |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 // Cache of all scripts in the heap. | 531 // Cache of all scripts in the heap. |
538 ScriptCache* script_cache_; | 532 ScriptCache* script_cache_; |
539 | 533 |
540 // List of active debug info objects. | 534 // List of active debug info objects. |
541 DebugInfoListNode* debug_info_list_; | 535 DebugInfoListNode* debug_info_list_; |
542 | 536 |
543 bool disable_break_; | 537 bool disable_break_; |
544 bool break_on_exception_; | 538 bool break_on_exception_; |
545 bool break_on_uncaught_exception_; | 539 bool break_on_uncaught_exception_; |
546 | 540 |
547 // When a promise is being resolved, we may want to trigger a debug event for | |
548 // the case we catch a throw. For this purpose we remember the try-catch | |
549 // handler address that would catch the exception. We also hold onto a | |
550 // closure that returns a promise if the exception is considered uncaught. | |
551 StackHandler* current_promise_catch_handler_; | |
552 MaybeHandle<JSFunction> current_promise_getter_; | |
553 | |
554 // Per-thread data. | 541 // Per-thread data. |
555 class ThreadLocal { | 542 class ThreadLocal { |
556 public: | 543 public: |
557 // Counter for generating next break id. | 544 // Counter for generating next break id. |
558 int break_count_; | 545 int break_count_; |
559 | 546 |
560 // Current break id. | 547 // Current break id. |
561 int break_id_; | 548 int break_id_; |
562 | 549 |
563 // Frame id for the frame of the current break. | 550 // Frame id for the frame of the current break. |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 Handle<Object> break_points_hit); | 767 Handle<Object> break_points_hit); |
781 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( | 768 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( |
782 Handle<Object> exception, | 769 Handle<Object> exception, |
783 bool uncaught, | 770 bool uncaught, |
784 Handle<Object> promise); | 771 Handle<Object> promise); |
785 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( | 772 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( |
786 Handle<Script> script, bool before); | 773 Handle<Script> script, bool before); |
787 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id); | 774 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id); |
788 | 775 |
789 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); | 776 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); |
790 void OnException(Handle<Object> exception, bool uncaught); | 777 void OnException(Handle<Object> exception, |
| 778 bool uncaught, |
| 779 Handle<Object> promise = Handle<Object>::null()); |
791 void OnBeforeCompile(Handle<Script> script); | 780 void OnBeforeCompile(Handle<Script> script); |
792 | 781 |
793 enum AfterCompileFlags { | 782 enum AfterCompileFlags { |
794 NO_AFTER_COMPILE_FLAGS, | 783 NO_AFTER_COMPILE_FLAGS, |
795 SEND_WHEN_DEBUGGING | 784 SEND_WHEN_DEBUGGING |
796 }; | 785 }; |
797 void OnAfterCompile(Handle<Script> script, | 786 void OnAfterCompile(Handle<Script> script, |
798 AfterCompileFlags after_compile_flags); | 787 AfterCompileFlags after_compile_flags); |
799 void OnScriptCollected(int id); | 788 void OnScriptCollected(int id); |
800 void ProcessDebugEvent(v8::DebugEvent event, | 789 void ProcessDebugEvent(v8::DebugEvent event, |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 Mutex mutex_; | 1033 Mutex mutex_; |
1045 bool already_signalled_; | 1034 bool already_signalled_; |
1046 | 1035 |
1047 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); | 1036 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); |
1048 }; | 1037 }; |
1049 | 1038 |
1050 | 1039 |
1051 } } // namespace v8::internal | 1040 } } // namespace v8::internal |
1052 | 1041 |
1053 #endif // V8_DEBUG_H_ | 1042 #endif // V8_DEBUG_H_ |
OLD | NEW |