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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 void Heap::UpdateGlobalMaxUsed() { | 484 void Heap::UpdateGlobalMaxUsed() { |
485 ASSERT(isolate_ != NULL); | 485 ASSERT(isolate_ != NULL); |
486 // We are accessing the used in words count for both new and old space | 486 // We are accessing the used in words count for both new and old space |
487 // without synchronizing. The value of this metric is approximate. | 487 // without synchronizing. The value of this metric is approximate. |
488 isolate_->GetHeapGlobalUsedMaxMetric()->SetValue( | 488 isolate_->GetHeapGlobalUsedMaxMetric()->SetValue( |
489 (UsedInWords(Heap::kNew) * kWordSize) + | 489 (UsedInWords(Heap::kNew) * kWordSize) + |
490 (UsedInWords(Heap::kOld) * kWordSize)); | 490 (UsedInWords(Heap::kOld) * kWordSize)); |
491 } | 491 } |
492 | 492 |
493 | 493 |
| 494 void Heap::InitGrowthControl() { |
| 495 old_space_.InitGrowthControl(); |
| 496 } |
| 497 |
| 498 |
494 void Heap::SetGrowthControlState(bool state) { | 499 void Heap::SetGrowthControlState(bool state) { |
495 old_space_.SetGrowthControlState(state); | 500 old_space_.SetGrowthControlState(state); |
496 } | 501 } |
497 | 502 |
498 | 503 |
499 bool Heap::GrowthControlState() { | 504 bool Heap::GrowthControlState() { |
500 return old_space_.GrowthControlState(); | 505 return old_space_.GrowthControlState(); |
501 } | 506 } |
502 | 507 |
503 | 508 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); | 841 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); |
837 } | 842 } |
838 | 843 |
839 | 844 |
840 WritableVMIsolateScope::~WritableVMIsolateScope() { | 845 WritableVMIsolateScope::~WritableVMIsolateScope() { |
841 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); | 846 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); |
842 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); | 847 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); |
843 } | 848 } |
844 | 849 |
845 } // namespace dart | 850 } // namespace dart |
OLD | NEW |