| 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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 new_space_->AddGCTime(delta); | 673 new_space_->AddGCTime(delta); |
| 674 new_space_->IncrementCollections(); | 674 new_space_->IncrementCollections(); |
| 675 } else { | 675 } else { |
| 676 old_space_->AddGCTime(delta); | 676 old_space_->AddGCTime(delta); |
| 677 old_space_->IncrementCollections(); | 677 old_space_->IncrementCollections(); |
| 678 } | 678 } |
| 679 stats_.after_.new_ = new_space_->GetCurrentUsage(); | 679 stats_.after_.new_ = new_space_->GetCurrentUsage(); |
| 680 stats_.after_.old_ = old_space_->GetCurrentUsage(); | 680 stats_.after_.old_ = old_space_->GetCurrentUsage(); |
| 681 ASSERT(gc_in_progress_); | 681 ASSERT(gc_in_progress_); |
| 682 gc_in_progress_ = false; | 682 gc_in_progress_ = false; |
| 683 if (Service::NeedsGCEvents()) { | 683 if (Service::gc_stream.enabled()) { |
| 684 ServiceEvent event(Isolate::Current(), ServiceEvent::kGC); | 684 ServiceEvent event(Isolate::Current(), ServiceEvent::kGC); |
| 685 event.set_gc_stats(&stats_); | 685 event.set_gc_stats(&stats_); |
| 686 Service::HandleEvent(&event); | 686 Service::HandleEvent(&event); |
| 687 } | 687 } |
| 688 } | 688 } |
| 689 | 689 |
| 690 | 690 |
| 691 void Heap::PrintStats() { | 691 void Heap::PrintStats() { |
| 692 if (!FLAG_verbose_gc) return; | 692 if (!FLAG_verbose_gc) return; |
| 693 | 693 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 heap->DisableGrowthControl(); | 761 heap->DisableGrowthControl(); |
| 762 } | 762 } |
| 763 | 763 |
| 764 | 764 |
| 765 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { | 765 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { |
| 766 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 766 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
| 767 heap->SetGrowthControlState(current_growth_controller_state_); | 767 heap->SetGrowthControlState(current_growth_controller_state_); |
| 768 } | 768 } |
| 769 | 769 |
| 770 } // namespace dart | 770 } // namespace dart |
| OLD | NEW |