| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 new_space_->AddGCTime(delta); | 632 new_space_->AddGCTime(delta); |
| 633 new_space_->IncrementCollections(); | 633 new_space_->IncrementCollections(); |
| 634 } else { | 634 } else { |
| 635 old_space_->AddGCTime(delta); | 635 old_space_->AddGCTime(delta); |
| 636 old_space_->IncrementCollections(); | 636 old_space_->IncrementCollections(); |
| 637 } | 637 } |
| 638 stats_.after_.new_ = new_space_->GetCurrentUsage(); | 638 stats_.after_.new_ = new_space_->GetCurrentUsage(); |
| 639 stats_.after_.old_ = old_space_->GetCurrentUsage(); | 639 stats_.after_.old_ = old_space_->GetCurrentUsage(); |
| 640 ASSERT(gc_in_progress_); | 640 ASSERT(gc_in_progress_); |
| 641 gc_in_progress_ = false; | 641 gc_in_progress_ = false; |
| 642 if (Service::NeedsGCEvents()) { | 642 if (Service::NeedsEvents()) { |
| 643 GCEvent event(stats_); | 643 GCEvent event(stats_); |
| 644 Service::HandleGCEvent(&event); | 644 Service::HandleGCEvent(&event); |
| 645 } | 645 } |
| 646 } | 646 } |
| 647 | 647 |
| 648 | 648 |
| 649 void Heap::PrintStats() { | 649 void Heap::PrintStats() { |
| 650 if (!FLAG_verbose_gc) return; | 650 if (!FLAG_verbose_gc) return; |
| 651 | 651 |
| 652 if ((FLAG_verbose_gc_hdr != 0) && | 652 if ((FLAG_verbose_gc_hdr != 0) && |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 734 heap->DisableGrowthControl(); | 734 heap->DisableGrowthControl(); |
| 735 } | 735 } |
| 736 | 736 |
| 737 | 737 |
| 738 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { | 738 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { |
| 739 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 739 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
| 740 heap->SetGrowthControlState(current_growth_controller_state_); | 740 heap->SetGrowthControlState(current_growth_controller_state_); |
| 741 } | 741 } |
| 742 | 742 |
| 743 } // namespace dart | 743 } // namespace dart |
| OLD | NEW |