| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 enum DebugBreakType { | 66 enum DebugBreakType { |
| 67 NOT_DEBUG_BREAK, | 67 NOT_DEBUG_BREAK, |
| 68 DEBUGGER_STATEMENT, | 68 DEBUGGER_STATEMENT, |
| 69 DEBUG_BREAK_SLOT, | 69 DEBUG_BREAK_SLOT, |
| 70 DEBUG_BREAK_SLOT_AT_CALL, | 70 DEBUG_BREAK_SLOT_AT_CALL, |
| 71 DEBUG_BREAK_SLOT_AT_RETURN, | 71 DEBUG_BREAK_SLOT_AT_RETURN, |
| 72 DEBUG_BREAK_SLOT_AT_TAIL_CALL, | 72 DEBUG_BREAK_SLOT_AT_TAIL_CALL, |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 const int kDebugPromiseNoID = 0; | |
| 76 const int kDebugPromiseFirstID = 1; | |
| 77 | |
| 78 class BreakLocation { | 75 class BreakLocation { |
| 79 public: | 76 public: |
| 80 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, | 77 static BreakLocation FromFrame(Handle<DebugInfo> debug_info, |
| 81 JavaScriptFrame* frame); | 78 JavaScriptFrame* frame); |
| 82 | 79 |
| 83 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, | 80 static void AllAtCurrentStatement(Handle<DebugInfo> debug_info, |
| 84 JavaScriptFrame* frame, | 81 JavaScriptFrame* frame, |
| 85 List<BreakLocation>* result_out); | 82 List<BreakLocation>* result_out); |
| 86 | 83 |
| 87 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } | 84 inline bool IsReturn() const { return type_ == DEBUG_BREAK_SLOT_AT_RETURN; } |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 void PrepareStepOnThrow(); | 344 void PrepareStepOnThrow(); |
| 348 void ClearStepping(); | 345 void ClearStepping(); |
| 349 void ClearStepOut(); | 346 void ClearStepOut(); |
| 350 | 347 |
| 351 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); | 348 bool PrepareFunctionForBreakPoints(Handle<SharedFunctionInfo> shared); |
| 352 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, | 349 bool GetPossibleBreakpoints(Handle<Script> script, int start_position, |
| 353 int end_position, std::set<int>* positions); | 350 int end_position, std::set<int>* positions); |
| 354 | 351 |
| 355 void RecordGenerator(Handle<JSGeneratorObject> generator_object); | 352 void RecordGenerator(Handle<JSGeneratorObject> generator_object); |
| 356 | 353 |
| 354 void RunPromiseHook(PromiseHookType type, Handle<JSPromise> promise, |
| 355 Handle<Object> parent); |
| 356 |
| 357 int NextAsyncTaskId(Handle<JSObject> promise); | 357 int NextAsyncTaskId(Handle<JSObject> promise); |
| 358 | 358 |
| 359 bool IsBlackboxed(Handle<SharedFunctionInfo> shared); | 359 bool IsBlackboxed(Handle<SharedFunctionInfo> shared); |
| 360 | 360 |
| 361 void SetDebugDelegate(debug::DebugDelegate* delegate); | 361 void SetDebugDelegate(debug::DebugDelegate* delegate); |
| 362 | 362 |
| 363 // Returns whether the operation succeeded. Compilation can only be triggered | 363 // Returns whether the operation succeeded. Compilation can only be triggered |
| 364 // if a valid closure is passed as the second argument, otherwise the shared | 364 // if a valid closure is passed as the second argument, otherwise the shared |
| 365 // function needs to be compiled already. | 365 // function needs to be compiled already. |
| 366 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, | 366 bool EnsureDebugInfo(Handle<SharedFunctionInfo> shared, |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 Handle<Code> code); | 759 Handle<Code> code); |
| 760 static bool DebugBreakSlotIsPatched(Address pc); | 760 static bool DebugBreakSlotIsPatched(Address pc); |
| 761 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 761 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
| 762 }; | 762 }; |
| 763 | 763 |
| 764 | 764 |
| 765 } // namespace internal | 765 } // namespace internal |
| 766 } // namespace v8 | 766 } // namespace v8 |
| 767 | 767 |
| 768 #endif // V8_DEBUG_DEBUG_H_ | 768 #endif // V8_DEBUG_DEBUG_H_ |
| OLD | NEW |