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/assembler.h" | 9 #include "src/assembler.h" |
10 #include "src/base/atomicops.h" | 10 #include "src/base/atomicops.h" |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 | 329 |
330 bool IsBlackboxed(Handle<SharedFunctionInfo> shared); | 330 bool IsBlackboxed(Handle<SharedFunctionInfo> shared); |
331 | 331 |
332 void SetDebugDelegate(debug::DebugDelegate* delegate, bool pass_ownership); | 332 void SetDebugDelegate(debug::DebugDelegate* delegate, bool pass_ownership); |
333 | 333 |
334 // Returns whether the operation succeeded. | 334 // Returns whether the operation succeeded. |
335 bool EnsureBreakInfo(Handle<SharedFunctionInfo> shared); | 335 bool EnsureBreakInfo(Handle<SharedFunctionInfo> shared); |
336 void CreateBreakInfo(Handle<SharedFunctionInfo> shared); | 336 void CreateBreakInfo(Handle<SharedFunctionInfo> shared); |
337 Handle<DebugInfo> GetOrCreateDebugInfo(Handle<SharedFunctionInfo> shared); | 337 Handle<DebugInfo> GetOrCreateDebugInfo(Handle<SharedFunctionInfo> shared); |
338 | 338 |
| 339 void InstallCoverageInfo(Handle<SharedFunctionInfo> shared, |
| 340 Handle<CoverageInfo> coverage_info); |
| 341 void RemoveAllCoverageInfos(); |
| 342 |
339 template <typename C> | 343 template <typename C> |
340 bool CompileToRevealInnerFunctions(C* compilable); | 344 bool CompileToRevealInnerFunctions(C* compilable); |
341 | 345 |
342 // This function is used in FunctionNameUsing* tests. | 346 // This function is used in FunctionNameUsing* tests. |
343 Handle<Object> FindSharedFunctionInfoInScript(Handle<Script> script, | 347 Handle<Object> FindSharedFunctionInfoInScript(Handle<Script> script, |
344 int position); | 348 int position); |
345 | 349 |
346 static Handle<Object> GetSourceBreakLocations( | 350 static Handle<Object> GetSourceBreakLocations( |
347 Handle<SharedFunctionInfo> shared, | 351 Handle<SharedFunctionInfo> shared, |
348 BreakPositionAlignment position_aligment); | 352 BreakPositionAlignment position_aligment); |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 | 510 |
507 inline void AssertDebugContext() { | 511 inline void AssertDebugContext() { |
508 DCHECK(isolate_->context() == *debug_context()); | 512 DCHECK(isolate_->context() == *debug_context()); |
509 DCHECK(in_debug_scope()); | 513 DCHECK(in_debug_scope()); |
510 } | 514 } |
511 | 515 |
512 void ThreadInit(); | 516 void ThreadInit(); |
513 | 517 |
514 void PrintBreakLocation(); | 518 void PrintBreakLocation(); |
515 | 519 |
| 520 // Wraps logic for clearing and maybe freeing all debug infos. |
| 521 typedef std::function<bool(Handle<DebugInfo>)> DebugInfoClearFunction; |
| 522 void ClearAllDebugInfos(DebugInfoClearFunction clear_function); |
| 523 |
516 void RemoveBreakInfoAndMaybeFree(Handle<DebugInfo> debug_info); | 524 void RemoveBreakInfoAndMaybeFree(Handle<DebugInfo> debug_info); |
517 void FindDebugInfo(Handle<DebugInfo> debug_info, DebugInfoListNode** prev, | 525 void FindDebugInfo(Handle<DebugInfo> debug_info, DebugInfoListNode** prev, |
518 DebugInfoListNode** curr); | 526 DebugInfoListNode** curr); |
519 void FreeDebugInfoListNode(DebugInfoListNode* prev, DebugInfoListNode* node); | 527 void FreeDebugInfoListNode(DebugInfoListNode* prev, DebugInfoListNode* node); |
520 | 528 |
521 // Global handles. | 529 // Global handles. |
522 Handle<Context> debug_context_; | 530 Handle<Context> debug_context_; |
523 | 531 |
524 debug::DebugDelegate* debug_delegate_ = nullptr; | 532 debug::DebugDelegate* debug_delegate_ = nullptr; |
525 bool owns_debug_delegate_ = false; | 533 bool owns_debug_delegate_ = false; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 Handle<Code> code); | 816 Handle<Code> code); |
809 static bool DebugBreakSlotIsPatched(Address pc); | 817 static bool DebugBreakSlotIsPatched(Address pc); |
810 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); | 818 static void ClearDebugBreakSlot(Isolate* isolate, Address pc); |
811 }; | 819 }; |
812 | 820 |
813 | 821 |
814 } // namespace internal | 822 } // namespace internal |
815 } // namespace v8 | 823 } // namespace v8 |
816 | 824 |
817 #endif // V8_DEBUG_DEBUG_H_ | 825 #endif // V8_DEBUG_DEBUG_H_ |
OLD | NEW |