| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_RAW_OBJECT_H_ | 5 #ifndef VM_RAW_OBJECT_H_ |
| 6 #define VM_RAW_OBJECT_H_ | 6 #define VM_RAW_OBJECT_H_ |
| 7 | 7 |
| 8 #include "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/snapshot.h" | 10 #include "vm/snapshot.h" |
| 11 | 11 |
| 12 #include "include/dart_api.h" | 12 #include "include/dart_api.h" |
| 13 | 13 |
| 14 namespace dart { | 14 namespace dart { |
| 15 | 15 |
| 16 // Macrobatics to define the Object hierarchy of VM implementation classes. | 16 // Macrobatics to define the Object hierarchy of VM implementation classes. |
| 17 #define CLASS_LIST_NO_OBJECT(V) \ | 17 #define CLASS_LIST_NO_OBJECT(V) \ |
| 18 V(Class) \ | 18 V(Class) \ |
| 19 V(UnresolvedClass) \ |
| 19 V(Type) \ | 20 V(Type) \ |
| 20 V(ParameterizedType) \ | 21 V(ParameterizedType) \ |
| 21 V(TypeParameter) \ | 22 V(TypeParameter) \ |
| 22 V(InstantiatedType) \ | 23 V(InstantiatedType) \ |
| 23 V(TypeArguments) \ | 24 V(TypeArguments) \ |
| 24 V(TypeArray) \ | 25 V(TypeArray) \ |
| 25 V(InstantiatedTypeArguments) \ | 26 V(InstantiatedTypeArguments) \ |
| 26 V(Function) \ | 27 V(Function) \ |
| 27 V(Field) \ | 28 V(Field) \ |
| 28 V(TokenStream) \ | 29 V(TokenStream) \ |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 intptr_t num_native_fields_; // Number of native fields in class. | 216 intptr_t num_native_fields_; // Number of native fields in class. |
| 216 int8_t class_state_; // Of type ClassState. | 217 int8_t class_state_; // Of type ClassState. |
| 217 bool is_const_; | 218 bool is_const_; |
| 218 bool is_interface_; | 219 bool is_interface_; |
| 219 | 220 |
| 220 friend class Object; | 221 friend class Object; |
| 221 friend class RawInstance; | 222 friend class RawInstance; |
| 222 }; | 223 }; |
| 223 | 224 |
| 224 | 225 |
| 226 class RawUnresolvedClass : public RawObject { |
| 227 RAW_HEAP_OBJECT_IMPLEMENTATION(UnresolvedClass); |
| 228 |
| 229 RawObject** from() { |
| 230 return reinterpret_cast<RawObject**>(&ptr()->qualifier_); |
| 231 } |
| 232 RawString* qualifier_; // Qualifier for the identifier. |
| 233 RawString* ident_; // name of the unresolved identifier. |
| 234 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->ident_); } |
| 235 intptr_t token_index_; |
| 236 }; |
| 237 |
| 238 |
| 225 class RawType : public RawObject { | 239 class RawType : public RawObject { |
| 226 RAW_HEAP_OBJECT_IMPLEMENTATION(Type); | 240 RAW_HEAP_OBJECT_IMPLEMENTATION(Type); |
| 227 | 241 |
| 228 friend class ObjectStore; | 242 friend class ObjectStore; |
| 229 }; | 243 }; |
| 230 | 244 |
| 231 | 245 |
| 232 class RawParameterizedType : public RawType { | 246 class RawParameterizedType : public RawType { |
| 233 private: | 247 private: |
| 234 enum TypeState { | 248 enum TypeState { |
| 235 kAllocated, // Initial state. | 249 kAllocated, // Initial state. |
| 236 kBeingFinalized, // In the process of being finalized. | 250 kBeingFinalized, // In the process of being finalized. |
| 237 kFinalized, // Type ready for use. | 251 kFinalized, // Type ready for use. |
| 238 }; | 252 }; |
| 239 | 253 |
| 240 RAW_HEAP_OBJECT_IMPLEMENTATION(ParameterizedType); | 254 RAW_HEAP_OBJECT_IMPLEMENTATION(ParameterizedType); |
| 241 | 255 |
| 242 RawObject** from() { | 256 RawObject** from() { |
| 243 return reinterpret_cast<RawObject**>(&ptr()->type_class_); | 257 return reinterpret_cast<RawObject**>(&ptr()->type_class_); |
| 244 } | 258 } |
| 245 RawObject* type_class_; // Either resolved class or class name. | 259 RawObject* type_class_; // Either resolved class or unresolved class. |
| 246 RawTypeArguments* arguments_; | 260 RawTypeArguments* arguments_; |
| 247 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->arguments_); } | 261 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->arguments_); } |
| 248 int8_t type_state_; | 262 int8_t type_state_; |
| 249 }; | 263 }; |
| 250 | 264 |
| 251 | 265 |
| 252 class RawTypeParameter : public RawType { | 266 class RawTypeParameter : public RawType { |
| 253 private: | 267 private: |
| 254 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter); | 268 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter); |
| 255 | 269 |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 intptr_t type_; // Uninitialized, simple or complex. | 753 intptr_t type_; // Uninitialized, simple or complex. |
| 740 intptr_t flags_; // Represents global/local, case insensitive, multiline. | 754 intptr_t flags_; // Represents global/local, case insensitive, multiline. |
| 741 | 755 |
| 742 // Variable length data follows here. | 756 // Variable length data follows here. |
| 743 uint8_t data_[0]; | 757 uint8_t data_[0]; |
| 744 }; | 758 }; |
| 745 | 759 |
| 746 } // namespace dart | 760 } // namespace dart |
| 747 | 761 |
| 748 #endif // VM_RAW_OBJECT_H_ | 762 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |