| 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 RUNTIME_VM_PAGES_H_ | 5 #ifndef RUNTIME_VM_PAGES_H_ |
| 6 #define RUNTIME_VM_PAGES_H_ | 6 #define RUNTIME_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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 return Utils::RoundUp(sizeof(HeapPage), OS::kMaxPreferredCodeAlignment); | 53 return Utils::RoundUp(sizeof(HeapPage), OS::kMaxPreferredCodeAlignment); |
| 54 } | 54 } |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 void set_object_end(uword val) { | 57 void set_object_end(uword val) { |
| 58 ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset); | 58 ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset); |
| 59 object_end_ = val; | 59 object_end_ = val; |
| 60 } | 60 } |
| 61 | 61 |
| 62 // These return NULL on OOM. | 62 // These return NULL on OOM. |
| 63 static HeapPage* Initialize(VirtualMemory* memory, PageType type); | 63 static HeapPage* Initialize(VirtualMemory* memory, |
| 64 static HeapPage* Allocate(intptr_t size_in_words, PageType type); | 64 PageType type, |
| 65 const char* name); |
| 66 static HeapPage* Allocate(intptr_t size_in_words, |
| 67 PageType type, |
| 68 const char* name); |
| 65 | 69 |
| 66 // Deallocate the virtual memory backing this page. The page pointer to this | 70 // Deallocate the virtual memory backing this page. The page pointer to this |
| 67 // page becomes immediately inaccessible. | 71 // page becomes immediately inaccessible. |
| 68 void Deallocate(); | 72 void Deallocate(); |
| 69 | 73 |
| 70 VirtualMemory* memory_; | 74 VirtualMemory* memory_; |
| 71 HeapPage* next_; | 75 HeapPage* next_; |
| 72 uword object_end_; | 76 uword object_end_; |
| 73 PageType type_; | 77 PageType type_; |
| 74 | 78 |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 friend class HeapIterationScope; | 432 friend class HeapIterationScope; |
| 429 friend class PageSpaceController; | 433 friend class PageSpaceController; |
| 430 friend class SweeperTask; | 434 friend class SweeperTask; |
| 431 | 435 |
| 432 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 436 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 433 }; | 437 }; |
| 434 | 438 |
| 435 } // namespace dart | 439 } // namespace dart |
| 436 | 440 |
| 437 #endif // RUNTIME_VM_PAGES_H_ | 441 #endif // RUNTIME_VM_PAGES_H_ |
| OLD | NEW |