| 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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 } | 771 } |
| 772 set_type_arguments_field_offset_in_words(value); | 772 set_type_arguments_field_offset_in_words(value); |
| 773 } | 773 } |
| 774 void set_type_arguments_field_offset_in_words(intptr_t value) const { | 774 void set_type_arguments_field_offset_in_words(intptr_t value) const { |
| 775 raw_ptr()->type_arguments_field_offset_in_words_ = value; | 775 raw_ptr()->type_arguments_field_offset_in_words_ = value; |
| 776 } | 776 } |
| 777 static intptr_t type_arguments_field_offset_in_words_offset() { | 777 static intptr_t type_arguments_field_offset_in_words_offset() { |
| 778 return OFFSET_OF(RawClass, type_arguments_field_offset_in_words_); | 778 return OFFSET_OF(RawClass, type_arguments_field_offset_in_words_); |
| 779 } | 779 } |
| 780 | 780 |
| 781 RawType* CanonicalType() const { |
| 782 if ((NumTypeArguments() == 0) && !IsSignatureClass()) { |
| 783 return reinterpret_cast<RawType*>(raw_ptr()->canonical_types_); |
| 784 } |
| 785 return reinterpret_cast<RawType*>(Object::null()); |
| 786 } |
| 787 |
| 781 // The super type of this class, Object type if not explicitly specified. | 788 // The super type of this class, Object type if not explicitly specified. |
| 782 // Note that the super type may be bounded, as in this example: | 789 // Note that the super type may be bounded, as in this example: |
| 783 // class C<T> extends S<T> { }; class S<T extends num> { }; | 790 // class C<T> extends S<T> { }; class S<T extends num> { }; |
| 784 RawAbstractType* super_type() const { return raw_ptr()->super_type_; } | 791 RawAbstractType* super_type() const { return raw_ptr()->super_type_; } |
| 785 void set_super_type(const AbstractType& value) const; | 792 void set_super_type(const AbstractType& value) const; |
| 786 static intptr_t super_type_offset() { | 793 static intptr_t super_type_offset() { |
| 787 return OFFSET_OF(RawClass, super_type_); | 794 return OFFSET_OF(RawClass, super_type_); |
| 788 } | 795 } |
| 789 | 796 |
| 790 // Asserts that the class of the super type has been resolved. | 797 // Asserts that the class of the super type has been resolved. |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1077 class MixinAppAliasBit : public BitField<bool, kMixinAppAliasBit, 1> {}; | 1084 class MixinAppAliasBit : public BitField<bool, kMixinAppAliasBit, 1> {}; |
| 1078 class MixinTypeAppliedBit : public BitField<bool, kMixinTypeAppliedBit, 1> {}; | 1085 class MixinTypeAppliedBit : public BitField<bool, kMixinTypeAppliedBit, 1> {}; |
| 1079 | 1086 |
| 1080 void set_name(const String& value) const; | 1087 void set_name(const String& value) const; |
| 1081 void set_signature_function(const Function& value) const; | 1088 void set_signature_function(const Function& value) const; |
| 1082 void set_signature_type(const AbstractType& value) const; | 1089 void set_signature_type(const AbstractType& value) const; |
| 1083 void set_state_bits(intptr_t bits) const; | 1090 void set_state_bits(intptr_t bits) const; |
| 1084 | 1091 |
| 1085 void set_constants(const Array& value) const; | 1092 void set_constants(const Array& value) const; |
| 1086 | 1093 |
| 1087 void set_canonical_types(const Array& value) const; | 1094 void set_canonical_types(const Object& value) const; |
| 1088 RawArray* canonical_types() const; | 1095 RawObject* canonical_types() const; |
| 1089 | 1096 |
| 1090 RawArray* invocation_dispatcher_cache() const; | 1097 RawArray* invocation_dispatcher_cache() const; |
| 1091 void set_invocation_dispatcher_cache(const Array& cache) const; | 1098 void set_invocation_dispatcher_cache(const Array& cache) const; |
| 1092 RawFunction* CreateInvocationDispatcher(const String& target_name, | 1099 RawFunction* CreateInvocationDispatcher(const String& target_name, |
| 1093 const Array& args_desc, | 1100 const Array& args_desc, |
| 1094 RawFunction::Kind kind) const; | 1101 RawFunction::Kind kind) const; |
| 1095 | 1102 |
| 1096 void CalculateFieldOffsets() const; | 1103 void CalculateFieldOffsets() const; |
| 1097 | 1104 |
| 1098 // Initial value for the cached number of type arguments. | 1105 // Initial value for the cached number of type arguments. |
| (...skipping 5447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6546 | 6553 |
| 6547 | 6554 |
| 6548 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6555 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6549 intptr_t index) { | 6556 intptr_t index) { |
| 6550 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6557 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6551 } | 6558 } |
| 6552 | 6559 |
| 6553 } // namespace dart | 6560 } // namespace dart |
| 6554 | 6561 |
| 6555 #endif // VM_OBJECT_H_ | 6562 #endif // VM_OBJECT_H_ |
| OLD | NEW |