Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 332d1ed92c42f4e3f75f759cc9d2d7ce7f76ecd4..d13e210fe29bf317792b36a2a05706ac75ba38b6 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -4448,8 +4448,10 @@ class ByteArray: public FixedArrayBase { |
| }; |
| -// FreeSpace represents fixed sized areas of the heap that are not currently in |
| -// use. Used by the heap and GC. |
| +// FreeSpace are free blocks in the heap. They look like heap objects |
|
Hannes Payer (out of office)
2015/01/27 08:05:49
... are fixed size memory blocks...
Yang
2015/01/27 08:49:49
Done.
|
| +// (are heap object tagged and have a map) so that the heap remains iterable. |
| +// They have a size and a next pointer. The next pointer is the raw address |
| +// of the next FreeSpace object (or NULL) in the free list. |
|
Hannes Payer (out of office)
2015/01/27 08:05:49
Used by the heap and GC.
Yang
2015/01/27 08:49:49
Done.
|
| class FreeSpace: public HeapObject { |
| public: |
| // [size]: size of the free space including the header. |
| @@ -4461,7 +4463,12 @@ class FreeSpace: public HeapObject { |
| inline int Size() { return size(); } |
| - DECLARE_CAST(FreeSpace) |
| + // Accessors for the next field. |
| + inline FreeSpace* next(); |
| + inline FreeSpace** next_address(); |
| + inline void set_next(FreeSpace* next); |
| + |
| + inline static FreeSpace* cast(HeapObject* obj); |
| // Dispatched behavior. |
| DECLARE_PRINTER(FreeSpace) |
| @@ -4470,9 +4477,7 @@ class FreeSpace: public HeapObject { |
| // Layout description. |
| // Size is smi tagged when it is stored. |
| static const int kSizeOffset = HeapObject::kHeaderSize; |
| - static const int kHeaderSize = kSizeOffset + kPointerSize; |
| - |
| - static const int kAlignedSize = OBJECT_POINTER_ALIGN(kHeaderSize); |
| + static const int kNextOffset = POINTER_SIZE_ALIGN(kSizeOffset + kPointerSize); |
| private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(FreeSpace); |