| 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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 // Patch the signature function of a signature class allocated without it. | 910 // Patch the signature function of a signature class allocated without it. |
| 911 void PatchSignatureFunction(const Function& signature_function) const; | 911 void PatchSignatureFunction(const Function& signature_function) const; |
| 912 | 912 |
| 913 // Return a class object corresponding to the specified kind. If | 913 // Return a class object corresponding to the specified kind. If |
| 914 // a canonicalized version of it exists then that object is returned | 914 // a canonicalized version of it exists then that object is returned |
| 915 // otherwise a new object is allocated and returned. | 915 // otherwise a new object is allocated and returned. |
| 916 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); | 916 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); |
| 917 | 917 |
| 918 private: | 918 private: |
| 919 enum { | 919 enum { |
| 920 kAny = 0, |
| 921 kStatic, |
| 922 kInstance, |
| 923 kConstructor, |
| 924 kFactory, |
| 925 }; |
| 926 enum { |
| 920 kConstBit = 0, | 927 kConstBit = 0, |
| 921 kImplementedBit = 1, | 928 kImplementedBit = 1, |
| 922 kAbstractBit = 2, | 929 kAbstractBit = 2, |
| 923 kPatchBit = 3, | 930 kPatchBit = 3, |
| 924 kSynthesizedClassBit = 4, | 931 kSynthesizedClassBit = 4, |
| 925 kTypeFinalizedBit = 5, | 932 kTypeFinalizedBit = 5, |
| 926 kStateTagBit = 6, | 933 kStateTagBit = 6, |
| 927 kStateTagSize = 2, | 934 kStateTagSize = 2, |
| 928 kMarkedForParsingBit = 8, | 935 kMarkedForParsingBit = 8, |
| 929 }; | 936 }; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 946 void set_constants(const Array& value) const; | 953 void set_constants(const Array& value) const; |
| 947 | 954 |
| 948 void set_canonical_types(const Array& value) const; | 955 void set_canonical_types(const Array& value) const; |
| 949 RawArray* canonical_types() const; | 956 RawArray* canonical_types() const; |
| 950 | 957 |
| 951 void CalculateFieldOffsets() const; | 958 void CalculateFieldOffsets() const; |
| 952 | 959 |
| 953 // Assigns empty array to all raw class array fields. | 960 // Assigns empty array to all raw class array fields. |
| 954 void InitEmptyFields(); | 961 void InitEmptyFields(); |
| 955 | 962 |
| 963 static RawFunction* CheckFunctionType(const Function& func, intptr_t type); |
| 964 RawFunction* LookupFunction(const String& name, intptr_t type) const; |
| 965 RawFunction* LookupFunctionAllowPrivate(const String& name, |
| 966 intptr_t type) const; |
| 967 RawField* LookupField(const String& name, intptr_t type) const; |
| 968 |
| 956 RawFunction* LookupAccessorFunction(const char* prefix, | 969 RawFunction* LookupAccessorFunction(const char* prefix, |
| 957 intptr_t prefix_length, | 970 intptr_t prefix_length, |
| 958 const String& name) const; | 971 const String& name) const; |
| 959 | 972 |
| 960 // Allocate an instance class which has a VM implementation. | 973 // Allocate an instance class which has a VM implementation. |
| 961 template <class FakeInstance> static RawClass* New(intptr_t id); | 974 template <class FakeInstance> static RawClass* New(intptr_t id); |
| 962 | 975 |
| 963 // Check the subtype or 'more specific' relationship. | 976 // Check the subtype or 'more specific' relationship. |
| 964 bool TypeTest(TypeTestKind test_kind, | 977 bool TypeTest(TypeTestKind test_kind, |
| 965 const AbstractTypeArguments& type_arguments, | 978 const AbstractTypeArguments& type_arguments, |
| (...skipping 4841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5807 | 5820 |
| 5808 | 5821 |
| 5809 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 5822 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 5810 intptr_t index) { | 5823 intptr_t index) { |
| 5811 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 5824 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 5812 } | 5825 } |
| 5813 | 5826 |
| 5814 } // namespace dart | 5827 } // namespace dart |
| 5815 | 5828 |
| 5816 #endif // VM_OBJECT_H_ | 5829 #endif // VM_OBJECT_H_ |
| OLD | NEW |