| 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 VM_FREELIST_H_ | 5 #ifndef VM_FREELIST_H_ |
| 6 #define VM_FREELIST_H_ | 6 #define 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 25 matching lines...) Expand all Loading... |
| 36 static FreeListElement* AsElement(uword addr, intptr_t size); | 36 static FreeListElement* AsElement(uword addr, intptr_t size); |
| 37 | 37 |
| 38 static void InitOnce(); | 38 static void InitOnce(); |
| 39 | 39 |
| 40 // Used to allocate class for free list elements in Object::InitOnce. | 40 // Used to allocate class for free list elements in Object::InitOnce. |
| 41 class FakeInstance { | 41 class FakeInstance { |
| 42 public: | 42 public: |
| 43 FakeInstance() { } | 43 FakeInstance() { } |
| 44 static cpp_vtable vtable() { return 0; } | 44 static cpp_vtable vtable() { return 0; } |
| 45 static intptr_t InstanceSize() { return 0; } | 45 static intptr_t InstanceSize() { return 0; } |
| 46 static const ObjectKind kInstanceKind = kFreeListElement; | 46 static const ClassId kClassId = kFreeListElement; |
| 47 static bool IsInstance() { return true; } | 47 static bool IsInstance() { return true; } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 DISALLOW_ALLOCATION(); | 50 DISALLOW_ALLOCATION(); |
| 51 DISALLOW_COPY_AND_ASSIGN(FakeInstance); | 51 DISALLOW_COPY_AND_ASSIGN(FakeInstance); |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 // This layout mirrors the layout of RawObject. | 55 // This layout mirrors the layout of RawObject. |
| 56 uword tags_; | 56 uword tags_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 BitSet<kNumLists> free_map_; | 96 BitSet<kNumLists> free_map_; |
| 97 | 97 |
| 98 FreeListElement* free_lists_[kNumLists + 1]; | 98 FreeListElement* free_lists_[kNumLists + 1]; |
| 99 | 99 |
| 100 DISALLOW_COPY_AND_ASSIGN(FreeList); | 100 DISALLOW_COPY_AND_ASSIGN(FreeList); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace dart | 103 } // namespace dart |
| 104 | 104 |
| 105 #endif // VM_FREELIST_H_ | 105 #endif // VM_FREELIST_H_ |
| OLD | NEW |