Chromium Code Reviews| 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; } | |
|
regis
2013/03/14 23:40:34
That is optimistic :-)
I would actually leave this
hausner
2013/03/15 00:36:32
There is unfortunately code that calls this and bo
| |
| 3756 virtual bool IsResolved() const; | |
|
regis
2013/03/14 23:40:34
I would unconditionally return false.
hausner
2013/03/15 00:36:32
Done.
| |
| 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 3077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6833 | 6876 |
| 6834 | 6877 |
| 6835 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6878 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6836 intptr_t index) { | 6879 intptr_t index) { |
| 6837 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6880 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6838 } | 6881 } |
| 6839 | 6882 |
| 6840 } // namespace dart | 6883 } // namespace dart |
| 6841 | 6884 |
| 6842 #endif // VM_OBJECT_H_ | 6885 #endif // VM_OBJECT_H_ |
| OLD | NEW |