// During boot the free_space_map is created, and afterwards we may need
// to write it into the free list nodes that were already created.
- virtual void RepairFreeListsAfterBoot();
+ void RepairFreeListsAfterBoot();
// Prepares for a mark-compact GC.
- virtual void PrepareForMarkCompact();
+ void PrepareForMarkCompact();
// Current capacity without growing (Size() + Available()).
intptr_t Capacity() { return accounting_stats_.Capacity(); }
// Normal allocation information.
AllocationInfo allocation_info_;
- // Bytes of each page that cannot be allocated. Possibly non-zero
- // for pages in spaces with only fixed-size objects. Always zero
- // for pages in spaces with variable sized objects (those pages are
- // padded with free-list nodes).
- int page_extra_;
-
bool was_swept_conservatively_;
// The first page to be swept when the lazy sweeper advances. Is set
AllocationSpace id,
Executability executable)
: PagedSpace(heap, max_capacity, id, executable) {
- page_extra_ = 0;
- }
-
- // The limit of allocation for a page in this space.
- virtual Address PageAllocationLimit(Page* page) {
- return page->area_end();
}
public:
// -----------------------------------------------------------------------------
-// Old space for objects of a fixed size
-
-class FixedSpace : public PagedSpace {
- public:
- FixedSpace(Heap* heap,
- intptr_t max_capacity,
- AllocationSpace id,
- int object_size_in_bytes)
- : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE),
- object_size_in_bytes_(object_size_in_bytes) {
- page_extra_ = Page::kNonCodeObjectAreaSize % object_size_in_bytes;
- }
-
- // The limit of allocation for a page in this space.
- virtual Address PageAllocationLimit(Page* page) {
- return page->area_end() - page_extra_;
- }
-
- int object_size_in_bytes() { return object_size_in_bytes_; }
-
- // Prepares for a mark-compact GC.
- virtual void PrepareForMarkCompact();
-
- private:
- // The size of objects in this space.
- int object_size_in_bytes_;
-};
-
-
-// -----------------------------------------------------------------------------
// Old space for all map objects
-class MapSpace : public FixedSpace {
+class MapSpace : public PagedSpace {
public:
// Creates a map space object with a maximum capacity.
MapSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id)
- : FixedSpace(heap, max_capacity, id, Map::kSize),
+ : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE),
max_map_space_pages_(kMaxMapPageIndex - 1) {
}
// -----------------------------------------------------------------------------
// Old space for simple property cell objects
-class CellSpace : public FixedSpace {
+class CellSpace : public PagedSpace {
public:
// Creates a property cell space object with a maximum capacity.
CellSpace(Heap* heap, intptr_t max_capacity, AllocationSpace id)
- : FixedSpace(heap, max_capacity, id, Cell::kSize)
- {}
+ : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE) {
+ }
virtual int RoundSizeDownToObjectAlignment(int size) {
if (IsPowerOf2(Cell::kSize)) {
// -----------------------------------------------------------------------------
// Old space for all global object property cell objects
-class PropertyCellSpace : public FixedSpace {
+class PropertyCellSpace : public PagedSpace {
public:
// Creates a property cell space object with a maximum capacity.
PropertyCellSpace(Heap* heap, intptr_t max_capacity,
AllocationSpace id)
- : FixedSpace(heap, max_capacity, id, PropertyCell::kSize)
- {}
+ : PagedSpace(heap, max_capacity, id, NOT_EXECUTABLE) {
+ }
virtual int RoundSizeDownToObjectAlignment(int size) {
if (IsPowerOf2(PropertyCell::kSize)) {