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

Side by Side Diff: runtime/vm/heap.cc

Issue 2930943002: Debug garbage collector does not correctly remove cross-gen garbage (Closed)
Patch Set: Rewrites Evacuate() to use one Scavenge() Created 3 years, 6 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 | runtime/vm/heap_test.cc » ('j') | runtime/vm/scavenger.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kOldSpace); 437 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kOldSpace);
438 } else { 438 } else {
439 ASSERT(space == kNew); 439 ASSERT(space == kNew);
440 CollectNewSpaceGarbage(thread, kInvokeApiCallbacks, kNewSpace); 440 CollectNewSpaceGarbage(thread, kInvokeApiCallbacks, kNewSpace);
441 } 441 }
442 } 442 }
443 443
444 444
445 void Heap::CollectAllGarbage() { 445 void Heap::CollectAllGarbage() {
446 Thread* thread = Thread::Current(); 446 Thread* thread = Thread::Current();
447 CollectNewSpaceGarbage(thread, kInvokeApiCallbacks, kFull); 447 new_space_.Evacuate();
rmacnak 2017/06/22 21:59:33 Add a comment here that we evacuate new space to d
danunez 2017/06/22 22:07:47 Done.
448 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kFull); 448 CollectOldSpaceGarbage(thread, kInvokeApiCallbacks, kFull);
449 } 449 }
450 450
451 451
452 void Heap::WaitForSweeperTasks(Thread* thread) { 452 void Heap::WaitForSweeperTasks(Thread* thread) {
453 MonitorLocker ml(old_space_.tasks_lock()); 453 MonitorLocker ml(old_space_.tasks_lock());
454 while (old_space_.tasks() > 0) { 454 while (old_space_.tasks() > 0) {
455 ml.WaitWithSafepointCheck(thread); 455 ml.WaitWithSafepointCheck(thread);
456 } 456 }
457 } 457 }
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 Dart::vm_isolate()->heap()->WriteProtect(false); 865 Dart::vm_isolate()->heap()->WriteProtect(false);
866 } 866 }
867 867
868 868
869 WritableVMIsolateScope::~WritableVMIsolateScope() { 869 WritableVMIsolateScope::~WritableVMIsolateScope() {
870 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); 870 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
871 Dart::vm_isolate()->heap()->WriteProtect(true); 871 Dart::vm_isolate()->heap()->WriteProtect(true);
872 } 872 }
873 873
874 } // namespace dart 874 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/heap_test.cc » ('j') | runtime/vm/scavenger.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698