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

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

Issue 1415733004: Reland of "[heap] Divide available memory upon compaction tasks" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix size computation in TryRemoveMemory Created 5 years, 2 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
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_HEAP_MARK_COMPACT_H_ 5 #ifndef V8_HEAP_MARK_COMPACT_H_
6 #define V8_HEAP_MARK_COMPACT_H_ 6 #define V8_HEAP_MARK_COMPACT_H_
7 7
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/heap/spaces.h" 9 #include "src/heap/spaces.h"
10 10
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 void EnsureSweepingCompleted(); 460 void EnsureSweepingCompleted();
461 461
462 void SweepOrWaitUntilSweepingCompleted(Page* page); 462 void SweepOrWaitUntilSweepingCompleted(Page* page);
463 463
464 // If sweeper threads are not active this method will return true. If 464 // If sweeper threads are not active this method will return true. If
465 // this is a latency issue we should be smarter here. Otherwise, it will 465 // this is a latency issue we should be smarter here. Otherwise, it will
466 // return true if the sweeper threads are done processing the pages. 466 // return true if the sweeper threads are done processing the pages.
467 bool IsSweepingCompleted(); 467 bool IsSweepingCompleted();
468 468
469 void RefillFreeList(PagedSpace* space);
470
471 // Checks if sweeping is in progress right now on any space. 469 // Checks if sweeping is in progress right now on any space.
472 bool sweeping_in_progress() { return sweeping_in_progress_; } 470 bool sweeping_in_progress() { return sweeping_in_progress_; }
473 471
474 void set_evacuation(bool evacuation) { evacuation_ = evacuation; } 472 void set_evacuation(bool evacuation) { evacuation_ = evacuation; }
475 473
476 bool evacuation() const { return evacuation_; } 474 bool evacuation() const { return evacuation_; }
477 475
478 // Special case for processing weak references in a full collection. We need 476 // Special case for processing weak references in a full collection. We need
479 // to artificially keep AllocationSites alive for a time. 477 // to artificially keep AllocationSites alive for a time.
480 void MarkAllocationSite(AllocationSite* site); 478 void MarkAllocationSite(AllocationSite* site);
(...skipping 24 matching lines...) Expand all
505 // when mark bits are still intact. 503 // when mark bits are still intact.
506 bool IsSlotInBlackObject(Page* p, Address slot, HeapObject** out_object); 504 bool IsSlotInBlackObject(Page* p, Address slot, HeapObject** out_object);
507 bool IsSlotInBlackObjectSlow(Page* p, Address slot); 505 bool IsSlotInBlackObjectSlow(Page* p, Address slot);
508 bool IsSlotInLiveObject(Address slot); 506 bool IsSlotInLiveObject(Address slot);
509 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); 507 void VerifyIsSlotInLiveObject(Address slot, HeapObject* object);
510 508
511 // Removes all the slots in the slot buffers that are within the given 509 // Removes all the slots in the slot buffers that are within the given
512 // address range. 510 // address range.
513 void RemoveObjectSlots(Address start_slot, Address end_slot); 511 void RemoveObjectSlots(Address start_slot, Address end_slot);
514 512
513 //
514 // Free lists filled by sweeper and consumed by corresponding spaces
515 // (including compaction spaces).
516 //
517 base::SmartPointer<FreeList>& free_list_old_space() {
518 return free_list_old_space_;
519 }
520 base::SmartPointer<FreeList>& free_list_code_space() {
521 return free_list_code_space_;
522 }
523 base::SmartPointer<FreeList>& free_list_map_space() {
524 return free_list_map_space_;
525 }
526
515 private: 527 private:
516 class CompactionTask; 528 class CompactionTask;
517 class SweeperTask; 529 class SweeperTask;
518 530
519 explicit MarkCompactCollector(Heap* heap); 531 explicit MarkCompactCollector(Heap* heap);
520 ~MarkCompactCollector(); 532 ~MarkCompactCollector();
521 533
522 bool WillBeDeoptimized(Code* code); 534 bool WillBeDeoptimized(Code* code);
523 void EvictPopularEvacuationCandidate(Page* page); 535 void EvictPopularEvacuationCandidate(Page* page);
524 void ClearInvalidStoreAndSlotsBufferEntries(); 536 void ClearInvalidStoreAndSlotsBufferEntries();
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 private: 859 private:
848 MarkCompactCollector* collector_; 860 MarkCompactCollector* collector_;
849 }; 861 };
850 862
851 863
852 const char* AllocationSpaceName(AllocationSpace space); 864 const char* AllocationSpaceName(AllocationSpace space);
853 } // namespace internal 865 } // namespace internal
854 } // namespace v8 866 } // namespace v8
855 867
856 #endif // V8_HEAP_MARK_COMPACT_H_ 868 #endif // V8_HEAP_MARK_COMPACT_H_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698