| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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_FREELIST_H_ | 5 #ifndef RUNTIME_VM_FREELIST_H_ |
| 6 #define RUNTIME_VM_FREELIST_H_ | 6 #define RUNTIME_VM_FREELIST_H_ |
| 7 | 7 |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/allocation.h" | 9 #include "vm/allocation.h" |
| 10 #include "vm/bit_set.h" | 10 #include "vm/bit_set.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 static const ClassId kClassId = kFreeListElement; | 49 static const ClassId kClassId = kFreeListElement; |
| 50 static bool IsInstance() { return true; } | 50 static bool IsInstance() { return true; } |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 DISALLOW_ALLOCATION(); | 53 DISALLOW_ALLOCATION(); |
| 54 DISALLOW_COPY_AND_ASSIGN(FakeInstance); | 54 DISALLOW_COPY_AND_ASSIGN(FakeInstance); |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 // This layout mirrors the layout of RawObject. | 58 // This layout mirrors the layout of RawObject. |
| 59 uint32_t tags_; | 59 uword tags_; |
| 60 #if defined(HASH_IN_OBJECT_HEADER) | |
| 61 uint32_t hash_; | |
| 62 #endif | |
| 63 FreeListElement* next_; | 60 FreeListElement* next_; |
| 64 | 61 |
| 65 // Returns the address of the embedded size. | 62 // Returns the address of the embedded size. |
| 66 intptr_t* SizeAddress() const { | 63 intptr_t* SizeAddress() const { |
| 67 uword addr = reinterpret_cast<uword>(&next_) + kWordSize; | 64 uword addr = reinterpret_cast<uword>(&next_) + kWordSize; |
| 68 return reinterpret_cast<intptr_t*>(addr); | 65 return reinterpret_cast<intptr_t*>(addr); |
| 69 } | 66 } |
| 70 | 67 |
| 71 // FreeListElements cannot be allocated. Instead references to them are | 68 // FreeListElements cannot be allocated. Instead references to them are |
| 72 // created using the AsElement factory method. | 69 // created using the AsElement factory method. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 125 |
| 129 // The largest available small size in bytes, or negative if there is none. | 126 // The largest available small size in bytes, or negative if there is none. |
| 130 intptr_t last_free_small_size_; | 127 intptr_t last_free_small_size_; |
| 131 | 128 |
| 132 DISALLOW_COPY_AND_ASSIGN(FreeList); | 129 DISALLOW_COPY_AND_ASSIGN(FreeList); |
| 133 }; | 130 }; |
| 134 | 131 |
| 135 } // namespace dart | 132 } // namespace dart |
| 136 | 133 |
| 137 #endif // RUNTIME_VM_FREELIST_H_ | 134 #endif // RUNTIME_VM_FREELIST_H_ |
| OLD | NEW |