| 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/assembler-inl.h" | 9 #include "src/assembler-inl.h" |
| 10 #include "src/ast/context-slot-cache.h" | 10 #include "src/ast/context-slot-cache.h" |
| (...skipping 1335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1346 // can cause another GC. Take into account the objects promoted during | 1346 // can cause another GC. Take into account the objects promoted during |
| 1347 // GC. | 1347 // GC. |
| 1348 old_generation_allocation_counter_at_last_gc_ += | 1348 old_generation_allocation_counter_at_last_gc_ += |
| 1349 static_cast<size_t>(promoted_objects_size_); | 1349 static_cast<size_t>(promoted_objects_size_); |
| 1350 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects(); | 1350 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects(); |
| 1351 break; | 1351 break; |
| 1352 case MINOR_MARK_COMPACTOR: | 1352 case MINOR_MARK_COMPACTOR: |
| 1353 MinorMarkCompact(); | 1353 MinorMarkCompact(); |
| 1354 break; | 1354 break; |
| 1355 case SCAVENGER: | 1355 case SCAVENGER: |
| 1356 if (fast_promotion_mode_ && | 1356 if ((fast_promotion_mode_ && |
| 1357 CanExpandOldGeneration(new_space()->Size())) { | 1357 CanExpandOldGeneration(new_space()->Size())) || |
| 1358 concurrent_marking_->IsTaskPending()) { |
| 1358 tracer()->NotifyYoungGenerationHandling( | 1359 tracer()->NotifyYoungGenerationHandling( |
| 1359 YoungGenerationHandling::kFastPromotionDuringScavenge); | 1360 YoungGenerationHandling::kFastPromotionDuringScavenge); |
| 1360 EvacuateYoungGeneration(); | 1361 EvacuateYoungGeneration(); |
| 1361 } else { | 1362 } else { |
| 1362 tracer()->NotifyYoungGenerationHandling( | 1363 tracer()->NotifyYoungGenerationHandling( |
| 1363 YoungGenerationHandling::kRegularScavenge); | 1364 YoungGenerationHandling::kRegularScavenge); |
| 1364 | 1365 |
| 1365 Scavenge(); | 1366 Scavenge(); |
| 1366 } | 1367 } |
| 1367 break; | 1368 break; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 } | 1620 } |
| 1620 return NULL; | 1621 return NULL; |
| 1621 } | 1622 } |
| 1622 | 1623 |
| 1623 private: | 1624 private: |
| 1624 Heap* heap_; | 1625 Heap* heap_; |
| 1625 }; | 1626 }; |
| 1626 | 1627 |
| 1627 void Heap::EvacuateYoungGeneration() { | 1628 void Heap::EvacuateYoungGeneration() { |
| 1628 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_EVACUATE); | 1629 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_EVACUATE); |
| 1629 DCHECK(fast_promotion_mode_); | 1630 if (!FLAG_concurrent_marking) { |
| 1630 DCHECK(CanExpandOldGeneration(new_space()->Size())); | 1631 DCHECK(fast_promotion_mode_); |
| 1632 DCHECK(CanExpandOldGeneration(new_space()->Size())); |
| 1633 } |
| 1631 | 1634 |
| 1632 mark_compact_collector()->sweeper().EnsureNewSpaceCompleted(); | 1635 mark_compact_collector()->sweeper().EnsureNewSpaceCompleted(); |
| 1633 | 1636 |
| 1634 SetGCState(SCAVENGE); | 1637 SetGCState(SCAVENGE); |
| 1635 LOG(isolate_, ResourceEvent("scavenge", "begin")); | 1638 LOG(isolate_, ResourceEvent("scavenge", "begin")); |
| 1636 | 1639 |
| 1637 // Move pages from new->old generation. | 1640 // Move pages from new->old generation. |
| 1638 PageRange range(new_space()->bottom(), new_space()->top()); | 1641 PageRange range(new_space()->bottom(), new_space()->top()); |
| 1639 for (auto it = range.begin(); it != range.end();) { | 1642 for (auto it = range.begin(); it != range.end();) { |
| 1640 Page* p = (*++it)->prev_page(); | 1643 Page* p = (*++it)->prev_page(); |
| (...skipping 4763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6404 } | 6407 } |
| 6405 | 6408 |
| 6406 | 6409 |
| 6407 // static | 6410 // static |
| 6408 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6411 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6409 return StaticVisitorBase::GetVisitorId(map); | 6412 return StaticVisitorBase::GetVisitorId(map); |
| 6410 } | 6413 } |
| 6411 | 6414 |
| 6412 } // namespace internal | 6415 } // namespace internal |
| 6413 } // namespace v8 | 6416 } // namespace v8 |
| OLD | NEW |