Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 691 void WaitUntilSweepingCompleted(); | 691 void WaitUntilSweepingCompleted(); |
| 692 | 692 |
| 693 intptr_t StealMemoryFromSweeperThreads(PagedSpace* space); | 693 intptr_t StealMemoryFromSweeperThreads(PagedSpace* space); |
| 694 | 694 |
| 695 bool AreSweeperThreadsActivated(); | 695 bool AreSweeperThreadsActivated(); |
| 696 | 696 |
| 697 bool IsConcurrentSweepingInProgress(); | 697 bool IsConcurrentSweepingInProgress(); |
| 698 | 698 |
| 699 void FinalizeSweeping(); | 699 void FinalizeSweeping(); |
| 700 | 700 |
| 701 void set_sequential_sweeping(bool sequential_sweeping) { | |
| 702 sequential_sweeping_ = sequential_sweeping; | |
| 703 } | |
| 704 | |
| 705 bool sequential_sweeping() const { | |
| 706 return sequential_sweeping_; | |
| 707 } | |
| 708 | |
| 701 // Parallel marking support. | 709 // Parallel marking support. |
| 702 void MarkInParallel(); | 710 void MarkInParallel(); |
| 703 | 711 |
| 704 void WaitUntilMarkingCompleted(); | 712 void WaitUntilMarkingCompleted(); |
| 705 | 713 |
| 706 private: | 714 private: |
| 707 MarkCompactCollector(); | 715 MarkCompactCollector(); |
| 708 ~MarkCompactCollector(); | 716 ~MarkCompactCollector(); |
| 709 | 717 |
| 710 bool MarkInvalidatedCode(); | 718 bool MarkInvalidatedCode(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 742 | 750 |
| 743 // True if we are collecting slots to perform evacuation from evacuation | 751 // True if we are collecting slots to perform evacuation from evacuation |
| 744 // candidates. | 752 // candidates. |
| 745 bool compacting_; | 753 bool compacting_; |
| 746 | 754 |
| 747 bool was_marked_incrementally_; | 755 bool was_marked_incrementally_; |
| 748 | 756 |
| 749 // True if concurrent or parallel sweeping is currently in progress. | 757 // True if concurrent or parallel sweeping is currently in progress. |
| 750 bool sweeping_pending_; | 758 bool sweeping_pending_; |
| 751 | 759 |
| 760 bool sequential_sweeping_; | |
| 761 | |
| 752 // A pointer to the current stack-allocated GC tracer object during a full | 762 // A pointer to the current stack-allocated GC tracer object during a full |
| 753 // collection (NULL before and after). | 763 // collection (NULL before and after). |
| 754 GCTracer* tracer_; | 764 GCTracer* tracer_; |
| 755 | 765 |
| 756 SlotsBufferAllocator slots_buffer_allocator_; | 766 SlotsBufferAllocator slots_buffer_allocator_; |
| 757 | 767 |
| 758 SlotsBuffer* migration_slots_buffer_; | 768 SlotsBuffer* migration_slots_buffer_; |
| 759 | 769 |
| 760 // Finishes GC, performs heap verification if enabled. | 770 // Finishes GC, performs heap verification if enabled. |
| 761 void Finish(); | 771 void Finish(); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 897 CodeFlusher* code_flusher_; | 907 CodeFlusher* code_flusher_; |
| 898 Object* encountered_weak_maps_; | 908 Object* encountered_weak_maps_; |
| 899 | 909 |
| 900 List<Page*> evacuation_candidates_; | 910 List<Page*> evacuation_candidates_; |
| 901 List<Code*> invalidated_code_; | 911 List<Code*> invalidated_code_; |
| 902 | 912 |
| 903 friend class Heap; | 913 friend class Heap; |
| 904 }; | 914 }; |
| 905 | 915 |
| 906 | 916 |
| 917 class SweepingScope BASE_EMBEDDED { | |
|
Michael Starzinger
2013/03/05 17:20:11
Naming this "SequentialSweepingScope" would be mor
Hannes Payer (out of office)
2013/03/05 17:27:04
Done.
| |
| 918 public: | |
| 919 explicit SweepingScope(MarkCompactCollector *collector) : | |
| 920 collector_(collector) { | |
| 921 collector_->set_sequential_sweeping(true); | |
| 922 } | |
| 923 | |
| 924 ~SweepingScope() { | |
| 925 collector_->set_sequential_sweeping(false); | |
| 926 } | |
| 927 | |
| 928 private: | |
| 929 MarkCompactCollector* collector_; | |
| 930 }; | |
| 931 | |
| 932 | |
| 907 const char* AllocationSpaceName(AllocationSpace space); | 933 const char* AllocationSpaceName(AllocationSpace space); |
| 908 | 934 |
| 909 } } // namespace v8::internal | 935 } } // namespace v8::internal |
| 910 | 936 |
| 911 #endif // V8_MARK_COMPACT_H_ | 937 #endif // V8_MARK_COMPACT_H_ |
| OLD | NEW |