Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: runtime/vm/object.h

Issue 2799373002: Pass a second type argument vector to all type instantiation calls in the VM. (Closed)
Patch Set: addressed comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/locations.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 RUNTIME_VM_OBJECT_H_ 5 #ifndef RUNTIME_VM_OBJECT_H_
6 #define RUNTIME_VM_OBJECT_H_ 6 #define RUNTIME_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 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1589 return SubvectorName(0, Length(), kUserVisibleName); 1589 return SubvectorName(0, Length(), kUserVisibleName);
1590 } 1590 }
1591 1591
1592 // Check if the subvector of length 'len' starting at 'from_index' of this 1592 // Check if the subvector of length 'len' starting at 'from_index' of this
1593 // type argument vector consists solely of DynamicType. 1593 // type argument vector consists solely of DynamicType.
1594 bool IsRaw(intptr_t from_index, intptr_t len) const { 1594 bool IsRaw(intptr_t from_index, intptr_t len) const {
1595 return IsDynamicTypes(false, from_index, len); 1595 return IsDynamicTypes(false, from_index, len);
1596 } 1596 }
1597 1597
1598 // Check if this type argument vector would consist solely of DynamicType if 1598 // Check if this type argument vector would consist solely of DynamicType if
1599 // it was instantiated from a raw (null) instantiator, i.e. consider each type 1599 // it was instantiated from both a raw (null) instantiator typearguments and
1600 // parameter as it would be first instantiated from a vector of dynamic types. 1600 // a raw (null) function type arguments, i.e. consider each class type
1601 // parameter and function type parameters as it would be first instantiated
1602 // from a vector of dynamic types.
1601 // Consider only a prefix of length 'len'. 1603 // Consider only a prefix of length 'len'.
1602 bool IsRawInstantiatedRaw(intptr_t len) const { 1604 bool IsRawWhenInstantiatedFromRaw(intptr_t len) const {
1603 return IsDynamicTypes(true, 0, len); 1605 return IsDynamicTypes(true, 0, len);
1604 } 1606 }
1605 1607
1606 // Check the subtype relationship, considering only a subvector of length 1608 // Check the subtype relationship, considering only a subvector of length
1607 // 'len' starting at 'from_index'. 1609 // 'len' starting at 'from_index'.
1608 bool IsSubtypeOf(const TypeArguments& other, 1610 bool IsSubtypeOf(const TypeArguments& other,
1609 intptr_t from_index, 1611 intptr_t from_index,
1610 intptr_t len, 1612 intptr_t len,
1611 Error* bound_error, 1613 Error* bound_error,
1612 TrailPtr bound_trail, 1614 TrailPtr bound_trail,
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1673 1675
1674 // Canonicalize only if instantiated, otherwise returns 'this'. 1676 // Canonicalize only if instantiated, otherwise returns 'this'.
1675 RawTypeArguments* Canonicalize(TrailPtr trail = NULL) const; 1677 RawTypeArguments* Canonicalize(TrailPtr trail = NULL) const;
1676 1678
1677 // Returns a formatted list of occuring type arguments with their URI. 1679 // Returns a formatted list of occuring type arguments with their URI.
1678 RawString* EnumerateURIs() const; 1680 RawString* EnumerateURIs() const;
1679 1681
1680 // Return 'this' if this type argument vector is instantiated, i.e. if it does 1682 // Return 'this' if this type argument vector is instantiated, i.e. if it does
1681 // not refer to type parameters. Otherwise, return a new type argument vector 1683 // not refer to type parameters. Otherwise, return a new type argument vector
1682 // where each reference to a type parameter is replaced with the corresponding 1684 // where each reference to a type parameter is replaced with the corresponding
1683 // type of the instantiator type argument vector. 1685 // type from the various type argument vectors (class instantiator, function,
1686 // or parent functions via the current context).
1684 // If bound_error is not NULL, it may be set to reflect a bound error. 1687 // If bound_error is not NULL, it may be set to reflect a bound error.
1685 RawTypeArguments* InstantiateFrom( 1688 RawTypeArguments* InstantiateFrom(
1686 const TypeArguments& instantiator_type_arguments, 1689 const TypeArguments& instantiator_type_arguments,
1690 const TypeArguments& function_type_arguments,
1687 Error* bound_error, 1691 Error* bound_error,
1688 TrailPtr instantiation_trail, 1692 TrailPtr instantiation_trail,
1689 TrailPtr bound_trail, 1693 TrailPtr bound_trail,
1690 Heap::Space space) const; 1694 Heap::Space space) const;
1691 1695
1692 // Runtime instantiation with canonicalization. Not to be used during type 1696 // Runtime instantiation with canonicalization. Not to be used during type
1693 // finalization at compile time. 1697 // finalization at compile time.
1694 RawTypeArguments* InstantiateAndCanonicalizeFrom( 1698 RawTypeArguments* InstantiateAndCanonicalizeFrom(
1695 const TypeArguments& instantiator_type_arguments, 1699 const TypeArguments& instantiator_type_arguments,
1700 const TypeArguments& function_type_arguments,
1696 Error* bound_error) const; 1701 Error* bound_error) const;
1697 1702
1698 // Return true if this type argument vector has cached instantiations. 1703 // Return true if this type argument vector has cached instantiations.
1699 bool HasInstantiations() const; 1704 bool HasInstantiations() const;
1700 1705
1701 // Return the number of cached instantiations for this type argument vector. 1706 // Return the number of cached instantiations for this type argument vector.
1702 intptr_t NumInstantiations() const; 1707 intptr_t NumInstantiations() const;
1703 1708
1704 static intptr_t instantiations_offset() { 1709 static intptr_t instantiations_offset() {
1705 return OFFSET_OF(RawTypeArguments, instantiations_); 1710 return OFFSET_OF(RawTypeArguments, instantiations_);
(...skipping 21 matching lines...) Expand all
1727 intptr_t Hash() const; 1732 intptr_t Hash() const;
1728 1733
1729 static RawTypeArguments* New(intptr_t len, Heap::Space space = Heap::kOld); 1734 static RawTypeArguments* New(intptr_t len, Heap::Space space = Heap::kOld);
1730 1735
1731 private: 1736 private:
1732 intptr_t ComputeHash() const; 1737 intptr_t ComputeHash() const;
1733 void SetHash(intptr_t value) const; 1738 void SetHash(intptr_t value) const;
1734 1739
1735 // Check if the subvector of length 'len' starting at 'from_index' of this 1740 // Check if the subvector of length 'len' starting at 'from_index' of this
1736 // type argument vector consists solely of DynamicType. 1741 // type argument vector consists solely of DynamicType.
1737 // If raw_instantiated is true, consider each type parameter to be first 1742 // If raw_instantiated is true, consider each class type parameter to be first
1738 // instantiated from a vector of dynamic types. 1743 // instantiated from a vector of dynamic types.
1739 bool IsDynamicTypes(bool raw_instantiated, 1744 bool IsDynamicTypes(bool raw_instantiated,
1740 intptr_t from_index, 1745 intptr_t from_index,
1741 intptr_t len) const; 1746 intptr_t len) const;
1742 1747
1743 // Check the subtype or 'more specific' relationship, considering only a 1748 // Check the subtype or 'more specific' relationship, considering only a
1744 // subvector of length 'len' starting at 'from_index'. 1749 // subvector of length 'len' starting at 'from_index'.
1745 bool TypeTest(TypeTestKind test_kind, 1750 bool TypeTest(TypeTestKind test_kind,
1746 const TypeArguments& other, 1751 const TypeArguments& other,
1747 intptr_t from_index, 1752 intptr_t from_index,
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
2196 // function type with uninstantiated type arguments 'T' and 'R' as elements of 2201 // function type with uninstantiated type arguments 'T' and 'R' as elements of
2197 // its type argument vector. 2202 // its type argument vector.
2198 RawType* SignatureType() const; 2203 RawType* SignatureType() const;
2199 2204
2200 // Update the signature type (with a canonical version). 2205 // Update the signature type (with a canonical version).
2201 void SetSignatureType(const Type& value) const; 2206 void SetSignatureType(const Type& value) const;
2202 2207
2203 // Return a new function with instantiated result and parameter types. 2208 // Return a new function with instantiated result and parameter types.
2204 RawFunction* InstantiateSignatureFrom( 2209 RawFunction* InstantiateSignatureFrom(
2205 const TypeArguments& instantiator_type_arguments, 2210 const TypeArguments& instantiator_type_arguments,
2211 const TypeArguments& function_type_arguments,
2206 Heap::Space space) const; 2212 Heap::Space space) const;
2207 2213
2208 // Build a string of the form '(T, {B b, C c}) => R' representing the 2214 // Build a string of the form '(T, {B b, C c}) => R' representing the
2209 // internal signature of the given function. In this example, T and R are 2215 // internal signature of the given function. In this example, T and R are
2210 // type parameters of class C, the owner of the function. 2216 // type parameters of class C, the owner of the function.
2211 RawString* Signature() const { return BuildSignature(kInternalName); } 2217 RawString* Signature() const { return BuildSignature(kInternalName); }
2212 2218
2213 // Build a string of the form '(T, {B b, C c}) => R' representing the 2219 // Build a string of the form '(T, {B b, C c}) => R' representing the
2214 // user visible signature of the given function. In this example, T and R are 2220 // user visible signature of the given function. In this example, T and R are
2215 // type parameters of class C, the owner of the function. 2221 // type parameters of class C, the owner of the function.
(...skipping 3024 matching lines...) Expand 10 before | Expand all | Expand 10 after
5240 FINAL_HEAP_OBJECT_IMPLEMENTATION(MegamorphicCache, Object); 5246 FINAL_HEAP_OBJECT_IMPLEMENTATION(MegamorphicCache, Object);
5241 }; 5247 };
5242 5248
5243 5249
5244 class SubtypeTestCache : public Object { 5250 class SubtypeTestCache : public Object {
5245 public: 5251 public:
5246 enum Entries { 5252 enum Entries {
5247 kInstanceClassIdOrFunction = 0, 5253 kInstanceClassIdOrFunction = 0,
5248 kInstanceTypeArguments = 1, 5254 kInstanceTypeArguments = 1,
5249 kInstantiatorTypeArguments = 2, 5255 kInstantiatorTypeArguments = 2,
5250 kTestResult = 3, 5256 kFunctionTypeArguments = 3,
5251 kTestEntryLength = 4, 5257 kTestResult = 4,
5258 kTestEntryLength = 5,
5252 }; 5259 };
5253 5260
5254 intptr_t NumberOfChecks() const; 5261 intptr_t NumberOfChecks() const;
5255 void AddCheck(const Object& instance_class_id_or_function, 5262 void AddCheck(const Object& instance_class_id_or_function,
5256 const TypeArguments& instance_type_arguments, 5263 const TypeArguments& instance_type_arguments,
5257 const TypeArguments& instantiator_type_arguments, 5264 const TypeArguments& instantiator_type_arguments,
5265 const TypeArguments& function_type_arguments,
5258 const Bool& test_result) const; 5266 const Bool& test_result) const;
5259 void GetCheck(intptr_t ix, 5267 void GetCheck(intptr_t ix,
5260 Object* instance_class_id_or_function, 5268 Object* instance_class_id_or_function,
5261 TypeArguments* instance_type_arguments, 5269 TypeArguments* instance_type_arguments,
5262 TypeArguments* instantiator_type_arguments, 5270 TypeArguments* instantiator_type_arguments,
5271 TypeArguments* function_type_arguments,
5263 Bool* test_result) const; 5272 Bool* test_result) const;
5264 5273
5265 static RawSubtypeTestCache* New(); 5274 static RawSubtypeTestCache* New();
5266 5275
5267 static intptr_t InstanceSize() { 5276 static intptr_t InstanceSize() {
5268 return RoundedAllocationSize(sizeof(RawSubtypeTestCache)); 5277 return RoundedAllocationSize(sizeof(RawSubtypeTestCache));
5269 } 5278 }
5270 5279
5271 static intptr_t cache_offset() { 5280 static intptr_t cache_offset() {
5272 return OFFSET_OF(RawSubtypeTestCache, cache_); 5281 return OFFSET_OF(RawSubtypeTestCache, cache_);
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
5487 void SetField(const Field& field, const Object& value) const { 5496 void SetField(const Field& field, const Object& value) const {
5488 field.RecordStore(value); 5497 field.RecordStore(value);
5489 StorePointer(FieldAddr(field), value.raw()); 5498 StorePointer(FieldAddr(field), value.raw());
5490 } 5499 }
5491 5500
5492 RawAbstractType* GetType(Heap::Space space) const; 5501 RawAbstractType* GetType(Heap::Space space) const;
5493 5502
5494 virtual RawTypeArguments* GetTypeArguments() const; 5503 virtual RawTypeArguments* GetTypeArguments() const;
5495 virtual void SetTypeArguments(const TypeArguments& value) const; 5504 virtual void SetTypeArguments(const TypeArguments& value) const;
5496 5505
5497 // Check if the type of this instance is a subtype of the given type. 5506 // Check if the type of this instance is a subtype of the given other type.
5498 bool IsInstanceOf(const AbstractType& type, 5507 // The type argument vectors are used to instantiate the other type if needed.
5499 const TypeArguments& type_instantiator, 5508 bool IsInstanceOf(const AbstractType& other,
5509 const TypeArguments& other_instantiator_type_arguments,
5510 const TypeArguments& other_function_type_arguments,
5500 Error* bound_error) const; 5511 Error* bound_error) const;
5501 5512
5502 bool IsValidNativeIndex(int index) const { 5513 bool IsValidNativeIndex(int index) const {
5503 return ((index >= 0) && (index < clazz()->ptr()->num_native_fields_)); 5514 return ((index >= 0) && (index < clazz()->ptr()->num_native_fields_));
5504 } 5515 }
5505 5516
5506 intptr_t* NativeFieldsDataAddr() const; 5517 intptr_t* NativeFieldsDataAddr() const;
5507 inline intptr_t GetNativeField(int index) const; 5518 inline intptr_t GetNativeField(int index) const;
5508 inline void GetNativeFields(uint16_t num_fields, 5519 inline void GetNativeFields(uint16_t num_fields,
5509 intptr_t* field_values) const; 5520 intptr_t* field_values) const;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
5686 } 5697 }
5687 virtual bool Equals(const Instance& other) const { 5698 virtual bool Equals(const Instance& other) const {
5688 return IsEquivalent(other); 5699 return IsEquivalent(other);
5689 } 5700 }
5690 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 5701 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
5691 virtual bool IsRecursive() const; 5702 virtual bool IsRecursive() const;
5692 5703
5693 // Check if this type represents a function type. 5704 // Check if this type represents a function type.
5694 virtual bool IsFunctionType() const { return false; } 5705 virtual bool IsFunctionType() const { return false; }
5695 5706
5696 // Instantiate this type using the given type argument vector. 5707 // Instantiate this type using the given type argument vectors and possibly
5708 // the current context.
5697 // Return a new type, or return 'this' if it is already instantiated. 5709 // Return a new type, or return 'this' if it is already instantiated.
5698 // If bound_error is not NULL, it may be set to reflect a bound error. 5710 // If bound_error is not NULL, it may be set to reflect a bound error.
5699 virtual RawAbstractType* InstantiateFrom( 5711 virtual RawAbstractType* InstantiateFrom(
5700 const TypeArguments& instantiator_type_arguments, 5712 const TypeArguments& instantiator_type_arguments,
5713 const TypeArguments& function_type_arguments,
5701 Error* bound_error, 5714 Error* bound_error,
5702 TrailPtr instantiation_trail, 5715 TrailPtr instantiation_trail,
5703 TrailPtr bound_trail, 5716 TrailPtr bound_trail,
5704 Heap::Space space) const; 5717 Heap::Space space) const;
5705 5718
5706 // Return a clone of this unfinalized type or the type itself if it is 5719 // Return a clone of this unfinalized type or the type itself if it is
5707 // already finalized. Apply recursively to type arguments, i.e. finalized 5720 // already finalized. Apply recursively to type arguments, i.e. finalized
5708 // type arguments of an unfinalized type are not cloned, but shared. 5721 // type arguments of an unfinalized type are not cloned, but shared.
5709 virtual RawAbstractType* CloneUnfinalized() const; 5722 virtual RawAbstractType* CloneUnfinalized() const;
5710 5723
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
5906 // the signature fully represents the type and type arguments can be ignored. 5919 // the signature fully represents the type and type arguments can be ignored.
5907 // However, in case of a generic typedef, they document how the typedef class 5920 // However, in case of a generic typedef, they document how the typedef class
5908 // was parameterized to obtain the actual signature. 5921 // was parameterized to obtain the actual signature.
5909 RawFunction* signature() const; 5922 RawFunction* signature() const;
5910 void set_signature(const Function& value) const; 5923 void set_signature(const Function& value) const;
5911 virtual bool IsFunctionType() const { 5924 virtual bool IsFunctionType() const {
5912 return signature() != Function::null(); 5925 return signature() != Function::null();
5913 } 5926 }
5914 virtual RawAbstractType* InstantiateFrom( 5927 virtual RawAbstractType* InstantiateFrom(
5915 const TypeArguments& instantiator_type_arguments, 5928 const TypeArguments& instantiator_type_arguments,
5929 const TypeArguments& function_type_arguments,
5916 Error* bound_error, 5930 Error* bound_error,
5917 TrailPtr instantiation_trail, 5931 TrailPtr instantiation_trail,
5918 TrailPtr bound_trail, 5932 TrailPtr bound_trail,
5919 Heap::Space space) const; 5933 Heap::Space space) const;
5920 virtual RawAbstractType* CloneUnfinalized() const; 5934 virtual RawAbstractType* CloneUnfinalized() const;
5921 virtual RawAbstractType* CloneUninstantiated(const Class& new_owner, 5935 virtual RawAbstractType* CloneUninstantiated(const Class& new_owner,
5922 TrailPtr trail = NULL) const; 5936 TrailPtr trail = NULL) const;
5923 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const; 5937 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
5924 #if defined(DEBUG) 5938 #if defined(DEBUG)
5925 // Check if type is canonical. 5939 // Check if type is canonical.
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
6042 } 6056 }
6043 virtual TokenPosition token_pos() const { 6057 virtual TokenPosition token_pos() const {
6044 return AbstractType::Handle(type()).token_pos(); 6058 return AbstractType::Handle(type()).token_pos();
6045 } 6059 }
6046 virtual bool IsInstantiated(Genericity genericity = kAny, 6060 virtual bool IsInstantiated(Genericity genericity = kAny,
6047 TrailPtr trail = NULL) const; 6061 TrailPtr trail = NULL) const;
6048 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 6062 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
6049 virtual bool IsRecursive() const { return true; } 6063 virtual bool IsRecursive() const { return true; }
6050 virtual RawTypeRef* InstantiateFrom( 6064 virtual RawTypeRef* InstantiateFrom(
6051 const TypeArguments& instantiator_type_arguments, 6065 const TypeArguments& instantiator_type_arguments,
6066 const TypeArguments& function_type_arguments,
6052 Error* bound_error, 6067 Error* bound_error,
6053 TrailPtr instantiation_trail, 6068 TrailPtr instantiation_trail,
6054 TrailPtr bound_trail, 6069 TrailPtr bound_trail,
6055 Heap::Space space) const; 6070 Heap::Space space) const;
6056 virtual RawTypeRef* CloneUninstantiated(const Class& new_owner, 6071 virtual RawTypeRef* CloneUninstantiated(const Class& new_owner,
6057 TrailPtr trail = NULL) const; 6072 TrailPtr trail = NULL) const;
6058 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const; 6073 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
6059 #if defined(DEBUG) 6074 #if defined(DEBUG)
6060 // Check if typeref is canonical. 6075 // Check if typeref is canonical.
6061 virtual bool CheckIsCanonical(Thread* thread) const; 6076 virtual bool CheckIsCanonical(Thread* thread) const;
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
6127 Error* bound_error, 6142 Error* bound_error,
6128 TrailPtr bound_trail, 6143 TrailPtr bound_trail,
6129 Heap::Space space) const; 6144 Heap::Space space) const;
6130 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; } 6145 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
6131 virtual bool IsInstantiated(Genericity genericity = kAny, 6146 virtual bool IsInstantiated(Genericity genericity = kAny,
6132 TrailPtr trail = NULL) const; 6147 TrailPtr trail = NULL) const;
6133 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 6148 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
6134 virtual bool IsRecursive() const { return false; } 6149 virtual bool IsRecursive() const { return false; }
6135 virtual RawAbstractType* InstantiateFrom( 6150 virtual RawAbstractType* InstantiateFrom(
6136 const TypeArguments& instantiator_type_arguments, 6151 const TypeArguments& instantiator_type_arguments,
6152 const TypeArguments& function_type_arguments,
6137 Error* bound_error, 6153 Error* bound_error,
6138 TrailPtr instantiation_trail, 6154 TrailPtr instantiation_trail,
6139 TrailPtr bound_trail, 6155 TrailPtr bound_trail,
6140 Heap::Space space) const; 6156 Heap::Space space) const;
6141 virtual RawAbstractType* CloneUnfinalized() const; 6157 virtual RawAbstractType* CloneUnfinalized() const;
6142 virtual RawAbstractType* CloneUninstantiated(const Class& new_owner, 6158 virtual RawAbstractType* CloneUninstantiated(const Class& new_owner,
6143 TrailPtr trail = NULL) const; 6159 TrailPtr trail = NULL) const;
6144 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const { 6160 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
6145 return raw(); 6161 return raw();
6146 } 6162 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
6228 // It is not possible to encounter an instantiated bounded type with an 6244 // It is not possible to encounter an instantiated bounded type with an
6229 // uninstantiated upper bound. Therefore, we do not need to check if the 6245 // uninstantiated upper bound. Therefore, we do not need to check if the
6230 // bound is instantiated. Moreover, doing so could lead into cycles, as in 6246 // bound is instantiated. Moreover, doing so could lead into cycles, as in
6231 // class C<T extends C<C>> { }. 6247 // class C<T extends C<C>> { }.
6232 return AbstractType::Handle(type()).IsInstantiated(genericity, trail); 6248 return AbstractType::Handle(type()).IsInstantiated(genericity, trail);
6233 } 6249 }
6234 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 6250 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
6235 virtual bool IsRecursive() const; 6251 virtual bool IsRecursive() const;
6236 virtual RawAbstractType* InstantiateFrom( 6252 virtual RawAbstractType* InstantiateFrom(
6237 const TypeArguments& instantiator_type_arguments, 6253 const TypeArguments& instantiator_type_arguments,
6254 const TypeArguments& function_type_arguments,
6238 Error* bound_error, 6255 Error* bound_error,
6239 TrailPtr instantiation_trail, 6256 TrailPtr instantiation_trail,
6240 TrailPtr bound_trail, 6257 TrailPtr bound_trail,
6241 Heap::Space space) const; 6258 Heap::Space space) const;
6242 virtual RawAbstractType* CloneUnfinalized() const; 6259 virtual RawAbstractType* CloneUnfinalized() const;
6243 virtual RawAbstractType* CloneUninstantiated(const Class& new_owner, 6260 virtual RawAbstractType* CloneUninstantiated(const Class& new_owner,
6244 TrailPtr trail = NULL) const; 6261 TrailPtr trail = NULL) const;
6245 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const { 6262 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
6246 return raw(); 6263 return raw();
6247 } 6264 }
(...skipping 2696 matching lines...) Expand 10 before | Expand all | Expand 10 after
8944 8961
8945 inline void TypeArguments::SetHash(intptr_t value) const { 8962 inline void TypeArguments::SetHash(intptr_t value) const {
8946 // This is only safe because we create a new Smi, which does not cause 8963 // This is only safe because we create a new Smi, which does not cause
8947 // heap allocation. 8964 // heap allocation.
8948 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); 8965 StoreSmi(&raw_ptr()->hash_, Smi::New(value));
8949 } 8966 }
8950 8967
8951 } // namespace dart 8968 } // namespace dart
8952 8969
8953 #endif // RUNTIME_VM_OBJECT_H_ 8970 #endif // RUNTIME_VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/locations.h ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698