| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_PAGES_H_ | 5 #ifndef VM_PAGES_H_ |
| 6 #define VM_PAGES_H_ | 6 #define VM_PAGES_H_ |
| 7 | 7 |
| 8 #include "vm/freelist.h" | 8 #include "vm/freelist.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 MutexLocker ml(pages_lock_); | 223 MutexLocker ml(pages_lock_); |
| 224 return usage_.capacity_in_words; | 224 return usage_.capacity_in_words; |
| 225 } | 225 } |
| 226 void IncreaseCapacityInWords(intptr_t increase_in_words) { | 226 void IncreaseCapacityInWords(intptr_t increase_in_words) { |
| 227 MutexLocker ml(pages_lock_); | 227 MutexLocker ml(pages_lock_); |
| 228 IncreaseCapacityInWordsLocked(increase_in_words); | 228 IncreaseCapacityInWordsLocked(increase_in_words); |
| 229 } | 229 } |
| 230 void IncreaseCapacityInWordsLocked(intptr_t increase_in_words) { | 230 void IncreaseCapacityInWordsLocked(intptr_t increase_in_words) { |
| 231 DEBUG_ASSERT(pages_lock_->IsOwnedByCurrentThread()); | 231 DEBUG_ASSERT(pages_lock_->IsOwnedByCurrentThread()); |
| 232 usage_.capacity_in_words += increase_in_words; | 232 usage_.capacity_in_words += increase_in_words; |
| 233 UpdateMaxCapacityLocked(); |
| 233 } | 234 } |
| 235 |
| 236 void UpdateMaxCapacityLocked(); |
| 237 |
| 234 intptr_t ExternalInWords() const { | 238 intptr_t ExternalInWords() const { |
| 235 return usage_.external_in_words; | 239 return usage_.external_in_words; |
| 236 } | 240 } |
| 237 SpaceUsage GetCurrentUsage() const { | 241 SpaceUsage GetCurrentUsage() const { |
| 238 MutexLocker ml(pages_lock_); | 242 MutexLocker ml(pages_lock_); |
| 239 return usage_; | 243 return usage_; |
| 240 } | 244 } |
| 241 | 245 |
| 242 bool Contains(uword addr) const; | 246 bool Contains(uword addr) const; |
| 243 bool Contains(uword addr, HeapPage::PageType type) const; | 247 bool Contains(uword addr, HeapPage::PageType type) const; |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 friend class HeapIterationScope; | 447 friend class HeapIterationScope; |
| 444 friend class PageSpaceController; | 448 friend class PageSpaceController; |
| 445 friend class SweeperTask; | 449 friend class SweeperTask; |
| 446 | 450 |
| 447 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 451 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 448 }; | 452 }; |
| 449 | 453 |
| 450 } // namespace dart | 454 } // namespace dart |
| 451 | 455 |
| 452 #endif // VM_PAGES_H_ | 456 #endif // VM_PAGES_H_ |
| OLD | NEW |