Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |