| 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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 554 } |
| 555 | 555 |
| 556 // Returns the list of classes having this class as direct superclass. | 556 // Returns the list of classes having this class as direct superclass. |
| 557 RawGrowableObjectArray* direct_subclasses() const { | 557 RawGrowableObjectArray* direct_subclasses() const { |
| 558 return raw_ptr()->direct_subclasses_; | 558 return raw_ptr()->direct_subclasses_; |
| 559 } | 559 } |
| 560 void AddDirectSubclass(const Class& subclass) const; | 560 void AddDirectSubclass(const Class& subclass) const; |
| 561 // TODO(regis): Implement RemoveDirectSubclass for class unloading support. | 561 // TODO(regis): Implement RemoveDirectSubclass for class unloading support. |
| 562 | 562 |
| 563 // Check if this class represents the class of null. | 563 // Check if this class represents the class of null. |
| 564 bool IsNullClass() const { return raw() == Object::null_class(); } | 564 bool IsNullClass() const { return id() == kNullCid; } |
| 565 | 565 |
| 566 // Check if this class represents the 'Dynamic' class. | 566 // Check if this class represents the 'Dynamic' class. |
| 567 bool IsDynamicClass() const { return raw() == Object::dynamic_class(); } | 567 bool IsDynamicClass() const { return id() == kDynamicCid; } |
| 568 | 568 |
| 569 // Check if this class represents the 'void' class. | 569 // Check if this class represents the 'void' class. |
| 570 bool IsVoidClass() const { return raw() == Object::void_class(); } | 570 bool IsVoidClass() const { return id() == kVoidCid; } |
| 571 | 571 |
| 572 // Check if this class represents the 'Object' class. | 572 // Check if this class represents the 'Object' class. |
| 573 bool IsObjectClass() const; | 573 bool IsObjectClass() const { return id() == kInstanceCid; } |
| 574 | 574 |
| 575 // Check if this class represents a signature class. | 575 // Check if this class represents a signature class. |
| 576 bool IsSignatureClass() const { | 576 bool IsSignatureClass() const { |
| 577 return signature_function() != Object::null(); | 577 return signature_function() != Object::null(); |
| 578 } | 578 } |
| 579 static bool IsSignatureClass(RawClass* cls) { | 579 static bool IsSignatureClass(RawClass* cls) { |
| 580 return cls->ptr()->signature_function_ != Object::null(); | 580 return cls->ptr()->signature_function_ != Object::null(); |
| 581 } | 581 } |
| 582 | 582 |
| 583 // Check if this class represents a canonical signature class, i.e. not an | 583 // Check if this class represents a canonical signature class, i.e. not an |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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' interface type. |
| 987 static RawType* BoolInterface(); | 987 static RawType* BoolInterface(); |
| 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. |
| 993 static RawType* SmiType(); |
| 994 |
| 995 // The 'Mint' type. |
| 996 static RawType* MintType(); |
| 997 |
| 992 // The 'double' interface type. | 998 // The 'double' interface type. |
| 993 static RawType* DoubleInterface(); | 999 static RawType* DoubleInterface(); |
| 994 | 1000 |
| 995 // The 'num' interface type. | 1001 // The 'num' interface type. |
| 996 static RawType* Number(); | 1002 static RawType* Number(); |
| 997 | 1003 |
| 998 // The 'String' interface type. | 1004 // The 'String' interface type. |
| 999 static RawType* StringInterface(); | 1005 static RawType* StringInterface(); |
| 1000 | 1006 |
| 1001 // The 'Function' interface type. | 1007 // The 'Function' interface type. |
| (...skipping 4526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5528 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5534 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
| 5529 return false; | 5535 return false; |
| 5530 } | 5536 } |
| 5531 } | 5537 } |
| 5532 return true; | 5538 return true; |
| 5533 } | 5539 } |
| 5534 | 5540 |
| 5535 } // namespace dart | 5541 } // namespace dart |
| 5536 | 5542 |
| 5537 #endif // VM_OBJECT_H_ | 5543 #endif // VM_OBJECT_H_ |
| OLD | NEW |