| 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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 static const Smi& smi_illegal_cid() { | 398 static const Smi& smi_illegal_cid() { |
| 399 ASSERT(smi_illegal_cid_ != NULL); | 399 ASSERT(smi_illegal_cid_ != NULL); |
| 400 return *smi_illegal_cid_; | 400 return *smi_illegal_cid_; |
| 401 } | 401 } |
| 402 static const LanguageError& snapshot_writer_error() { | 402 static const LanguageError& snapshot_writer_error() { |
| 403 ASSERT(snapshot_writer_error_ != NULL); | 403 ASSERT(snapshot_writer_error_ != NULL); |
| 404 return *snapshot_writer_error_; | 404 return *snapshot_writer_error_; |
| 405 } | 405 } |
| 406 | 406 |
| 407 static RawClass* class_class() { return class_class_; } | 407 static RawClass* class_class() { return class_class_; } |
| 408 static RawClass* null_class() { return null_class_; } | |
| 409 static RawClass* dynamic_class() { return dynamic_class_; } | 408 static RawClass* dynamic_class() { return dynamic_class_; } |
| 410 static RawClass* void_class() { return void_class_; } | 409 static RawClass* void_class() { return void_class_; } |
| 411 static RawClass* unresolved_class_class() { return unresolved_class_class_; } | 410 static RawClass* unresolved_class_class() { return unresolved_class_class_; } |
| 412 static RawClass* type_arguments_class() { return type_arguments_class_; } | 411 static RawClass* type_arguments_class() { return type_arguments_class_; } |
| 413 static RawClass* instantiated_type_arguments_class() { | 412 static RawClass* instantiated_type_arguments_class() { |
| 414 return instantiated_type_arguments_class_; | 413 return instantiated_type_arguments_class_; |
| 415 } | 414 } |
| 416 static RawClass* patch_class_class() { return patch_class_class_; } | 415 static RawClass* patch_class_class() { return patch_class_class_; } |
| 417 static RawClass* function_class() { return function_class_; } | 416 static RawClass* function_class() { return function_class_; } |
| 418 static RawClass* closure_data_class() { return closure_data_class_; } | 417 static RawClass* closure_data_class() { return closure_data_class_; } |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 545 } |
| 547 | 546 |
| 548 static cpp_vtable handle_vtable_; | 547 static cpp_vtable handle_vtable_; |
| 549 static cpp_vtable builtin_vtables_[kNumPredefinedCids]; | 548 static cpp_vtable builtin_vtables_[kNumPredefinedCids]; |
| 550 | 549 |
| 551 // The static values below are singletons shared between the different | 550 // The static values below are singletons shared between the different |
| 552 // isolates. They are all allocated in the non-GC'd Dart::vm_isolate_. | 551 // isolates. They are all allocated in the non-GC'd Dart::vm_isolate_. |
| 553 static RawObject* null_; | 552 static RawObject* null_; |
| 554 | 553 |
| 555 static RawClass* class_class_; // Class of the Class vm object. | 554 static RawClass* class_class_; // Class of the Class vm object. |
| 556 static RawClass* null_class_; // Class of the null object. | |
| 557 static RawClass* dynamic_class_; // Class of the 'dynamic' type. | 555 static RawClass* dynamic_class_; // Class of the 'dynamic' type. |
| 558 static RawClass* void_class_; // Class of the 'void' type. | 556 static RawClass* void_class_; // Class of the 'void' type. |
| 559 static RawClass* unresolved_class_class_; // Class of UnresolvedClass. | 557 static RawClass* unresolved_class_class_; // Class of UnresolvedClass. |
| 560 // Class of the TypeArguments vm object. | 558 // Class of the TypeArguments vm object. |
| 561 static RawClass* type_arguments_class_; | 559 static RawClass* type_arguments_class_; |
| 562 static RawClass* instantiated_type_arguments_class_; // Class of Inst..ments. | 560 static RawClass* instantiated_type_arguments_class_; // Class of Inst..ments. |
| 563 static RawClass* patch_class_class_; // Class of the PatchClass vm object. | 561 static RawClass* patch_class_class_; // Class of the PatchClass vm object. |
| 564 static RawClass* function_class_; // Class of the Function vm object. | 562 static RawClass* function_class_; // Class of the Function vm object. |
| 565 static RawClass* closure_data_class_; // Class of ClosureData vm obj. | 563 static RawClass* closure_data_class_; // Class of ClosureData vm obj. |
| 566 static RawClass* redirection_data_class_; // Class of RedirectionData vm obj. | 564 static RawClass* redirection_data_class_; // Class of RedirectionData vm obj. |
| (...skipping 3171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3738 // The name of this type's class, i.e. without the type argument names of this | 3736 // The name of this type's class, i.e. without the type argument names of this |
| 3739 // type. | 3737 // type. |
| 3740 RawString* ClassName() const; | 3738 RawString* ClassName() const; |
| 3741 | 3739 |
| 3742 // Check if this type represents the 'dynamic' type. | 3740 // Check if this type represents the 'dynamic' type. |
| 3743 bool IsDynamicType() const { | 3741 bool IsDynamicType() const { |
| 3744 return HasResolvedTypeClass() && (type_class() == Object::dynamic_class()); | 3742 return HasResolvedTypeClass() && (type_class() == Object::dynamic_class()); |
| 3745 } | 3743 } |
| 3746 | 3744 |
| 3747 // Check if this type represents the 'Null' type. | 3745 // Check if this type represents the 'Null' type. |
| 3748 bool IsNullType() const { | 3746 bool IsNullType() const; |
| 3749 return HasResolvedTypeClass() && (type_class() == Object::null_class()); | |
| 3750 } | |
| 3751 | 3747 |
| 3752 // Check if this type represents the 'void' type. | 3748 // Check if this type represents the 'void' type. |
| 3753 bool IsVoidType() const { | 3749 bool IsVoidType() const { |
| 3754 return HasResolvedTypeClass() && (type_class() == Object::void_class()); | 3750 return HasResolvedTypeClass() && (type_class() == Object::void_class()); |
| 3755 } | 3751 } |
| 3756 | 3752 |
| 3757 bool IsObjectType() const { | 3753 bool IsObjectType() const { |
| 3758 return HasResolvedTypeClass() && | 3754 return HasResolvedTypeClass() && |
| 3759 Class::Handle(type_class()).IsObjectClass(); | 3755 Class::Handle(type_class()).IsObjectClass(); |
| 3760 } | 3756 } |
| (...skipping 2286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6047 | 6043 |
| 6048 | 6044 |
| 6049 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6045 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6050 intptr_t index) { | 6046 intptr_t index) { |
| 6051 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6047 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6052 } | 6048 } |
| 6053 | 6049 |
| 6054 } // namespace dart | 6050 } // namespace dart |
| 6055 | 6051 |
| 6056 #endif // VM_OBJECT_H_ | 6052 #endif // VM_OBJECT_H_ |
| OLD | NEW |