| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 static intptr_t ObjectStartOffset() { | 62 static intptr_t ObjectStartOffset() { |
| 63 return Utils::RoundUp(sizeof(HeapPage), OS::kMaxPreferredCodeAlignment); | 63 return Utils::RoundUp(sizeof(HeapPage), OS::kMaxPreferredCodeAlignment); |
| 64 } | 64 } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 void set_object_end(uword val) { | 67 void set_object_end(uword val) { |
| 68 ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset); | 68 ASSERT((val & kObjectAlignmentMask) == kOldObjectAlignmentOffset); |
| 69 object_end_ = val; | 69 object_end_ = val; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // These return NULL on OOM. |
| 72 static HeapPage* Initialize(VirtualMemory* memory, PageType type); | 73 static HeapPage* Initialize(VirtualMemory* memory, PageType type); |
| 73 static HeapPage* Allocate(intptr_t size_in_words, PageType type); | 74 static HeapPage* Allocate(intptr_t size_in_words, PageType type); |
| 74 | 75 |
| 75 // Deallocate the virtual memory backing this page. The page pointer to this | 76 // Deallocate the virtual memory backing this page. The page pointer to this |
| 76 // page becomes immediately inaccessible. | 77 // page becomes immediately inaccessible. |
| 77 void Deallocate(); | 78 void Deallocate(); |
| 78 | 79 |
| 79 VirtualMemory* memory_; | 80 VirtualMemory* memory_; |
| 80 HeapPage* next_; | 81 HeapPage* next_; |
| 81 uword object_end_; | 82 uword object_end_; |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 friend class ExclusiveLargePageIterator; | 433 friend class ExclusiveLargePageIterator; |
| 433 friend class PageSpaceController; | 434 friend class PageSpaceController; |
| 434 friend class SweeperTask; | 435 friend class SweeperTask; |
| 435 | 436 |
| 436 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 437 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 437 }; | 438 }; |
| 438 | 439 |
| 439 } // namespace dart | 440 } // namespace dart |
| 440 | 441 |
| 441 #endif // VM_PAGES_H_ | 442 #endif // VM_PAGES_H_ |
| OLD | NEW |