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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 new_space_->AddGCTime(delta); | 613 new_space_->AddGCTime(delta); |
614 new_space_->IncrementCollections(); | 614 new_space_->IncrementCollections(); |
615 } else { | 615 } else { |
616 old_space_->AddGCTime(delta); | 616 old_space_->AddGCTime(delta); |
617 old_space_->IncrementCollections(); | 617 old_space_->IncrementCollections(); |
618 } | 618 } |
619 stats_.after_.new_ = new_space_->GetCurrentUsage(); | 619 stats_.after_.new_ = new_space_->GetCurrentUsage(); |
620 stats_.after_.old_ = old_space_->GetCurrentUsage(); | 620 stats_.after_.old_ = old_space_->GetCurrentUsage(); |
621 ASSERT(gc_in_progress_); | 621 ASSERT(gc_in_progress_); |
622 gc_in_progress_ = false; | 622 gc_in_progress_ = false; |
623 if (Service::NeedsEvents()) { | 623 if (Service::NeedsGCEvents()) { |
624 ServiceEvent event(Isolate::Current(), ServiceEvent::kGC); | 624 ServiceEvent event(Isolate::Current(), ServiceEvent::kGC); |
625 event.set_gc_stats(&stats_); | 625 event.set_gc_stats(&stats_); |
626 Service::HandleEvent(&event); | 626 Service::HandleEvent(&event); |
627 } | 627 } |
628 } | 628 } |
629 | 629 |
630 | 630 |
631 void Heap::PrintStats() { | 631 void Heap::PrintStats() { |
632 if (!FLAG_verbose_gc) return; | 632 if (!FLAG_verbose_gc) return; |
633 | 633 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 heap->DisableGrowthControl(); | 701 heap->DisableGrowthControl(); |
702 } | 702 } |
703 | 703 |
704 | 704 |
705 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { | 705 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { |
706 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 706 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
707 heap->SetGrowthControlState(current_growth_controller_state_); | 707 heap->SetGrowthControlState(current_growth_controller_state_); |
708 } | 708 } |
709 | 709 |
710 } // namespace dart | 710 } // namespace dart |
OLD | NEW |