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_RAW_OBJECT_H_ | 5 #ifndef RUNTIME_VM_RAW_OBJECT_H_ |
6 #define RUNTIME_VM_RAW_OBJECT_H_ | 6 #define RUNTIME_VM_RAW_OBJECT_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "vm/atomic.h" | 9 #include "vm/atomic.h" |
10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 class Isolate; | 143 class Isolate; |
144 #define DEFINE_FORWARD_DECLARATION(clazz) class Raw##clazz; | 144 #define DEFINE_FORWARD_DECLARATION(clazz) class Raw##clazz; |
145 CLASS_LIST(DEFINE_FORWARD_DECLARATION) | 145 CLASS_LIST(DEFINE_FORWARD_DECLARATION) |
146 #undef DEFINE_FORWARD_DECLARATION | 146 #undef DEFINE_FORWARD_DECLARATION |
147 | 147 |
148 | 148 |
149 enum ClassId { | 149 enum ClassId { |
150 // Illegal class id. | 150 // Illegal class id. |
151 kIllegalCid = 0, | 151 kIllegalCid = 0, |
152 | 152 |
153 // A sentinel used by the vm service's heap snapshots. | |
Cutch
2016/11/28 18:11:12
used by ... to represent a stack frame.
rmacnak
2016/11/28 22:57:56
Done.
| |
154 kStackCid = 1, | |
155 | |
153 // The following entries describes classes for pseudo-objects in the heap | 156 // The following entries describes classes for pseudo-objects in the heap |
154 // that should never be reachable from live objects. Free list elements | 157 // that should never be reachable from live objects. Free list elements |
155 // maintain the free list for old space, and forwarding corpses are used to | 158 // maintain the free list for old space, and forwarding corpses are used to |
156 // implement one-way become. | 159 // implement one-way become. |
157 kFreeListElement, | 160 kFreeListElement, |
158 kForwardingCorpse, | 161 kForwardingCorpse, |
159 | 162 |
160 // List of Ids for predefined classes. | 163 // List of Ids for predefined classes. |
161 #define DEFINE_OBJECT_KIND(clazz) k##clazz##Cid, | 164 #define DEFINE_OBJECT_KIND(clazz) k##clazz##Cid, |
162 CLASS_LIST(DEFINE_OBJECT_KIND) | 165 CLASS_LIST(DEFINE_OBJECT_KIND) |
163 #undef DEFINE_OBJECT_KIND | 166 #undef DEFINE_OBJECT_KIND |
164 | 167 |
165 #define DEFINE_OBJECT_KIND(clazz) kTypedData##clazz##Cid, | 168 #define DEFINE_OBJECT_KIND(clazz) kTypedData##clazz##Cid, |
166 CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND) | 169 CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND) |
167 #undef DEFINE_OBJECT_KIND | 170 #undef DEFINE_OBJECT_KIND |
168 | 171 |
169 #define DEFINE_OBJECT_KIND(clazz) kTypedData##clazz##ViewCid, | 172 #define DEFINE_OBJECT_KIND(clazz) kTypedData##clazz##ViewCid, |
170 CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND) | 173 CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND) |
171 #undef DEFINE_OBJECT_KIND | 174 #undef DEFINE_OBJECT_KIND |
172 | 175 |
173 kByteDataViewCid, | 176 kByteDataViewCid, |
174 | 177 |
175 #define DEFINE_OBJECT_KIND(clazz) kExternalTypedData##clazz##Cid, | 178 #define DEFINE_OBJECT_KIND(clazz) kExternalTypedData##clazz##Cid, |
176 CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND) | 179 CLASS_LIST_TYPED_DATA(DEFINE_OBJECT_KIND) |
177 #undef DEFINE_OBJECT_KIND | 180 #undef DEFINE_OBJECT_KIND |
178 | 181 |
179 kByteBufferCid, | 182 kByteBufferCid, |
180 | 183 |
181 // The following entries do not describe a predefined class, but instead | 184 // The following entries do not describe a predefined class, but instead |
182 // are class indexes for pre-allocated instance (Null, dynamic and Void). | 185 // are class indexes for pre-allocated instances (Null, dynamic and Void). |
183 kNullCid, | 186 kNullCid, |
184 kDynamicCid, | 187 kDynamicCid, |
185 kVoidCid, | 188 kVoidCid, |
186 | 189 |
187 kNumPredefinedCids, | 190 kNumPredefinedCids, |
188 }; | 191 }; |
189 | 192 |
190 enum ObjectAlignment { | 193 enum ObjectAlignment { |
191 // Alignment offsets are used to determine object age. | 194 // Alignment offsets are used to determine object age. |
192 kNewObjectAlignmentOffset = kWordSize, | 195 kNewObjectAlignmentOffset = kWordSize, |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
611 friend class SnapshotWriter; | 614 friend class SnapshotWriter; |
612 friend class String; | 615 friend class String; |
613 friend class Type; // GetClassId | 616 friend class Type; // GetClassId |
614 friend class TypedData; | 617 friend class TypedData; |
615 friend class TypedDataView; | 618 friend class TypedDataView; |
616 friend class WeakProperty; // StorePointer | 619 friend class WeakProperty; // StorePointer |
617 friend class Instance; // StorePointer | 620 friend class Instance; // StorePointer |
618 friend class StackFrame; // GetCodeObject assertion. | 621 friend class StackFrame; // GetCodeObject assertion. |
619 friend class CodeLookupTableBuilder; // profiler | 622 friend class CodeLookupTableBuilder; // profiler |
620 friend class NativeEntry; // GetClassId | 623 friend class NativeEntry; // GetClassId |
624 friend class WritePointerVisitor; // GetClassId | |
621 friend class Simulator; | 625 friend class Simulator; |
622 friend class SimulatorHelpers; | 626 friend class SimulatorHelpers; |
623 friend class ObjectLocator; | 627 friend class ObjectLocator; |
624 friend class InstanceMorpher; // GetClassId | 628 friend class InstanceMorpher; // GetClassId |
625 friend class VerifyCanonicalVisitor; | 629 friend class VerifyCanonicalVisitor; |
626 | 630 |
627 DISALLOW_ALLOCATION(); | 631 DISALLOW_ALLOCATION(); |
628 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); | 632 DISALLOW_IMPLICIT_CONSTRUCTORS(RawObject); |
629 }; | 633 }; |
630 | 634 |
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2376 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == | 2380 COMPILE_ASSERT(kExternalTypedDataInt8ArrayCid == |
2377 kTypedDataInt8ArrayViewCid + 15); | 2381 kTypedDataInt8ArrayViewCid + 15); |
2378 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); | 2382 COMPILE_ASSERT(kByteBufferCid == kExternalTypedDataInt8ArrayCid + 14); |
2379 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); | 2383 COMPILE_ASSERT(kNullCid == kByteBufferCid + 1); |
2380 return (kNullCid - kTypedDataInt8ArrayCid); | 2384 return (kNullCid - kTypedDataInt8ArrayCid); |
2381 } | 2385 } |
2382 | 2386 |
2383 } // namespace dart | 2387 } // namespace dart |
2384 | 2388 |
2385 #endif // RUNTIME_VM_RAW_OBJECT_H_ | 2389 #endif // RUNTIME_VM_RAW_OBJECT_H_ |
OLD | NEW |