Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: src/mark-compact.h

Issue 143283002: Move the management of the already swept pages to MarkCompactCollector (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 typedef void (*ProcessNonLiveFunction)(HeapObject* object, Isolate* isolate); 564 typedef void (*ProcessNonLiveFunction)(HeapObject* object, Isolate* isolate);
565 565
566 // Pointer to member function, used in IterateLiveObjects. 566 // Pointer to member function, used in IterateLiveObjects.
567 typedef int (MarkCompactCollector::*LiveObjectCallback)(HeapObject* obj); 567 typedef int (MarkCompactCollector::*LiveObjectCallback)(HeapObject* obj);
568 568
569 // Set the global flags, it must be called before Prepare to take effect. 569 // Set the global flags, it must be called before Prepare to take effect.
570 inline void SetFlags(int flags); 570 inline void SetFlags(int flags);
571 571
572 static void Initialize(); 572 static void Initialize();
573 573
574 void SetUp();
575
574 void TearDown(); 576 void TearDown();
575 577
576 void CollectEvacuationCandidates(PagedSpace* space); 578 void CollectEvacuationCandidates(PagedSpace* space);
577 579
578 void AddEvacuationCandidate(Page* p); 580 void AddEvacuationCandidate(Page* p);
579 581
580 // Prepares for GC by resetting relocation info in old and map spaces and 582 // Prepares for GC by resetting relocation info in old and map spaces and
581 // choosing spaces to compact. 583 // choosing spaces to compact.
582 void Prepare(GCTracer* tracer); 584 void Prepare(GCTracer* tracer);
583 585
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 void ClearMarkbits(); 711 void ClearMarkbits();
710 712
711 bool abort_incremental_marking() const { return abort_incremental_marking_; } 713 bool abort_incremental_marking() const { return abort_incremental_marking_; }
712 714
713 bool is_compacting() const { return compacting_; } 715 bool is_compacting() const { return compacting_; }
714 716
715 MarkingParity marking_parity() { return marking_parity_; } 717 MarkingParity marking_parity() { return marking_parity_; }
716 718
717 // Concurrent and parallel sweeping support. 719 // Concurrent and parallel sweeping support.
718 void SweepInParallel(PagedSpace* space, 720 void SweepInParallel(PagedSpace* space,
719 FreeList* private_free_list, 721 FreeList* private_free_list);
720 FreeList* free_list);
721 722
722 void WaitUntilSweepingCompleted(); 723 void WaitUntilSweepingCompleted();
723 724
724 intptr_t StealMemoryFromSweeperThreads(PagedSpace* space); 725 intptr_t StealMemoryFromSweeperThreads(PagedSpace* space);
725 726
726 bool AreSweeperThreadsActivated(); 727 bool AreSweeperThreadsActivated();
727 728
728 bool IsConcurrentSweepingInProgress(); 729 bool IsConcurrentSweepingInProgress();
729 730
730 void set_sequential_sweeping(bool sequential_sweeping) { 731 void set_sequential_sweeping(bool sequential_sweeping) {
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
950 951
951 Heap* heap_; 952 Heap* heap_;
952 MarkingDeque marking_deque_; 953 MarkingDeque marking_deque_;
953 CodeFlusher* code_flusher_; 954 CodeFlusher* code_flusher_;
954 Object* encountered_weak_collections_; 955 Object* encountered_weak_collections_;
955 bool have_code_to_deoptimize_; 956 bool have_code_to_deoptimize_;
956 957
957 List<Page*> evacuation_candidates_; 958 List<Page*> evacuation_candidates_;
958 List<Code*> invalidated_code_; 959 List<Code*> invalidated_code_;
959 960
961 SmartPointer<FreeList> free_list_old_data_space_;
962 SmartPointer<FreeList> free_list_old_pointer_space_;
963
960 friend class Heap; 964 friend class Heap;
961 }; 965 };
962 966
963 967
964 class MarkBitCellIterator BASE_EMBEDDED { 968 class MarkBitCellIterator BASE_EMBEDDED {
965 public: 969 public:
966 explicit MarkBitCellIterator(MemoryChunk* chunk) 970 explicit MarkBitCellIterator(MemoryChunk* chunk)
967 : chunk_(chunk) { 971 : chunk_(chunk) {
968 last_cell_index_ = Bitmap::IndexToCell( 972 last_cell_index_ = Bitmap::IndexToCell(
969 Bitmap::CellAlignIndex( 973 Bitmap::CellAlignIndex(
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 private: 1023 private:
1020 MarkCompactCollector* collector_; 1024 MarkCompactCollector* collector_;
1021 }; 1025 };
1022 1026
1023 1027
1024 const char* AllocationSpaceName(AllocationSpace space); 1028 const char* AllocationSpaceName(AllocationSpace space);
1025 1029
1026 } } // namespace v8::internal 1030 } } // namespace v8::internal
1027 1031
1028 #endif // V8_MARK_COMPACT_H_ 1032 #endif // V8_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/heap.cc ('k') | src/mark-compact.cc » ('j') | src/mark-compact.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698