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

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

Issue 227683004: Reset growth control state after isolate initialization. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/pages.h ('k') | no next file » | 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/pages.h" 5 #include "vm/pages.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/compiler_stats.h" 8 #include "vm/compiler_stats.h"
9 #include "vm/gc_marker.h" 9 #include "vm/gc_marker.h"
10 #include "vm/gc_sweeper.h" 10 #include "vm/gc_sweeper.h"
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 if (heap_growth_ratio_ == 100) { 656 if (heap_growth_ratio_ == 100) {
657 return false; 657 return false;
658 } 658 }
659 intptr_t capacity_increase_in_words = 659 intptr_t capacity_increase_in_words =
660 after.capacity_in_words - last_usage_.capacity_in_words; 660 after.capacity_in_words - last_usage_.capacity_in_words;
661 ASSERT(capacity_increase_in_words >= 0); 661 ASSERT(capacity_increase_in_words >= 0);
662 capacity_increase_in_words = 662 capacity_increase_in_words =
663 Utils::RoundUp(capacity_increase_in_words, PageSpace::kPageSizeInWords); 663 Utils::RoundUp(capacity_increase_in_words, PageSpace::kPageSizeInWords);
664 intptr_t capacity_increase_in_pages = 664 intptr_t capacity_increase_in_pages =
665 capacity_increase_in_words / PageSpace::kPageSizeInWords; 665 capacity_increase_in_words / PageSpace::kPageSizeInWords;
666 return capacity_increase_in_pages >= grow_heap_; 666 return capacity_increase_in_pages > grow_heap_;
667 } 667 }
668 668
669 669
670 void PageSpaceController::EvaluateGarbageCollection( 670 void PageSpaceController::EvaluateGarbageCollection(
671 SpaceUsage before, SpaceUsage after, int64_t start, int64_t end) { 671 SpaceUsage before, SpaceUsage after, int64_t start, int64_t end) {
672 // TODO(iposva): Reevaluate the growth policies. 672 // TODO(iposva): Reevaluate the growth policies.
673 intptr_t before_total_in_words = 673 intptr_t before_total_in_words =
674 before.used_in_words + before.external_in_words; 674 before.used_in_words + before.external_in_words;
675 intptr_t after_total_in_words = 675 intptr_t after_total_in_words =
676 after.used_in_words + after.external_in_words; 676 after.used_in_words + after.external_in_words;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 return 0; 747 return 0;
748 } else { 748 } else {
749 ASSERT(total_time >= gc_time); 749 ASSERT(total_time >= gc_time);
750 int result= static_cast<int>((static_cast<double>(gc_time) / 750 int result= static_cast<int>((static_cast<double>(gc_time) /
751 static_cast<double>(total_time)) * 100); 751 static_cast<double>(total_time)) * 100);
752 return result; 752 return result;
753 } 753 }
754 } 754 }
755 755
756 } // namespace dart 756 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/pages.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698