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

Side by Side Diff: src/heap/heap.cc

Issue 2561103002: [heap] Prefer mark-compact over scavenger if incremental marking (Closed)
Patch Set: 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 | « no previous file | no next file » | 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/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/context-slot-cache.h" 9 #include "src/ast/context-slot-cache.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 isolate_->counters()->gc_compactor_caused_by_request()->Increment(); 257 isolate_->counters()->gc_compactor_caused_by_request()->Increment();
258 *reason = "GC in old space requested"; 258 *reason = "GC in old space requested";
259 return MARK_COMPACTOR; 259 return MARK_COMPACTOR;
260 } 260 }
261 261
262 if (FLAG_gc_global || (FLAG_stress_compaction && (gc_count_ & 1) != 0)) { 262 if (FLAG_gc_global || (FLAG_stress_compaction && (gc_count_ & 1) != 0)) {
263 *reason = "GC in old space forced by flags"; 263 *reason = "GC in old space forced by flags";
264 return MARK_COMPACTOR; 264 return MARK_COMPACTOR;
265 } 265 }
266 266
267 if (incremental_marking()->NeedsFinalization() &&
268 OldGenerationSpaceAvailable() == 0) {
269 *reason = "Incremental marking needs finalization";
270 return MARK_COMPACTOR;
271 }
272
267 // Is there enough space left in OLD to guarantee that a scavenge can 273 // Is there enough space left in OLD to guarantee that a scavenge can
268 // succeed? 274 // succeed?
269 // 275 //
270 // Note that MemoryAllocator->MaxAvailable() undercounts the memory available 276 // Note that MemoryAllocator->MaxAvailable() undercounts the memory available
271 // for object promotion. It counts only the bytes that the memory 277 // for object promotion. It counts only the bytes that the memory
272 // allocator has not yet allocated from the OS and assigned to any space, 278 // allocator has not yet allocated from the OS and assigned to any space,
273 // and does not count available bytes already in the old space or code 279 // and does not count available bytes already in the old space or code
274 // space. Undercounting is safe---we may get an unrequested full GC when 280 // space. Undercounting is safe---we may get an unrequested full GC when
275 // a scavenge would have succeeded. 281 // a scavenge would have succeeded.
276 if (memory_allocator()->MaxAvailable() <= new_space_->Size()) { 282 if (memory_allocator()->MaxAvailable() <= new_space_->Size()) {
(...skipping 6208 matching lines...) Expand 10 before | Expand all | Expand 10 after
6485 } 6491 }
6486 6492
6487 6493
6488 // static 6494 // static
6489 int Heap::GetStaticVisitorIdForMap(Map* map) { 6495 int Heap::GetStaticVisitorIdForMap(Map* map) {
6490 return StaticVisitorBase::GetVisitorId(map); 6496 return StaticVisitorBase::GetVisitorId(map);
6491 } 6497 }
6492 6498
6493 } // namespace internal 6499 } // namespace internal
6494 } // namespace v8 6500 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698