| 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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 // Check if this type represents the 'void' type. | 858 // Check if this type represents the 'void' type. |
| 859 bool IsVoidType() const { | 859 bool IsVoidType() const { |
| 860 return HasResolvedTypeClass() && (type_class() == Object::void_class()); | 860 return HasResolvedTypeClass() && (type_class() == Object::void_class()); |
| 861 } | 861 } |
| 862 | 862 |
| 863 bool IsObjectType() const { | 863 bool IsObjectType() const { |
| 864 return HasResolvedTypeClass() && | 864 return HasResolvedTypeClass() && |
| 865 Class::Handle(type_class()).IsObjectClass(); | 865 Class::Handle(type_class()).IsObjectClass(); |
| 866 } | 866 } |
| 867 | 867 |
| 868 // Check if this type represents the 'bool' interface. | 868 // Check if this type represents the 'bool' type. |
| 869 bool IsBoolInterface() const; | 869 bool IsBoolType() const; |
| 870 | 870 |
| 871 // Check if this type represents the 'int' interface. | 871 // Check if this type represents the 'int' interface. |
| 872 bool IsIntInterface() const; | 872 bool IsIntInterface() const; |
| 873 | 873 |
| 874 // Check if this type represents the 'double' interface. | 874 // Check if this type represents the 'double' interface. |
| 875 bool IsDoubleInterface() const; | 875 bool IsDoubleInterface() const; |
| 876 | 876 |
| 877 // Check if this type represents the 'num' type. | 877 // Check if this type represents the 'num' type. |
| 878 bool IsNumberType() const; | 878 bool IsNumberType() const; |
| 879 | 879 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 | 976 |
| 977 // The 'Dynamic' type. | 977 // The 'Dynamic' type. |
| 978 static RawType* DynamicType(); | 978 static RawType* DynamicType(); |
| 979 | 979 |
| 980 // The 'void' type. | 980 // The 'void' type. |
| 981 static RawType* VoidType(); | 981 static RawType* VoidType(); |
| 982 | 982 |
| 983 // The 'Object' type. | 983 // The 'Object' type. |
| 984 static RawType* ObjectType(); | 984 static RawType* ObjectType(); |
| 985 | 985 |
| 986 // The 'bool' interface type. | 986 // The 'bool' type. |
| 987 static RawType* BoolInterface(); | 987 static RawType* BoolType(); |
| 988 | 988 |
| 989 // The 'int' interface type. | 989 // The 'int' interface type. |
| 990 static RawType* IntInterface(); | 990 static RawType* IntInterface(); |
| 991 | 991 |
| 992 // The 'Smi' type. | 992 // The 'Smi' type. |
| 993 static RawType* SmiType(); | 993 static RawType* SmiType(); |
| 994 | 994 |
| 995 // The 'Mint' type. | 995 // The 'Mint' type. |
| 996 static RawType* MintType(); | 996 static RawType* MintType(); |
| 997 | 997 |
| (...skipping 2883 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3881 } | 3881 } |
| 3882 | 3882 |
| 3883 static void Finalize(Dart_Handle handle, void* peer); | 3883 static void Finalize(Dart_Handle handle, void* peer); |
| 3884 | 3884 |
| 3885 HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString, String); | 3885 HEAP_OBJECT_IMPLEMENTATION(ExternalFourByteString, String); |
| 3886 friend class Class; | 3886 friend class Class; |
| 3887 friend class String; | 3887 friend class String; |
| 3888 }; | 3888 }; |
| 3889 | 3889 |
| 3890 | 3890 |
| 3891 // Class Bool implements Dart core class bool. |
| 3891 class Bool : public Instance { | 3892 class Bool : public Instance { |
| 3892 public: | 3893 public: |
| 3893 bool value() const { | 3894 bool value() const { |
| 3894 return raw_ptr()->value_; | 3895 return raw_ptr()->value_; |
| 3895 } | 3896 } |
| 3896 | 3897 |
| 3897 static intptr_t InstanceSize() { | 3898 static intptr_t InstanceSize() { |
| 3898 return RoundedAllocationSize(sizeof(RawBool)); | 3899 return RoundedAllocationSize(sizeof(RawBool)); |
| 3899 } | 3900 } |
| 3900 | 3901 |
| (...skipping 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5536 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5537 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5537 return false; | 5538 return false; |
| 5538 } | 5539 } |
| 5539 } | 5540 } |
| 5540 return true; | 5541 return true; |
| 5541 } | 5542 } |
| 5542 | 5543 |
| 5543 } // namespace dart | 5544 } // namespace dart |
| 5544 | 5545 |
| 5545 #endif // VM_OBJECT_H_ | 5546 #endif // VM_OBJECT_H_ |
| OLD | NEW |