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 uword tags_; | 59 uint32_t tags_; |
| 60 #if defined(HASH_IN_OBJECT_HEADER) |
| 61 uint32_t hash_; |
| 62 #endif |
60 FreeListElement* next_; | 63 FreeListElement* next_; |
61 | 64 |
62 // Returns the address of the embedded size. | 65 // Returns the address of the embedded size. |
63 intptr_t* SizeAddress() const { | 66 intptr_t* SizeAddress() const { |
64 uword addr = reinterpret_cast<uword>(&next_) + kWordSize; | 67 uword addr = reinterpret_cast<uword>(&next_) + kWordSize; |
65 return reinterpret_cast<intptr_t*>(addr); | 68 return reinterpret_cast<intptr_t*>(addr); |
66 } | 69 } |
67 | 70 |
68 // FreeListElements cannot be allocated. Instead references to them are | 71 // FreeListElements cannot be allocated. Instead references to them are |
69 // created using the AsElement factory method. | 72 // created using the AsElement factory method. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 | 128 |
126 // The largest available small size in bytes, or negative if there is none. | 129 // The largest available small size in bytes, or negative if there is none. |
127 intptr_t last_free_small_size_; | 130 intptr_t last_free_small_size_; |
128 | 131 |
129 DISALLOW_COPY_AND_ASSIGN(FreeList); | 132 DISALLOW_COPY_AND_ASSIGN(FreeList); |
130 }; | 133 }; |
131 | 134 |
132 } // namespace dart | 135 } // namespace dart |
133 | 136 |
134 #endif // RUNTIME_VM_FREELIST_H_ | 137 #endif // RUNTIME_VM_FREELIST_H_ |
OLD | NEW |