| 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 void set_tasks(intptr_t val) { | 316 void set_tasks(intptr_t val) { |
| 317 ASSERT(val >= 0); | 317 ASSERT(val >= 0); |
| 318 tasks_ = val; | 318 tasks_ = val; |
| 319 } | 319 } |
| 320 | 320 |
| 321 // Attempt to allocate from bump block rather than normal freelist. | 321 // Attempt to allocate from bump block rather than normal freelist. |
| 322 uword TryAllocateDataBump(intptr_t size, GrowthPolicy growth_policy); | 322 uword TryAllocateDataBump(intptr_t size, GrowthPolicy growth_policy); |
| 323 uword TryAllocateDataBumpLocked(intptr_t size, GrowthPolicy growth_policy); | 323 uword TryAllocateDataBumpLocked(intptr_t size, GrowthPolicy growth_policy); |
| 324 // Prefer small freelist blocks, then chip away at the bump block. | 324 // Prefer small freelist blocks, then chip away at the bump block. |
| 325 uword TryAllocatePromoLocked(intptr_t size, GrowthPolicy growth_policy); | 325 uword TryAllocatePromoLocked(intptr_t size, GrowthPolicy growth_policy); |
| 326 // Allocates memory where every word is guaranteed to be a Smi. Calling this |
| 327 // method after the first garbage collection is inefficient in release mode |
| 328 // and illegal in debug mode. |
| 329 uword TryAllocateSmiInitializedLocked(intptr_t size, |
| 330 GrowthPolicy growth_policy); |
| 326 | 331 |
| 327 // Bump block allocation from generated code. | 332 // Bump block allocation from generated code. |
| 328 uword* TopAddress() { return &bump_top_; } | 333 uword* TopAddress() { return &bump_top_; } |
| 329 uword* EndAddress() { return &bump_end_; } | 334 uword* EndAddress() { return &bump_end_; } |
| 330 | 335 |
| 331 private: | 336 private: |
| 332 // Ids for time and data records in Heap::GCStats. | 337 // Ids for time and data records in Heap::GCStats. |
| 333 enum { | 338 enum { |
| 334 // Time | 339 // Time |
| 335 kMarkObjects = 0, | 340 kMarkObjects = 0, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 friend class ExclusivePageIterator; | 421 friend class ExclusivePageIterator; |
| 417 friend class PageSpaceController; | 422 friend class PageSpaceController; |
| 418 friend class SweeperTask; | 423 friend class SweeperTask; |
| 419 | 424 |
| 420 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 425 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 421 }; | 426 }; |
| 422 | 427 |
| 423 } // namespace dart | 428 } // namespace dart |
| 424 | 429 |
| 425 #endif // VM_PAGES_H_ | 430 #endif // VM_PAGES_H_ |
| OLD | NEW |