OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |