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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 // Cache of all scripts in the heap. | 512 // Cache of all scripts in the heap. |
513 ScriptCache* script_cache_; | 513 ScriptCache* script_cache_; |
514 | 514 |
515 // List of active debug info objects. | 515 // List of active debug info objects. |
516 DebugInfoListNode* debug_info_list_; | 516 DebugInfoListNode* debug_info_list_; |
517 | 517 |
518 bool disable_break_; | 518 bool disable_break_; |
519 bool break_on_exception_; | 519 bool break_on_exception_; |
520 bool break_on_uncaught_exception_; | 520 bool break_on_uncaught_exception_; |
521 | 521 |
522 // When a promise is being resolved, we may want to trigger a debug event for | 522 class PromiseOnStack { |
523 // the case we catch a throw. For this purpose we remember the try-catch | 523 public: |
524 // handler address that would catch the exception. We also hold onto a | 524 PromiseOnStack(Isolate* isolate, |
525 // closure that returns a promise if the exception is considered uncaught. | 525 PromiseOnStack* prev, |
526 // Due to the possibility of reentry we use a list to form a stack. | 526 Handle<JSFunction> getter); |
527 List<StackHandler*> promise_catch_handlers_; | 527 ~PromiseOnStack(); |
528 List<Handle<JSFunction> > promise_getters_; | 528 StackHandler* handler() { return handler_; } |
| 529 Handle<JSFunction> getter() { return getter_; } |
| 530 PromiseOnStack* prev() { return prev_; } |
| 531 private: |
| 532 Isolate* isolate_; |
| 533 StackHandler* handler_; |
| 534 Handle<JSFunction> getter_; |
| 535 PromiseOnStack* prev_; |
| 536 }; |
529 | 537 |
530 // Per-thread data. | 538 // Per-thread data. |
531 class ThreadLocal { | 539 class ThreadLocal { |
532 public: | 540 public: |
533 // Counter for generating next break id. | 541 // Counter for generating next break id. |
534 int break_count_; | 542 int break_count_; |
535 | 543 |
536 // Current break id. | 544 // Current break id. |
537 int break_id_; | 545 int break_id_; |
538 | 546 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 // Top debugger entry. | 579 // Top debugger entry. |
572 EnterDebugger* debugger_entry_; | 580 EnterDebugger* debugger_entry_; |
573 | 581 |
574 // Pending interrupts scheduled while debugging. | 582 // Pending interrupts scheduled while debugging. |
575 bool has_pending_interrupt_; | 583 bool has_pending_interrupt_; |
576 | 584 |
577 // When restarter frame is on stack, stores the address | 585 // When restarter frame is on stack, stores the address |
578 // of the pointer to function being restarted. Otherwise (most of the time) | 586 // of the pointer to function being restarted. Otherwise (most of the time) |
579 // stores NULL. This pointer is used with 'step in' implementation. | 587 // stores NULL. This pointer is used with 'step in' implementation. |
580 Object** restarter_frame_function_pointer_; | 588 Object** restarter_frame_function_pointer_; |
| 589 |
| 590 // When a promise is being resolved, we may want to trigger a debug event |
| 591 // if we catch a throw. For this purpose we remember the try-catch |
| 592 // handler address that would catch the exception. We also hold onto a |
| 593 // closure that returns a promise if the exception is considered uncaught. |
| 594 // Due to the possibility of reentry we use a linked list. |
| 595 PromiseOnStack* promise_on_stack_; |
581 }; | 596 }; |
582 | 597 |
583 // Storage location for registers when handling debug break calls | 598 // Storage location for registers when handling debug break calls |
584 ThreadLocal thread_local_; | 599 ThreadLocal thread_local_; |
585 void ThreadInit(); | 600 void ThreadInit(); |
586 | 601 |
587 Isolate* isolate_; | 602 Isolate* isolate_; |
588 | 603 |
589 friend class Isolate; | 604 friend class Isolate; |
590 | 605 |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 } | 956 } |
942 } | 957 } |
943 | 958 |
944 private: | 959 private: |
945 Debug::AddressId id_; | 960 Debug::AddressId id_; |
946 }; | 961 }; |
947 | 962 |
948 } } // namespace v8::internal | 963 } } // namespace v8::internal |
949 | 964 |
950 #endif // V8_DEBUG_H_ | 965 #endif // V8_DEBUG_H_ |
OLD | NEW |