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(); | |
409 EndOldSpaceGC(); | 408 EndOldSpaceGC(); |
410 } | 409 } |
411 } | 410 } |
412 | 411 |
413 | 412 |
414 void Heap::CollectGarbage(Space space, | 413 void Heap::CollectGarbage(Space space, |
415 ApiCallbacks api_callbacks, | 414 ApiCallbacks api_callbacks, |
416 GCReason reason) { | 415 GCReason reason) { |
417 Thread* thread = Thread::Current(); | 416 Thread* thread = Thread::Current(); |
418 switch (space) { | 417 switch (space) { |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 Dart::vm_isolate()->heap()->WriteProtect(false); | 847 Dart::vm_isolate()->heap()->WriteProtect(false); |
849 } | 848 } |
850 | 849 |
851 | 850 |
852 WritableVMIsolateScope::~WritableVMIsolateScope() { | 851 WritableVMIsolateScope::~WritableVMIsolateScope() { |
853 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 852 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
854 Dart::vm_isolate()->heap()->WriteProtect(true); | 853 Dart::vm_isolate()->heap()->WriteProtect(true); |
855 } | 854 } |
856 | 855 |
857 } // namespace dart | 856 } // namespace dart |
OLD | NEW |