| 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_DEBUG_H_ | 5 #ifndef V8_DEBUG_DEBUG_H_ |
| 6 #define V8_DEBUG_DEBUG_H_ | 6 #define V8_DEBUG_DEBUG_H_ |
| 7 | 7 |
| 8 #include "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/arguments.h" | 9 #include "src/arguments.h" |
| 10 #include "src/assembler.h" | 10 #include "src/assembler.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 | 460 |
| 461 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); | 461 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); |
| 462 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, | 462 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, |
| 463 int end_position, std::set<int>* positions); | 463 int end_position, std::set<int>* positions); |
| 464 | 464 |
| 465 void RecordGenerator(Handle<JSGeneratorObject> generator_object); | 465 void RecordGenerator(Handle<JSGeneratorObject> generator_object); |
| 466 | 466 |
| 467 int NextAsyncTaskId(Handle<JSObject> promise); | 467 int NextAsyncTaskId(Handle<JSObject> promise); |
| 468 | 468 |
| 469 void SetAsyncTaskListener(debug::AsyncTaskListener listener, void* data); | 469 void SetAsyncTaskListener(debug::AsyncTaskListener listener, void* data); |
| 470 void SetCompileEventListener(debug::CompileEventListener listener, |
| 471 void* data); |
| 470 | 472 |
| 471 // Returns whether the operation succeeded. Compilation can only be triggered | 473 // Returns whether the operation succeeded. Compilation can only be triggered |
| 472 // if a valid closure is passed as the second argument, otherwise the shared | 474 // if a valid closure is passed as the second argument, otherwise the shared |
| 473 // function needs to be compiled already. | 475 // function needs to be compiled already. |
| 474 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, | 476 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, |
| 475 Handle<JSFunction> function); | 477 Handle<JSFunction> function); |
| 476 void CreateDebugInfo(Handle<SharedFunctionInfo> shared); | 478 void CreateDebugInfo(Handle<SharedFunctionInfo> shared); |
| 477 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); | 479 static Handle<DebugInfo> GetDebugInfo(Handle<SharedFunctionInfo> shared); |
| 478 | 480 |
| 479 template <typename C> | 481 template <typename C> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 | 660 |
| 659 // Global handles. | 661 // Global handles. |
| 660 Handle<Context> debug_context_; | 662 Handle<Context> debug_context_; |
| 661 Handle<Object> event_listener_; | 663 Handle<Object> event_listener_; |
| 662 Handle<Object> event_listener_data_; | 664 Handle<Object> event_listener_data_; |
| 663 | 665 |
| 664 v8::Debug::MessageHandler message_handler_; | 666 v8::Debug::MessageHandler message_handler_; |
| 665 | 667 |
| 666 debug::AsyncTaskListener async_task_listener_ = nullptr; | 668 debug::AsyncTaskListener async_task_listener_ = nullptr; |
| 667 void* async_task_listener_data_ = nullptr; | 669 void* async_task_listener_data_ = nullptr; |
| 670 debug::CompileEventListener compile_event_listener_ = nullptr; |
| 671 void* compile_event_listener_data_ = nullptr; |
| 668 | 672 |
| 669 static const int kQueueInitialSize = 4; | 673 static const int kQueueInitialSize = 4; |
| 670 base::Semaphore command_received_; // Signaled for each command received. | 674 base::Semaphore command_received_; // Signaled for each command received. |
| 671 LockingCommandMessageQueue command_queue_; | 675 LockingCommandMessageQueue command_queue_; |
| 672 | 676 |
| 673 // Debugger is active, i.e. there is a debug event listener attached. | 677 // Debugger is active, i.e. there is a debug event listener attached. |
| 674 bool is_active_; | 678 bool is_active_; |
| 675 // Debugger needs to be notified on every new function call. | 679 // Debugger needs to be notified on every new function call. |
| 676 // Used for stepping and read-only checks | 680 // Used for stepping and read-only checks |
| 677 bool hook_on_function_call_; | 681 bool hook_on_function_call_; |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 Handle<Code> code); | 873 Handle<Code> code); |
| 870 static bool DebugBreakSlotIsPatched(Address pc); | 874 static bool DebugBreakSlotIsPatched(Address pc); |
| 871 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 875 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
| 872 }; | 876 }; |
| 873 | 877 |
| 874 | 878 |
| 875 } // namespace internal | 879 } // namespace internal |
| 876 } // namespace v8 | 880 } // namespace v8 |
| 877 | 881 |
| 878 #endif // V8_DEBUG_DEBUG_H_ | 882 #endif // V8_DEBUG_DEBUG_H_ |
| OLD | NEW |