| 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 24 matching lines...) Expand all Loading... |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 HeapPage* next() const { return next_; } | 37 HeapPage* next() const { return next_; } |
| 38 void set_next(HeapPage* next) { next_ = next; } | 38 void set_next(HeapPage* next) { next_ = next; } |
| 39 | 39 |
| 40 bool Contains(uword addr) { | 40 bool Contains(uword addr) { |
| 41 return memory_->Contains(addr); | 41 return memory_->Contains(addr); |
| 42 } | 42 } |
| 43 | 43 |
| 44 uword object_start() const { | 44 uword object_start() const { |
| 45 return (reinterpret_cast<uword>(this) + ObjectStartOffset()); | 45 return memory_->start() + ObjectStartOffset(); |
| 46 } | 46 } |
| 47 uword object_end() const { | 47 uword object_end() const { |
| 48 return object_end_; | 48 return object_end_; |
| 49 } | 49 } |
| 50 | 50 |
| 51 PageType type() const { | 51 PageType type() const { |
| 52 return executable_ ? kExecutable : kData; | 52 return executable_ ? kExecutable : kData; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void VisitObjects(ObjectVisitor* visitor) const; | 55 void VisitObjects(ObjectVisitor* visitor) const; |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 // and illegal in debug mode. | 333 // and illegal in debug mode. |
| 334 uword TryAllocateSmiInitializedLocked(intptr_t size, | 334 uword TryAllocateSmiInitializedLocked(intptr_t size, |
| 335 GrowthPolicy growth_policy); | 335 GrowthPolicy growth_policy); |
| 336 | 336 |
| 337 // Bump block allocation from generated code. | 337 // Bump block allocation from generated code. |
| 338 uword* TopAddress() { return &bump_top_; } | 338 uword* TopAddress() { return &bump_top_; } |
| 339 uword* EndAddress() { return &bump_end_; } | 339 uword* EndAddress() { return &bump_end_; } |
| 340 static intptr_t top_offset() { return OFFSET_OF(PageSpace, bump_top_); } | 340 static intptr_t top_offset() { return OFFSET_OF(PageSpace, bump_top_); } |
| 341 static intptr_t end_offset() { return OFFSET_OF(PageSpace, bump_end_); } | 341 static intptr_t end_offset() { return OFFSET_OF(PageSpace, bump_end_); } |
| 342 | 342 |
| 343 void SetupInstructionsSnapshotPage(void* pointer, uword size); |
| 344 |
| 343 private: | 345 private: |
| 344 // Ids for time and data records in Heap::GCStats. | 346 // Ids for time and data records in Heap::GCStats. |
| 345 enum { | 347 enum { |
| 346 // Time | 348 // Time |
| 347 kMarkObjects = 0, | 349 kMarkObjects = 0, |
| 348 kResetFreeLists = 1, | 350 kResetFreeLists = 1, |
| 349 kSweepPages = 2, | 351 kSweepPages = 2, |
| 350 kSweepLargePages = 3, | 352 kSweepLargePages = 3, |
| 351 // Data | 353 // Data |
| 352 kGarbageRatio = 0, | 354 kGarbageRatio = 0, |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 friend class HeapIterationScope; | 442 friend class HeapIterationScope; |
| 441 friend class PageSpaceController; | 443 friend class PageSpaceController; |
| 442 friend class SweeperTask; | 444 friend class SweeperTask; |
| 443 | 445 |
| 444 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 446 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 445 }; | 447 }; |
| 446 | 448 |
| 447 } // namespace dart | 449 } // namespace dart |
| 448 | 450 |
| 449 #endif // VM_PAGES_H_ | 451 #endif // VM_PAGES_H_ |
| OLD | NEW |