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

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

Issue 2735803005: [heap] Start concurrent marking simultaneously with incremental marking. (Closed)
Patch Set: tweak Created 3 years, 9 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
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/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 1326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 // can cause another GC. Take into account the objects promoted during 1337 // can cause another GC. Take into account the objects promoted during
1338 // GC. 1338 // GC.
1339 old_generation_allocation_counter_at_last_gc_ += 1339 old_generation_allocation_counter_at_last_gc_ +=
1340 static_cast<size_t>(promoted_objects_size_); 1340 static_cast<size_t>(promoted_objects_size_);
1341 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects(); 1341 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects();
1342 break; 1342 break;
1343 case MINOR_MARK_COMPACTOR: 1343 case MINOR_MARK_COMPACTOR:
1344 MinorMarkCompact(); 1344 MinorMarkCompact();
1345 break; 1345 break;
1346 case SCAVENGER: 1346 case SCAVENGER:
1347 if (fast_promotion_mode_ && 1347 if ((fast_promotion_mode_ &&
1348 CanExpandOldGeneration(new_space()->Size())) { 1348 CanExpandOldGeneration(new_space()->Size())) ||
1349 (FLAG_concurrent_marking &&
1350 concurrent_marking_->IsMarkingInProgress())) {
Michael Lippautz 2017/03/08 19:14:34 IsMarkingInProgress should imply FLAG_concurrent_m
ulan 2017/03/10 16:45:27 Done.
1349 tracer()->NotifyYoungGenerationHandling( 1351 tracer()->NotifyYoungGenerationHandling(
1350 YoungGenerationHandling::kFastPromotionDuringScavenge); 1352 YoungGenerationHandling::kFastPromotionDuringScavenge);
1351 EvacuateYoungGeneration(); 1353 EvacuateYoungGeneration();
1352 } else { 1354 } else {
1353 tracer()->NotifyYoungGenerationHandling( 1355 tracer()->NotifyYoungGenerationHandling(
1354 YoungGenerationHandling::kRegularScavenge); 1356 YoungGenerationHandling::kRegularScavenge);
1355 1357
1356 Scavenge(); 1358 Scavenge();
1357 } 1359 }
1358 break; 1360 break;
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1596 } 1598 }
1597 return NULL; 1599 return NULL;
1598 } 1600 }
1599 1601
1600 private: 1602 private:
1601 Heap* heap_; 1603 Heap* heap_;
1602 }; 1604 };
1603 1605
1604 void Heap::EvacuateYoungGeneration() { 1606 void Heap::EvacuateYoungGeneration() {
1605 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_EVACUATE); 1607 TRACE_GC(tracer(), GCTracer::Scope::SCAVENGER_EVACUATE);
1606 DCHECK(fast_promotion_mode_); 1608 if (!FLAG_concurrent_marking) {
1607 DCHECK(CanExpandOldGeneration(new_space()->Size())); 1609 DCHECK(fast_promotion_mode_);
1610 DCHECK(CanExpandOldGeneration(new_space()->Size()));
1611 }
1608 1612
1609 mark_compact_collector()->sweeper().EnsureNewSpaceCompleted(); 1613 mark_compact_collector()->sweeper().EnsureNewSpaceCompleted();
1610 1614
1611 SetGCState(SCAVENGE); 1615 SetGCState(SCAVENGE);
1612 LOG(isolate_, ResourceEvent("scavenge", "begin")); 1616 LOG(isolate_, ResourceEvent("scavenge", "begin"));
1613 1617
1614 // Move pages from new->old generation. 1618 // Move pages from new->old generation.
1615 PageRange range(new_space()->bottom(), new_space()->top()); 1619 PageRange range(new_space()->bottom(), new_space()->top());
1616 for (auto it = range.begin(); it != range.end();) { 1620 for (auto it = range.begin(); it != range.end();) {
1617 Page* p = (*++it)->prev_page(); 1621 Page* p = (*++it)->prev_page();
(...skipping 4766 matching lines...) Expand 10 before | Expand all | Expand 10 after
6384 } 6388 }
6385 6389
6386 6390
6387 // static 6391 // static
6388 int Heap::GetStaticVisitorIdForMap(Map* map) { 6392 int Heap::GetStaticVisitorIdForMap(Map* map) {
6389 return StaticVisitorBase::GetVisitorId(map); 6393 return StaticVisitorBase::GetVisitorId(map);
6390 } 6394 }
6391 6395
6392 } // namespace internal 6396 } // namespace internal
6393 } // namespace v8 6397 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698