| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 void set_tasks(intptr_t val) { | 338 void set_tasks(intptr_t val) { |
| 339 ASSERT(val >= 0); | 339 ASSERT(val >= 0); |
| 340 tasks_ = val; | 340 tasks_ = val; |
| 341 } | 341 } |
| 342 | 342 |
| 343 // Attempt to allocate from bump block rather than normal freelist. | 343 // Attempt to allocate from bump block rather than normal freelist. |
| 344 uword TryAllocateDataBump(intptr_t size, GrowthPolicy growth_policy); | 344 uword TryAllocateDataBump(intptr_t size, GrowthPolicy growth_policy); |
| 345 uword TryAllocateDataBumpLocked(intptr_t size, GrowthPolicy growth_policy); | 345 uword TryAllocateDataBumpLocked(intptr_t size, GrowthPolicy growth_policy); |
| 346 // Prefer small freelist blocks, then chip away at the bump block. | 346 // Prefer small freelist blocks, then chip away at the bump block. |
| 347 uword TryAllocatePromoLocked(intptr_t size, GrowthPolicy growth_policy); | 347 uword TryAllocatePromoLocked(intptr_t size, GrowthPolicy growth_policy); |
| 348 // Allocates memory where every word is guaranteed to be a Smi. Calling this | |
| 349 // method after the first garbage collection is inefficient in release mode | |
| 350 // and illegal in debug mode. | |
| 351 uword TryAllocateSmiInitializedLocked(intptr_t size, | |
| 352 GrowthPolicy growth_policy); | |
| 353 | 348 |
| 354 // Bump block allocation from generated code. | 349 // Bump block allocation from generated code. |
| 355 uword* TopAddress() { return &bump_top_; } | 350 uword* TopAddress() { return &bump_top_; } |
| 356 uword* EndAddress() { return &bump_end_; } | 351 uword* EndAddress() { return &bump_end_; } |
| 357 static intptr_t top_offset() { return OFFSET_OF(PageSpace, bump_top_); } | 352 static intptr_t top_offset() { return OFFSET_OF(PageSpace, bump_top_); } |
| 358 static intptr_t end_offset() { return OFFSET_OF(PageSpace, bump_end_); } | 353 static intptr_t end_offset() { return OFFSET_OF(PageSpace, bump_end_); } |
| 359 | 354 |
| 360 void SetupExternalPage(void* pointer, uword size, bool is_executable); | 355 void SetupExternalPage(void* pointer, uword size, bool is_executable); |
| 361 | 356 |
| 362 private: | 357 private: |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 friend class HeapIterationScope; | 454 friend class HeapIterationScope; |
| 460 friend class PageSpaceController; | 455 friend class PageSpaceController; |
| 461 friend class SweeperTask; | 456 friend class SweeperTask; |
| 462 | 457 |
| 463 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 458 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 464 }; | 459 }; |
| 465 | 460 |
| 466 } // namespace dart | 461 } // namespace dart |
| 467 | 462 |
| 468 #endif // VM_PAGES_H_ | 463 #endif // VM_PAGES_H_ |
| OLD | NEW |