| 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" |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 RawString* ident_; // Name of the unresolved identifier. | 268 RawString* ident_; // Name of the unresolved identifier. |
| 269 RawClass* factory_signature_class_; // Expected type parameters for factory. | 269 RawClass* factory_signature_class_; // Expected type parameters for factory. |
| 270 RawObject** to() { | 270 RawObject** to() { |
| 271 return reinterpret_cast<RawObject**>(&ptr()->factory_signature_class_); | 271 return reinterpret_cast<RawObject**>(&ptr()->factory_signature_class_); |
| 272 } | 272 } |
| 273 intptr_t token_index_; | 273 intptr_t token_index_; |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 | 276 |
| 277 class RawAbstractType : public RawObject { | 277 class RawAbstractType : public RawObject { |
| 278 protected: |
| 279 enum TypeState { |
| 280 kAllocated, // Initial state. |
| 281 kBeingFinalized, // In the process of being finalized. |
| 282 kFinalized, // Type ready for use. |
| 283 }; |
| 284 |
| 285 private: |
| 278 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractType); | 286 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractType); |
| 279 | 287 |
| 280 friend class ObjectStore; | 288 friend class ObjectStore; |
| 281 }; | 289 }; |
| 282 | 290 |
| 283 | 291 |
| 284 class RawType : public RawAbstractType { | 292 class RawType : public RawAbstractType { |
| 285 private: | 293 private: |
| 286 enum TypeState { | |
| 287 kAllocated, // Initial state. | |
| 288 kBeingFinalized, // In the process of being finalized. | |
| 289 kFinalized, // Type ready for use. | |
| 290 }; | |
| 291 | |
| 292 RAW_HEAP_OBJECT_IMPLEMENTATION(Type); | 294 RAW_HEAP_OBJECT_IMPLEMENTATION(Type); |
| 293 | 295 |
| 294 RawObject** from() { | 296 RawObject** from() { |
| 295 return reinterpret_cast<RawObject**>(&ptr()->type_class_); | 297 return reinterpret_cast<RawObject**>(&ptr()->type_class_); |
| 296 } | 298 } |
| 297 RawObject* type_class_; // Either resolved class or unresolved class. | 299 RawObject* type_class_; // Either resolved class or unresolved class. |
| 298 RawAbstractTypeArguments* arguments_; | 300 RawAbstractTypeArguments* arguments_; |
| 299 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->arguments_); } | 301 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->arguments_); } |
| 300 int8_t type_state_; | 302 int8_t type_state_; |
| 301 }; | 303 }; |
| 302 | 304 |
| 303 | 305 |
| 304 class RawTypeParameter : public RawAbstractType { | 306 class RawTypeParameter : public RawAbstractType { |
| 305 private: | 307 private: |
| 306 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter); | 308 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeParameter); |
| 307 | 309 |
| 308 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 310 RawObject** from() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
| 309 RawString* name_; | 311 RawString* name_; |
| 310 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->name_); } | 312 RawObject** to() { return reinterpret_cast<RawObject**>(&ptr()->name_); } |
| 311 intptr_t index_; | 313 intptr_t index_; |
| 314 int8_t type_state_; |
| 312 }; | 315 }; |
| 313 | 316 |
| 314 | 317 |
| 315 class RawInstantiatedType : public RawAbstractType { | 318 class RawInstantiatedType : public RawAbstractType { |
| 316 private: | 319 private: |
| 317 RAW_HEAP_OBJECT_IMPLEMENTATION(InstantiatedType); | 320 RAW_HEAP_OBJECT_IMPLEMENTATION(InstantiatedType); |
| 318 | 321 |
| 319 RawObject** from() { | 322 RawObject** from() { |
| 320 return reinterpret_cast<RawObject**>(&ptr()->uninstantiated_type_); | 323 return reinterpret_cast<RawObject**>(&ptr()->uninstantiated_type_); |
| 321 } | 324 } |
| 322 RawAbstractType* uninstantiated_type_; | 325 RawAbstractType* uninstantiated_type_; |
| 323 RawAbstractTypeArguments* instantiator_type_arguments_; | 326 RawAbstractTypeArguments* instantiator_type_arguments_; |
| 324 RawObject** to() { | 327 RawObject** to() { |
| 325 return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_); | 328 return reinterpret_cast<RawObject**>(&ptr()->instantiator_type_arguments_); |
| 326 } | 329 } |
| 327 }; | 330 }; |
| 328 | 331 |
| 329 | 332 |
| 330 class RawAbstractTypeArguments : public RawObject { | 333 class RawAbstractTypeArguments : public RawObject { |
| 334 private: |
| 331 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractTypeArguments); | 335 RAW_HEAP_OBJECT_IMPLEMENTATION(AbstractTypeArguments); |
| 332 }; | 336 }; |
| 333 | 337 |
| 334 | 338 |
| 335 class RawTypeArguments : public RawAbstractTypeArguments { | 339 class RawTypeArguments : public RawAbstractTypeArguments { |
| 336 private: | 340 private: |
| 337 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeArguments); | 341 RAW_HEAP_OBJECT_IMPLEMENTATION(TypeArguments); |
| 338 | 342 |
| 339 RawObject** from() { | 343 RawObject** from() { |
| 340 return reinterpret_cast<RawObject**>(&ptr()->length_); | 344 return reinterpret_cast<RawObject**>(&ptr()->length_); |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 intptr_t type_; // Uninitialized, simple or complex. | 862 intptr_t type_; // Uninitialized, simple or complex. |
| 859 intptr_t flags_; // Represents global/local, case insensitive, multiline. | 863 intptr_t flags_; // Represents global/local, case insensitive, multiline. |
| 860 | 864 |
| 861 // Variable length data follows here. | 865 // Variable length data follows here. |
| 862 uint8_t data_[0]; | 866 uint8_t data_[0]; |
| 863 }; | 867 }; |
| 864 | 868 |
| 865 } // namespace dart | 869 } // namespace dart |
| 866 | 870 |
| 867 #endif // VM_RAW_OBJECT_H_ | 871 #endif // VM_RAW_OBJECT_H_ |
| OLD | NEW |