Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: runtime/vm/heap.cc

Issue 1771503002: Ensure that calls to EnableGrowthControl/DisableGrowthControl does not reset the last_usage_ value … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/heap.h ('k') | runtime/vm/pages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698