| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 RecordBeforeGC(kOld, reason); | 398 RecordBeforeGC(kOld, reason); |
| 399 VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId); | 399 VMTagScope tagScope(thread, VMTag::kGCOldSpaceTagId); |
| 400 TIMELINE_FUNCTION_GC_DURATION(thread, "CollectOldGeneration"); | 400 TIMELINE_FUNCTION_GC_DURATION(thread, "CollectOldGeneration"); |
| 401 NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kOld)); | 401 NOT_IN_PRODUCT(UpdateClassHeapStatsBeforeGC(kOld)); |
| 402 old_space_.MarkSweep(invoke_api_callbacks); | 402 old_space_.MarkSweep(invoke_api_callbacks); |
| 403 RecordAfterGC(kOld); | 403 RecordAfterGC(kOld); |
| 404 PrintStats(); | 404 PrintStats(); |
| 405 NOT_IN_PRODUCT(PrintStatsToTimeline(&tds)); | 405 NOT_IN_PRODUCT(PrintStatsToTimeline(&tds)); |
| 406 // Some Code objects may have been collected so invalidate handler cache. | 406 // Some Code objects may have been collected so invalidate handler cache. |
| 407 thread->isolate()->handler_info_cache()->Clear(); | 407 thread->isolate()->handler_info_cache()->Clear(); |
| 408 thread->isolate()->catch_entry_state_cache()->Clear(); |
| 408 EndOldSpaceGC(); | 409 EndOldSpaceGC(); |
| 409 } | 410 } |
| 410 } | 411 } |
| 411 | 412 |
| 412 | 413 |
| 413 void Heap::CollectGarbage(Space space, | 414 void Heap::CollectGarbage(Space space, |
| 414 ApiCallbacks api_callbacks, | 415 ApiCallbacks api_callbacks, |
| 415 GCReason reason) { | 416 GCReason reason) { |
| 416 Thread* thread = Thread::Current(); | 417 Thread* thread = Thread::Current(); |
| 417 switch (space) { | 418 switch (space) { |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 Dart::vm_isolate()->heap()->WriteProtect(false); | 848 Dart::vm_isolate()->heap()->WriteProtect(false); |
| 848 } | 849 } |
| 849 | 850 |
| 850 | 851 |
| 851 WritableVMIsolateScope::~WritableVMIsolateScope() { | 852 WritableVMIsolateScope::~WritableVMIsolateScope() { |
| 852 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 853 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
| 853 Dart::vm_isolate()->heap()->WriteProtect(true); | 854 Dart::vm_isolate()->heap()->WriteProtect(true); |
| 854 } | 855 } |
| 855 | 856 |
| 856 } // namespace dart | 857 } // namespace dart |
| OLD | NEW |