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 3725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3736 } | 3736 } |
3737 void set_is_being_checked(bool value) const; | 3737 void set_is_being_checked(bool value) const; |
3738 | 3738 |
3739 static RawBoundedType* New(); | 3739 static RawBoundedType* New(); |
3740 | 3740 |
3741 FINAL_HEAP_OBJECT_IMPLEMENTATION(BoundedType, AbstractType); | 3741 FINAL_HEAP_OBJECT_IMPLEMENTATION(BoundedType, AbstractType); |
3742 friend class Class; | 3742 friend class Class; |
3743 }; | 3743 }; |
3744 | 3744 |
3745 | 3745 |
| 3746 // A MixinAppType represents a mixin application clause, e.g. |
| 3747 // "S<T> with M<U, N>". The class finalizer builds the type |
| 3748 // parameters and arguments at finalization time. |
| 3749 // MixinType objects do not survive finalization, so they do not |
| 3750 // need to be written to and read from snapshots. |
| 3751 class MixinAppType : public AbstractType { |
| 3752 public: |
| 3753 // MixinAppType objects are replaced with their actual finalized type. |
| 3754 virtual bool IsFinalized() const { return false; } |
| 3755 virtual bool IsMalformed() const { return false; } |
| 3756 virtual bool IsResolved() const { return false; } |
| 3757 virtual bool HasResolvedTypeClass() const { return false; } |
| 3758 virtual RawString* Name() const; |
| 3759 |
| 3760 virtual intptr_t token_pos() const { |
| 3761 return AbstractType::Handle(super_type()).token_pos(); |
| 3762 } |
| 3763 |
| 3764 virtual RawAbstractTypeArguments* arguments() const { |
| 3765 return AbstractTypeArguments::null(); |
| 3766 } |
| 3767 |
| 3768 RawAbstractType* super_type() const { return raw_ptr()->super_type_; } |
| 3769 RawArray* mixin_types() const { return raw_ptr()->mixin_types_; } |
| 3770 |
| 3771 static intptr_t InstanceSize() { |
| 3772 return RoundedAllocationSize(sizeof(RawMixinAppType)); |
| 3773 } |
| 3774 |
| 3775 static RawMixinAppType* New(const AbstractType& super_type, |
| 3776 const Array& mixin_types); |
| 3777 |
| 3778 private: |
| 3779 void set_super_type(const AbstractType& value) const; |
| 3780 void set_mixin_types(const Array& value) const; |
| 3781 |
| 3782 static RawMixinAppType* New(); |
| 3783 |
| 3784 FINAL_HEAP_OBJECT_IMPLEMENTATION(MixinAppType, AbstractType); |
| 3785 friend class Class; |
| 3786 }; |
| 3787 |
| 3788 |
3746 class Number : public Instance { | 3789 class Number : public Instance { |
3747 public: | 3790 public: |
3748 // TODO(iposva): Fill in a useful Number interface. | 3791 // TODO(iposva): Fill in a useful Number interface. |
3749 virtual bool IsZero() const { | 3792 virtual bool IsZero() const { |
3750 // Number is an abstract class. | 3793 // Number is an abstract class. |
3751 UNREACHABLE(); | 3794 UNREACHABLE(); |
3752 return false; | 3795 return false; |
3753 } | 3796 } |
3754 virtual bool IsNegative() const { | 3797 virtual bool IsNegative() const { |
3755 // Number is an abstract class. | 3798 // Number is an abstract class. |
(...skipping 3089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6845 | 6888 |
6846 | 6889 |
6847 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6890 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6848 intptr_t index) { | 6891 intptr_t index) { |
6849 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6892 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6850 } | 6893 } |
6851 | 6894 |
6852 } // namespace dart | 6895 } // namespace dart |
6853 | 6896 |
6854 #endif // VM_OBJECT_H_ | 6897 #endif // VM_OBJECT_H_ |
OLD | NEW |