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

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

Issue 1812203002: [heap] Move mark-compact specific code to MarkCompactEpilogue (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move dcheck over to the MarkCompactEpilogue Created 4 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
« 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/scopeinfo.h" 9 #include "src/ast/scopeinfo.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 } 1315 }
1316 1316
1317 ProcessPretenuringFeedback(); 1317 ProcessPretenuringFeedback();
1318 } 1318 }
1319 1319
1320 UpdateSurvivalStatistics(start_new_space_size); 1320 UpdateSurvivalStatistics(start_new_space_size);
1321 ConfigureInitialOldGenerationSize(); 1321 ConfigureInitialOldGenerationSize();
1322 1322
1323 isolate_->counters()->objs_since_last_young()->Set(0); 1323 isolate_->counters()->objs_since_last_young()->Set(0);
1324 1324
1325 if (collector != SCAVENGER) {
1326 // Callbacks that fire after this point might trigger nested GCs and
1327 // restart incremental marking, the assertion can't be moved down.
1328 DCHECK(incremental_marking()->IsStopped());
1329
1330 // We finished a marking cycle. We can uncommit the marking deque until
1331 // we start marking again.
1332 mark_compact_collector()->marking_deque()->Uninitialize();
1333 mark_compact_collector()->EnsureMarkingDequeIsCommitted(
1334 MarkCompactCollector::kMinMarkingDequeSize);
1335 }
1336
1337 gc_post_processing_depth_++; 1325 gc_post_processing_depth_++;
1338 { 1326 {
1339 AllowHeapAllocation allow_allocation; 1327 AllowHeapAllocation allow_allocation;
1340 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); 1328 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL);
1341 freed_global_handles = 1329 freed_global_handles =
1342 isolate_->global_handles()->PostGarbageCollectionProcessing( 1330 isolate_->global_handles()->PostGarbageCollectionProcessing(
1343 collector, gc_callback_flags); 1331 collector, gc_callback_flags);
1344 } 1332 }
1345 gc_post_processing_depth_--; 1333 gc_post_processing_depth_--;
1346 1334
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 1437
1450 1438
1451 void Heap::MarkCompactEpilogue() { 1439 void Heap::MarkCompactEpilogue() {
1452 gc_state_ = NOT_IN_GC; 1440 gc_state_ = NOT_IN_GC;
1453 1441
1454 isolate_->counters()->objs_since_last_full()->Set(0); 1442 isolate_->counters()->objs_since_last_full()->Set(0);
1455 1443
1456 incremental_marking()->Epilogue(); 1444 incremental_marking()->Epilogue();
1457 1445
1458 PreprocessStackTraces(); 1446 PreprocessStackTraces();
1447
1448 DCHECK(incremental_marking()->IsStopped());
1449
1450 // We finished a marking cycle. We can uncommit the marking deque until
1451 // we start marking again.
1452 mark_compact_collector()->marking_deque()->Uninitialize();
1453 mark_compact_collector()->EnsureMarkingDequeIsCommitted(
1454 MarkCompactCollector::kMinMarkingDequeSize);
1459 } 1455 }
1460 1456
1461 1457
1462 void Heap::MarkCompactPrologue() { 1458 void Heap::MarkCompactPrologue() {
1463 // At any old GC clear the keyed lookup cache to enable collection of unused 1459 // At any old GC clear the keyed lookup cache to enable collection of unused
1464 // maps. 1460 // maps.
1465 isolate_->keyed_lookup_cache()->Clear(); 1461 isolate_->keyed_lookup_cache()->Clear();
1466 isolate_->context_slot_cache()->Clear(); 1462 isolate_->context_slot_cache()->Clear();
1467 isolate_->descriptor_lookup_cache()->Clear(); 1463 isolate_->descriptor_lookup_cache()->Clear();
1468 RegExpResultsCache::Clear(string_split_cache()); 1464 RegExpResultsCache::Clear(string_split_cache());
(...skipping 4937 matching lines...) Expand 10 before | Expand all | Expand 10 after
6406 } 6402 }
6407 6403
6408 6404
6409 // static 6405 // static
6410 int Heap::GetStaticVisitorIdForMap(Map* map) { 6406 int Heap::GetStaticVisitorIdForMap(Map* map) {
6411 return StaticVisitorBase::GetVisitorId(map); 6407 return StaticVisitorBase::GetVisitorId(map);
6412 } 6408 }
6413 6409
6414 } // namespace internal 6410 } // namespace internal
6415 } // namespace v8 6411 } // 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