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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 RawFunction* LookupSetterFunction(const String& name) const; | 936 RawFunction* LookupSetterFunction(const String& name) const; |
937 RawFunction* LookupFunctionAtToken(intptr_t token_pos) const; | 937 RawFunction* LookupFunctionAtToken(intptr_t token_pos) const; |
938 RawField* LookupInstanceField(const String& name) const; | 938 RawField* LookupInstanceField(const String& name) const; |
939 RawField* LookupStaticField(const String& name) const; | 939 RawField* LookupStaticField(const String& name) const; |
940 RawField* LookupField(const String& name) const; | 940 RawField* LookupField(const String& name) const; |
941 | 941 |
942 RawLibraryPrefix* LookupLibraryPrefix(const String& name) const; | 942 RawLibraryPrefix* LookupLibraryPrefix(const String& name) const; |
943 | 943 |
944 void InsertCanonicalConstant(intptr_t index, const Instance& constant) const; | 944 void InsertCanonicalConstant(intptr_t index, const Instance& constant) const; |
945 | 945 |
| 946 intptr_t NumCanonicalTypes() const; |
| 947 intptr_t FindCanonicalTypeIndex(const Type& needle) const; |
| 948 RawType* CanonicalTypeFromIndex(intptr_t idx) const; |
| 949 |
946 static intptr_t InstanceSize() { | 950 static intptr_t InstanceSize() { |
947 return RoundedAllocationSize(sizeof(RawClass)); | 951 return RoundedAllocationSize(sizeof(RawClass)); |
948 } | 952 } |
949 | 953 |
950 bool is_implemented() const { | 954 bool is_implemented() const { |
951 return ImplementedBit::decode(raw_ptr()->state_bits_); | 955 return ImplementedBit::decode(raw_ptr()->state_bits_); |
952 } | 956 } |
953 void set_is_implemented() const; | 957 void set_is_implemented() const; |
954 | 958 |
955 bool is_abstract() const { | 959 bool is_abstract() const { |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1330 const TypeArguments& instantiator_type_arguments, | 1334 const TypeArguments& instantiator_type_arguments, |
1331 Error* bound_error, | 1335 Error* bound_error, |
1332 GrowableObjectArray* trail = NULL) const; | 1336 GrowableObjectArray* trail = NULL) const; |
1333 | 1337 |
1334 // Runtime instantiation with canonicalization. Not to be used during type | 1338 // Runtime instantiation with canonicalization. Not to be used during type |
1335 // finalization at compile time. | 1339 // finalization at compile time. |
1336 RawTypeArguments* InstantiateAndCanonicalizeFrom( | 1340 RawTypeArguments* InstantiateAndCanonicalizeFrom( |
1337 const TypeArguments& instantiator_type_arguments, | 1341 const TypeArguments& instantiator_type_arguments, |
1338 Error* bound_error) const; | 1342 Error* bound_error) const; |
1339 | 1343 |
| 1344 // Return true if this type argument vector has cached instantiations. |
| 1345 bool HasInstantiations() const; |
| 1346 |
| 1347 // Return the number of cached instantiations for this type argument vector. |
| 1348 intptr_t NumInstantiations() const; |
| 1349 |
1340 static intptr_t instantiations_offset() { | 1350 static intptr_t instantiations_offset() { |
1341 return OFFSET_OF(RawTypeArguments, instantiations_); | 1351 return OFFSET_OF(RawTypeArguments, instantiations_); |
1342 } | 1352 } |
1343 | 1353 |
1344 static const intptr_t kBytesPerElement = kWordSize; | 1354 static const intptr_t kBytesPerElement = kWordSize; |
1345 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; | 1355 static const intptr_t kMaxElements = kSmiMax / kBytesPerElement; |
1346 | 1356 |
1347 static intptr_t length_offset() { | 1357 static intptr_t length_offset() { |
1348 return OFFSET_OF(RawTypeArguments, length_); | 1358 return OFFSET_OF(RawTypeArguments, length_); |
1349 } | 1359 } |
(...skipping 5382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6732 | 6742 |
6733 | 6743 |
6734 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6744 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6735 intptr_t index) { | 6745 intptr_t index) { |
6736 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6746 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6737 } | 6747 } |
6738 | 6748 |
6739 } // namespace dart | 6749 } // namespace dart |
6740 | 6750 |
6741 #endif // VM_OBJECT_H_ | 6751 #endif // VM_OBJECT_H_ |
OLD | NEW |