| 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_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 | 731 |
| 732 // Check if this type represents the 'num' interface. | 732 // Check if this type represents the 'num' interface. |
| 733 bool IsNumberInterface() const; | 733 bool IsNumberInterface() const; |
| 734 | 734 |
| 735 // Check if this type represents the 'String' interface. | 735 // Check if this type represents the 'String' interface. |
| 736 bool IsStringInterface() const; | 736 bool IsStringInterface() const; |
| 737 | 737 |
| 738 // Check if this type represents the 'Function' interface. | 738 // Check if this type represents the 'Function' interface. |
| 739 bool IsFunctionInterface() const; | 739 bool IsFunctionInterface() const; |
| 740 | 740 |
| 741 // Check if this type represents the 'List' interface. |
| 742 bool IsListInterface() const; |
| 743 |
| 741 // Check if this type is an interface type. | 744 // Check if this type is an interface type. |
| 742 bool IsInterfaceType() const { | 745 bool IsInterfaceType() const { |
| 743 if (!HasResolvedTypeClass()) { | 746 if (!HasResolvedTypeClass()) { |
| 744 return false; | 747 return false; |
| 745 } | 748 } |
| 746 const Class& cls = Class::Handle(type_class()); | 749 const Class& cls = Class::Handle(type_class()); |
| 747 return !cls.IsNull() && cls.is_interface(); | 750 return !cls.IsNull() && cls.is_interface(); |
| 748 } | 751 } |
| 749 | 752 |
| 750 // Check the "more specific than" relationship. | 753 // Check the "more specific than" relationship. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 | 786 |
| 784 // The 'num' interface type. | 787 // The 'num' interface type. |
| 785 static RawType* NumberInterface(); | 788 static RawType* NumberInterface(); |
| 786 | 789 |
| 787 // The 'String' interface type. | 790 // The 'String' interface type. |
| 788 static RawType* StringInterface(); | 791 static RawType* StringInterface(); |
| 789 | 792 |
| 790 // The 'Function' interface type. | 793 // The 'Function' interface type. |
| 791 static RawType* FunctionInterface(); | 794 static RawType* FunctionInterface(); |
| 792 | 795 |
| 796 // The 'List' interface type. |
| 797 static RawType* ListInterface(); |
| 798 |
| 793 // The least specific valid raw type of the given class. | 799 // The least specific valid raw type of the given class. |
| 794 // For example, type A<Dynamic> would be returned for class A<T>, and type | 800 // For example, type A<Dynamic> would be returned for class A<T>, and type |
| 795 // B<Dynamic, A<Dynamic>> would be returned for B<U, V extends A>. | 801 // B<Dynamic, A<Dynamic>> would be returned for B<U, V extends A>. |
| 796 static RawType* NewRawType(const Class& type_class); | 802 static RawType* NewRawType(const Class& type_class); |
| 797 | 803 |
| 798 // The finalized type of the given non-parameterized class. | 804 // The finalized type of the given non-parameterized class. |
| 799 static RawType* NewNonParameterizedType(const Class& type_class); | 805 static RawType* NewNonParameterizedType(const Class& type_class); |
| 800 | 806 |
| 801 static RawType* NewParameterizedType(const Object& type_class, | 807 static RawType* NewParameterizedType(const Object& type_class, |
| 802 const TypeArguments& arguments); | 808 const TypeArguments& arguments); |
| (...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2994 } | 3000 } |
| 2995 | 3001 |
| 2996 | 3002 |
| 2997 void Context::SetAt(intptr_t index, const Instance& value) const { | 3003 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 2998 StorePointer(InstanceAddr(index), value.raw()); | 3004 StorePointer(InstanceAddr(index), value.raw()); |
| 2999 } | 3005 } |
| 3000 | 3006 |
| 3001 } // namespace dart | 3007 } // namespace dart |
| 3002 | 3008 |
| 3003 #endif // VM_OBJECT_H_ | 3009 #endif // VM_OBJECT_H_ |
| OLD | NEW |