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

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

Issue 2566133002: [heap] Clean-up uses of EnsureSweepingComplete uses. (Closed)
Patch Set: move code Created 4 years 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/spaces.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 #include "src/heap/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
769 void MarkCompactCollector::Prepare() { 769 void MarkCompactCollector::Prepare() {
770 was_marked_incrementally_ = heap()->incremental_marking()->IsMarking(); 770 was_marked_incrementally_ = heap()->incremental_marking()->IsMarking();
771 771
772 #ifdef DEBUG 772 #ifdef DEBUG
773 DCHECK(state_ == IDLE); 773 DCHECK(state_ == IDLE);
774 state_ = PREPARE_GC; 774 state_ = PREPARE_GC;
775 #endif 775 #endif
776 776
777 DCHECK(!FLAG_never_compact || !FLAG_always_compact); 777 DCHECK(!FLAG_never_compact || !FLAG_always_compact);
778 778
779 if (sweeping_in_progress()) { 779 // Instead of waiting we could also abort the sweeper threads here.
780 // Instead of waiting we could also abort the sweeper threads here. 780 EnsureSweepingCompleted();
781 EnsureSweepingCompleted();
782 }
783 781
784 if (heap()->incremental_marking()->IsSweeping()) { 782 if (heap()->incremental_marking()->IsSweeping()) {
785 heap()->incremental_marking()->Stop(); 783 heap()->incremental_marking()->Stop();
786 } 784 }
787 785
788 // If concurrent unmapping tasks are still running, we should wait for 786 // If concurrent unmapping tasks are still running, we should wait for
789 // them here. 787 // them here.
790 heap()->memory_allocator()->unmapper()->WaitUntilCompleted(); 788 heap()->memory_allocator()->unmapper()->WaitUntilCompleted();
791 789
792 // Clear marking bits if incremental marking is aborted. 790 // Clear marking bits if incremental marking is aborted.
(...skipping 3288 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 // The target is always in old space, we don't have to record the slot in 4079 // The target is always in old space, we don't have to record the slot in
4082 // the old-to-new remembered set. 4080 // the old-to-new remembered set.
4083 DCHECK(!heap()->InNewSpace(target)); 4081 DCHECK(!heap()->InNewSpace(target));
4084 RecordRelocSlot(host, &rinfo, target); 4082 RecordRelocSlot(host, &rinfo, target);
4085 } 4083 }
4086 } 4084 }
4087 } 4085 }
4088 4086
4089 } // namespace internal 4087 } // namespace internal
4090 } // namespace v8 4088 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698