| 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/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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 heap_(heap), | 124 heap_(heap), |
| 125 pages_(NULL), | 125 pages_(NULL), |
| 126 pages_tail_(NULL), | 126 pages_tail_(NULL), |
| 127 large_pages_(NULL), | 127 large_pages_(NULL), |
| 128 max_capacity_in_words_(max_capacity_in_words), | 128 max_capacity_in_words_(max_capacity_in_words), |
| 129 capacity_in_words_(0), | 129 capacity_in_words_(0), |
| 130 used_in_words_(0), | 130 used_in_words_(0), |
| 131 sweeping_(false), | 131 sweeping_(false), |
| 132 page_space_controller_(FLAG_heap_growth_space_ratio, | 132 page_space_controller_(FLAG_heap_growth_space_ratio, |
| 133 FLAG_heap_growth_rate, | 133 FLAG_heap_growth_rate, |
| 134 FLAG_heap_growth_time_ratio) { | 134 FLAG_heap_growth_time_ratio), |
| 135 gc_time_micros_(0), |
| 136 collections_(0) { |
| 135 } | 137 } |
| 136 | 138 |
| 137 | 139 |
| 138 PageSpace::~PageSpace() { | 140 PageSpace::~PageSpace() { |
| 139 FreePages(pages_); | 141 FreePages(pages_); |
| 140 FreePages(large_pages_); | 142 FreePages(large_pages_); |
| 141 } | 143 } |
| 142 | 144 |
| 143 | 145 |
| 144 intptr_t PageSpace::LargePageSizeInWordsFor(intptr_t size) { | 146 intptr_t PageSpace::LargePageSizeInWordsFor(intptr_t size) { |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 return 0; | 628 return 0; |
| 627 } else { | 629 } else { |
| 628 ASSERT(total_time >= gc_time); | 630 ASSERT(total_time >= gc_time); |
| 629 int result= static_cast<int>((static_cast<double>(gc_time) / | 631 int result= static_cast<int>((static_cast<double>(gc_time) / |
| 630 static_cast<double>(total_time)) * 100); | 632 static_cast<double>(total_time)) * 100); |
| 631 return result; | 633 return result; |
| 632 } | 634 } |
| 633 } | 635 } |
| 634 | 636 |
| 635 } // namespace dart | 637 } // namespace dart |
| OLD | NEW |