| 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 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 void SetFields(const Array& value) const; | 594 void SetFields(const Array& value) const; |
| 595 | 595 |
| 596 RawArray* functions() const { return raw_ptr()->functions_; } | 596 RawArray* functions() const { return raw_ptr()->functions_; } |
| 597 void SetFunctions(const Array& value) const; | 597 void SetFunctions(const Array& value) const; |
| 598 | 598 |
| 599 RawFunction* LookupDynamicFunction(const String& name) const; | 599 RawFunction* LookupDynamicFunction(const String& name) const; |
| 600 RawFunction* LookupStaticFunction(const String& name) const; | 600 RawFunction* LookupStaticFunction(const String& name) const; |
| 601 RawFunction* LookupConstructor(const String& name) const; | 601 RawFunction* LookupConstructor(const String& name) const; |
| 602 RawFunction* LookupFactory(const String& name) const; | 602 RawFunction* LookupFactory(const String& name) const; |
| 603 RawFunction* LookupFunction(const String& name) const; | 603 RawFunction* LookupFunction(const String& name) const; |
| 604 RawFunction* LookupGetterFunction(const String& name) const; |
| 605 RawFunction* LookupSetterFunction(const String& name) const; |
| 604 RawFunction* LookupFunctionAtToken(intptr_t token_index) const; | 606 RawFunction* LookupFunctionAtToken(intptr_t token_index) const; |
| 605 RawField* LookupInstanceField(const String& name) const; | 607 RawField* LookupInstanceField(const String& name) const; |
| 606 RawField* LookupStaticField(const String& name) const; | 608 RawField* LookupStaticField(const String& name) const; |
| 607 RawField* LookupField(const String& name) const; | 609 RawField* LookupField(const String& name) const; |
| 608 | 610 |
| 609 RawLibraryPrefix* LookupLibraryPrefix(const String& name) const; | 611 RawLibraryPrefix* LookupLibraryPrefix(const String& name) const; |
| 610 | 612 |
| 611 void InsertCanonicalConstant(intptr_t index, const Instance& constant) const; | 613 void InsertCanonicalConstant(intptr_t index, const Instance& constant) const; |
| 612 | 614 |
| 613 static intptr_t InstanceSize() { | 615 static intptr_t InstanceSize() { |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 | 699 |
| 698 // Check the subtype or assignability relationship. | 700 // Check the subtype or assignability relationship. |
| 699 bool TestType(TypeTestKind test, | 701 bool TestType(TypeTestKind test, |
| 700 const AbstractTypeArguments& type_arguments, | 702 const AbstractTypeArguments& type_arguments, |
| 701 const Class& other, | 703 const Class& other, |
| 702 const AbstractTypeArguments& other_type_arguments) const; | 704 const AbstractTypeArguments& other_type_arguments) const; |
| 703 | 705 |
| 704 // Assigns empty array to all raw class array fields. | 706 // Assigns empty array to all raw class array fields. |
| 705 void InitEmptyFields(); | 707 void InitEmptyFields(); |
| 706 | 708 |
| 709 RawFunction* LookupAccessorFunction(const char* prefix, |
| 710 intptr_t prefix_length, |
| 711 const String& name) const; |
| 712 |
| 707 HEAP_OBJECT_IMPLEMENTATION(Class, Object); | 713 HEAP_OBJECT_IMPLEMENTATION(Class, Object); |
| 708 friend class Object; | 714 friend class Object; |
| 709 friend class Instance; | 715 friend class Instance; |
| 710 friend class Type; | 716 friend class Type; |
| 711 }; | 717 }; |
| 712 | 718 |
| 713 | 719 |
| 714 // Unresolved class is used for storing unresolved names which will be resolved | 720 // Unresolved class is used for storing unresolved names which will be resolved |
| 715 // to a class after all classes have been loaded and finalized. | 721 // to a class after all classes have been loaded and finalized. |
| 716 class UnresolvedClass : public Object { | 722 class UnresolvedClass : public Object { |
| (...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1496 | 1502 |
| 1497 intptr_t token_index() const { return raw_ptr()->token_index_; } | 1503 intptr_t token_index() const { return raw_ptr()->token_index_; } |
| 1498 | 1504 |
| 1499 bool has_initializer() const { return raw_ptr()->has_initializer_; } | 1505 bool has_initializer() const { return raw_ptr()->has_initializer_; } |
| 1500 void set_has_initializer(bool has_initializer) const { | 1506 void set_has_initializer(bool has_initializer) const { |
| 1501 raw_ptr()->has_initializer_ = has_initializer; | 1507 raw_ptr()->has_initializer_ = has_initializer; |
| 1502 } | 1508 } |
| 1503 | 1509 |
| 1504 // Constructs getter and setter names for fields and vice versa. | 1510 // Constructs getter and setter names for fields and vice versa. |
| 1505 static RawString* GetterName(const String& field_name); | 1511 static RawString* GetterName(const String& field_name); |
| 1512 static RawString* GetterSymbol(const String& field_name); |
| 1506 static RawString* SetterName(const String& field_name); | 1513 static RawString* SetterName(const String& field_name); |
| 1514 static RawString* SetterSymbol(const String& field_name); |
| 1507 static RawString* NameFromGetter(const String& getter_name); | 1515 static RawString* NameFromGetter(const String& getter_name); |
| 1508 static RawString* NameFromSetter(const String& setter_name); | 1516 static RawString* NameFromSetter(const String& setter_name); |
| 1509 | 1517 |
| 1510 private: | 1518 private: |
| 1511 void set_name(const String& value) const; | 1519 void set_name(const String& value) const; |
| 1512 void set_is_static(bool is_static) const { | 1520 void set_is_static(bool is_static) const { |
| 1513 raw_ptr()->is_static_ = is_static; | 1521 raw_ptr()->is_static_ = is_static; |
| 1514 } | 1522 } |
| 1515 void set_is_final(bool is_final) const { | 1523 void set_is_final(bool is_final) const { |
| 1516 raw_ptr()->is_final_ = is_final; | 1524 raw_ptr()->is_final_ = is_final; |
| (...skipping 1987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3504 } | 3512 } |
| 3505 | 3513 |
| 3506 | 3514 |
| 3507 void Context::SetAt(intptr_t index, const Instance& value) const { | 3515 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 3508 StorePointer(InstanceAddr(index), value.raw()); | 3516 StorePointer(InstanceAddr(index), value.raw()); |
| 3509 } | 3517 } |
| 3510 | 3518 |
| 3511 } // namespace dart | 3519 } // namespace dart |
| 3512 | 3520 |
| 3513 #endif // VM_OBJECT_H_ | 3521 #endif // VM_OBJECT_H_ |
| OLD | NEW |