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

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: Fix mh's incaution 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) { 1325 // Callbacks that fire after this point might trigger nested GCs and
1326 // Callbacks that fire after this point might trigger nested GCs and 1326 // restart incremental marking, the assertion can't be moved down.
1327 // restart incremental marking, the assertion can't be moved down. 1327 if (collector != SCAVENGER) DCHECK(incremental_marking()->IsStopped());
Hannes Payer (out of office) 2016/03/21 11:55:22 Please move this check also into the MarkCompactEp
Marcel Hlopko 2016/03/21 12:37:42 Done.
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 1328
1337 gc_post_processing_depth_++; 1329 gc_post_processing_depth_++;
1338 { 1330 {
1339 AllowHeapAllocation allow_allocation; 1331 AllowHeapAllocation allow_allocation;
1340 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); 1332 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL);
1341 freed_global_handles = 1333 freed_global_handles =
1342 isolate_->global_handles()->PostGarbageCollectionProcessing( 1334 isolate_->global_handles()->PostGarbageCollectionProcessing(
1343 collector, gc_callback_flags); 1335 collector, gc_callback_flags);
1344 } 1336 }
1345 gc_post_processing_depth_--; 1337 gc_post_processing_depth_--;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1449 1441
1450 1442
1451 void Heap::MarkCompactEpilogue() { 1443 void Heap::MarkCompactEpilogue() {
1452 gc_state_ = NOT_IN_GC; 1444 gc_state_ = NOT_IN_GC;
1453 1445
1454 isolate_->counters()->objs_since_last_full()->Set(0); 1446 isolate_->counters()->objs_since_last_full()->Set(0);
1455 1447
1456 incremental_marking()->Epilogue(); 1448 incremental_marking()->Epilogue();
1457 1449
1458 PreprocessStackTraces(); 1450 PreprocessStackTraces();
1451
1452 // We finished a marking cycle. We can uncommit the marking deque until
1453 // we start marking again.
1454 mark_compact_collector()->marking_deque()->Uninitialize();
1455 mark_compact_collector()->EnsureMarkingDequeIsCommitted(
1456 MarkCompactCollector::kMinMarkingDequeSize);
1459 } 1457 }
1460 1458
1461 1459
1462 void Heap::MarkCompactPrologue() { 1460 void Heap::MarkCompactPrologue() {
1463 // At any old GC clear the keyed lookup cache to enable collection of unused 1461 // At any old GC clear the keyed lookup cache to enable collection of unused
1464 // maps. 1462 // maps.
1465 isolate_->keyed_lookup_cache()->Clear(); 1463 isolate_->keyed_lookup_cache()->Clear();
1466 isolate_->context_slot_cache()->Clear(); 1464 isolate_->context_slot_cache()->Clear();
1467 isolate_->descriptor_lookup_cache()->Clear(); 1465 isolate_->descriptor_lookup_cache()->Clear();
1468 RegExpResultsCache::Clear(string_split_cache()); 1466 RegExpResultsCache::Clear(string_split_cache());
(...skipping 4937 matching lines...) Expand 10 before | Expand all | Expand 10 after
6406 } 6404 }
6407 6405
6408 6406
6409 // static 6407 // static
6410 int Heap::GetStaticVisitorIdForMap(Map* map) { 6408 int Heap::GetStaticVisitorIdForMap(Map* map) {
6411 return StaticVisitorBase::GetVisitorId(map); 6409 return StaticVisitorBase::GetVisitorId(map);
6412 } 6410 }
6413 6411
6414 } // namespace internal 6412 } // namespace internal
6415 } // namespace v8 6413 } // 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