OLD | NEW |
1 // Copyright 2008 the V8 project authors. All rights reserved. | 1 // Copyright 2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 while (!marking->IsComplete()) { | 568 while (!marking->IsComplete()) { |
569 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD); | 569 marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
570 if (marking->IsReadyToOverApproximateWeakClosure()) { | 570 if (marking->IsReadyToOverApproximateWeakClosure()) { |
571 marking->MarkObjectGroups(); | 571 marking->MarkObjectGroups(); |
572 } | 572 } |
573 } | 573 } |
574 CHECK(marking->IsComplete()); | 574 CHECK(marking->IsComplete()); |
575 } | 575 } |
576 | 576 |
577 | 577 |
| 578 static void DummyDebugEventListener( |
| 579 const v8::Debug::EventDetails& event_details) {} |
| 580 |
| 581 |
| 582 static inline void EnableDebugger() { |
| 583 v8::Debug::SetDebugEventListener(&DummyDebugEventListener); |
| 584 } |
| 585 |
| 586 |
| 587 static inline void DisableDebugger() { v8::Debug::SetDebugEventListener(NULL); } |
| 588 |
| 589 |
578 // Helper class for new allocations tracking and checking. | 590 // Helper class for new allocations tracking and checking. |
579 // To use checking of JS allocations tracking in a test, | 591 // To use checking of JS allocations tracking in a test, |
580 // just create an instance of this class. | 592 // just create an instance of this class. |
581 class HeapObjectsTracker { | 593 class HeapObjectsTracker { |
582 public: | 594 public: |
583 HeapObjectsTracker() { | 595 HeapObjectsTracker() { |
584 heap_profiler_ = i::Isolate::Current()->heap_profiler(); | 596 heap_profiler_ = i::Isolate::Current()->heap_profiler(); |
585 CHECK_NOT_NULL(heap_profiler_); | 597 CHECK_NOT_NULL(heap_profiler_); |
586 heap_profiler_->StartHeapObjectsTracking(true); | 598 heap_profiler_->StartHeapObjectsTracking(true); |
587 } | 599 } |
(...skipping 29 matching lines...) Expand all Loading... |
617 HandleAndZoneScope() {} | 629 HandleAndZoneScope() {} |
618 | 630 |
619 // Prefixing the below with main_ reduces a lot of naming clashes. | 631 // Prefixing the below with main_ reduces a lot of naming clashes. |
620 i::Zone* main_zone() { return &main_zone_; } | 632 i::Zone* main_zone() { return &main_zone_; } |
621 | 633 |
622 private: | 634 private: |
623 i::Zone main_zone_; | 635 i::Zone main_zone_; |
624 }; | 636 }; |
625 | 637 |
626 #endif // ifndef CCTEST_H_ | 638 #endif // ifndef CCTEST_H_ |
OLD | NEW |