| 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 |
| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 // Cache of all scripts in the heap. | 537 // Cache of all scripts in the heap. |
| 532 ScriptCache* script_cache_; | 538 ScriptCache* script_cache_; |
| 533 | 539 |
| 534 // List of active debug info objects. | 540 // List of active debug info objects. |
| 535 DebugInfoListNode* debug_info_list_; | 541 DebugInfoListNode* debug_info_list_; |
| 536 | 542 |
| 537 bool disable_break_; | 543 bool disable_break_; |
| 538 bool break_on_exception_; | 544 bool break_on_exception_; |
| 539 bool break_on_uncaught_exception_; | 545 bool break_on_uncaught_exception_; |
| 540 | 546 |
| 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 // Due to the possibility of reentry we use a list to form a stack. |
| 552 List<StackHandler*> promise_catch_handlers_; |
| 553 List<Handle<JSFunction> > promise_getters_; |
| 554 |
| 541 // Per-thread data. | 555 // Per-thread data. |
| 542 class ThreadLocal { | 556 class ThreadLocal { |
| 543 public: | 557 public: |
| 544 // Counter for generating next break id. | 558 // Counter for generating next break id. |
| 545 int break_count_; | 559 int break_count_; |
| 546 | 560 |
| 547 // Current break id. | 561 // Current break id. |
| 548 int break_id_; | 562 int break_id_; |
| 549 | 563 |
| 550 // Frame id for the frame of the current break. | 564 // Frame id for the frame of the current break. |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 Handle<Object> break_points_hit); | 781 Handle<Object> break_points_hit); |
| 768 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( | 782 MUST_USE_RESULT MaybeHandle<Object> MakeExceptionEvent( |
| 769 Handle<Object> exception, | 783 Handle<Object> exception, |
| 770 bool uncaught, | 784 bool uncaught, |
| 771 Handle<Object> promise); | 785 Handle<Object> promise); |
| 772 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( | 786 MUST_USE_RESULT MaybeHandle<Object> MakeCompileEvent( |
| 773 Handle<Script> script, bool before); | 787 Handle<Script> script, bool before); |
| 774 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id); | 788 MUST_USE_RESULT MaybeHandle<Object> MakeScriptCollectedEvent(int id); |
| 775 | 789 |
| 776 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); | 790 void OnDebugBreak(Handle<Object> break_points_hit, bool auto_continue); |
| 777 void OnException(Handle<Object> exception, | 791 void OnException(Handle<Object> exception, bool uncaught); |
| 778 bool uncaught, | |
| 779 Handle<Object> promise = Handle<Object>::null()); | |
| 780 void OnBeforeCompile(Handle<Script> script); | 792 void OnBeforeCompile(Handle<Script> script); |
| 781 | 793 |
| 782 enum AfterCompileFlags { | 794 enum AfterCompileFlags { |
| 783 NO_AFTER_COMPILE_FLAGS, | 795 NO_AFTER_COMPILE_FLAGS, |
| 784 SEND_WHEN_DEBUGGING | 796 SEND_WHEN_DEBUGGING |
| 785 }; | 797 }; |
| 786 void OnAfterCompile(Handle<Script> script, | 798 void OnAfterCompile(Handle<Script> script, |
| 787 AfterCompileFlags after_compile_flags); | 799 AfterCompileFlags after_compile_flags); |
| 788 void OnScriptCollected(int id); | 800 void OnScriptCollected(int id); |
| 789 void ProcessDebugEvent(v8::DebugEvent event, | 801 void ProcessDebugEvent(v8::DebugEvent event, |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 Mutex mutex_; | 1045 Mutex mutex_; |
| 1034 bool already_signalled_; | 1046 bool already_signalled_; |
| 1035 | 1047 |
| 1036 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); | 1048 DISALLOW_COPY_AND_ASSIGN(MessageDispatchHelperThread); |
| 1037 }; | 1049 }; |
| 1038 | 1050 |
| 1039 | 1051 |
| 1040 } } // namespace v8::internal | 1052 } } // namespace v8::internal |
| 1041 | 1053 |
| 1042 #endif // V8_DEBUG_H_ | 1054 #endif // V8_DEBUG_H_ |
| OLD | NEW |