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

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

Issue 1691163002: Fix background compilation crashes due to allocation of types in new space. Remove default argument… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: e Created 4 years, 10 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/dart_api_impl.cc ('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 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 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 static bool IsInFullSnapshot(RawClass* cls) { 1125 static bool IsInFullSnapshot(RawClass* cls) {
1126 NoSafepointScope no_safepoint; 1126 NoSafepointScope no_safepoint;
1127 return cls->ptr()->library_->ptr()->is_in_fullsnapshot_; 1127 return cls->ptr()->library_->ptr()->is_in_fullsnapshot_;
1128 } 1128 }
1129 1129
1130 // Check the subtype relationship. 1130 // Check the subtype relationship.
1131 bool IsSubtypeOf(const TypeArguments& type_arguments, 1131 bool IsSubtypeOf(const TypeArguments& type_arguments,
1132 const Class& other, 1132 const Class& other,
1133 const TypeArguments& other_type_arguments, 1133 const TypeArguments& other_type_arguments,
1134 Error* bound_error, 1134 Error* bound_error,
1135 TrailPtr bound_trail = NULL, 1135 TrailPtr bound_trail,
1136 Heap::Space space = Heap::kNew) const { 1136 Heap::Space space) const {
1137 return TypeTest(kIsSubtypeOf, 1137 return TypeTest(kIsSubtypeOf,
1138 type_arguments, 1138 type_arguments,
1139 other, 1139 other,
1140 other_type_arguments, 1140 other_type_arguments,
1141 bound_error, 1141 bound_error,
1142 bound_trail, 1142 bound_trail,
1143 space); 1143 space);
1144 } 1144 }
1145 1145
1146 // Check the 'more specific' relationship. 1146 // Check the 'more specific' relationship.
1147 bool IsMoreSpecificThan(const TypeArguments& type_arguments, 1147 bool IsMoreSpecificThan(const TypeArguments& type_arguments,
1148 const Class& other, 1148 const Class& other,
1149 const TypeArguments& other_type_arguments, 1149 const TypeArguments& other_type_arguments,
1150 Error* bound_error, 1150 Error* bound_error,
1151 TrailPtr bound_trail = NULL, 1151 TrailPtr bound_trail,
1152 Heap::Space space = Heap::kNew) const { 1152 Heap::Space space) const {
1153 return TypeTest(kIsMoreSpecificThan, 1153 return TypeTest(kIsMoreSpecificThan,
1154 type_arguments, 1154 type_arguments,
1155 other, 1155 other,
1156 other_type_arguments, 1156 other_type_arguments,
1157 bound_error, 1157 bound_error,
1158 bound_trail, 1158 bound_trail,
1159 space); 1159 space);
1160 } 1160 }
1161 1161
1162 // Check if this is the top level class. 1162 // Check if this is the top level class.
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1577 bool IsRawInstantiatedRaw(intptr_t len) const { 1577 bool IsRawInstantiatedRaw(intptr_t len) const {
1578 return IsDynamicTypes(true, 0, len); 1578 return IsDynamicTypes(true, 0, len);
1579 } 1579 }
1580 1580
1581 // Check the subtype relationship, considering only a subvector of length 1581 // Check the subtype relationship, considering only a subvector of length
1582 // 'len' starting at 'from_index'. 1582 // 'len' starting at 'from_index'.
1583 bool IsSubtypeOf(const TypeArguments& other, 1583 bool IsSubtypeOf(const TypeArguments& other,
1584 intptr_t from_index, 1584 intptr_t from_index,
1585 intptr_t len, 1585 intptr_t len,
1586 Error* bound_error, 1586 Error* bound_error,
1587 TrailPtr bound_trail = NULL, 1587 TrailPtr bound_trail,
1588 Heap::Space space = Heap::kNew) const { 1588 Heap::Space space) const {
1589 return TypeTest(kIsSubtypeOf, other, from_index, len, 1589 return TypeTest(kIsSubtypeOf, other, from_index, len,
1590 bound_error, bound_trail, space); 1590 bound_error, bound_trail, space);
1591 } 1591 }
1592 1592
1593 // Check the 'more specific' relationship, considering only a subvector of 1593 // Check the 'more specific' relationship, considering only a subvector of
1594 // length 'len' starting at 'from_index'. 1594 // length 'len' starting at 'from_index'.
1595 bool IsMoreSpecificThan(const TypeArguments& other, 1595 bool IsMoreSpecificThan(const TypeArguments& other,
1596 intptr_t from_index, 1596 intptr_t from_index,
1597 intptr_t len, 1597 intptr_t len,
1598 Error* bound_error, 1598 Error* bound_error,
1599 TrailPtr bound_trail = NULL, 1599 TrailPtr bound_trail,
1600 Heap::Space space = Heap::kNew) const { 1600 Heap::Space space) const {
1601 return TypeTest(kIsMoreSpecificThan, other, from_index, len, 1601 return TypeTest(kIsMoreSpecificThan, other, from_index, len,
1602 bound_error, bound_trail, space); 1602 bound_error, bound_trail, space);
1603 } 1603 }
1604 1604
1605 // Check if the vectors are equal (they may be null). 1605 // Check if the vectors are equal (they may be null).
1606 bool Equals(const TypeArguments& other) const { 1606 bool Equals(const TypeArguments& other) const {
1607 return IsSubvectorEquivalent(other, 0, IsNull() ? 0 : Length()); 1607 return IsSubvectorEquivalent(other, 0, IsNull() ? 0 : Length());
1608 } 1608 }
1609 1609
1610 bool IsEquivalent(const TypeArguments& other, TrailPtr trail = NULL) const { 1610 bool IsEquivalent(const TypeArguments& other, TrailPtr trail = NULL) const {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1648 RawTypeArguments* Canonicalize(TrailPtr trail = NULL) const; 1648 RawTypeArguments* Canonicalize(TrailPtr trail = NULL) const;
1649 1649
1650 // Return 'this' if this type argument vector is instantiated, i.e. if it does 1650 // Return 'this' if this type argument vector is instantiated, i.e. if it does
1651 // not refer to type parameters. Otherwise, return a new type argument vector 1651 // not refer to type parameters. Otherwise, return a new type argument vector
1652 // where each reference to a type parameter is replaced with the corresponding 1652 // where each reference to a type parameter is replaced with the corresponding
1653 // type of the instantiator type argument vector. 1653 // type of the instantiator type argument vector.
1654 // If bound_error is not NULL, it may be set to reflect a bound error. 1654 // If bound_error is not NULL, it may be set to reflect a bound error.
1655 RawTypeArguments* InstantiateFrom( 1655 RawTypeArguments* InstantiateFrom(
1656 const TypeArguments& instantiator_type_arguments, 1656 const TypeArguments& instantiator_type_arguments,
1657 Error* bound_error, 1657 Error* bound_error,
1658 TrailPtr instantiation_trail = NULL, 1658 TrailPtr instantiation_trail,
1659 TrailPtr bound_trail = NULL, 1659 TrailPtr bound_trail,
1660 Heap::Space space = Heap::kNew) const; 1660 Heap::Space space) const;
1661 1661
1662 // Runtime instantiation with canonicalization. Not to be used during type 1662 // Runtime instantiation with canonicalization. Not to be used during type
1663 // finalization at compile time. 1663 // finalization at compile time.
1664 RawTypeArguments* InstantiateAndCanonicalizeFrom( 1664 RawTypeArguments* InstantiateAndCanonicalizeFrom(
1665 const TypeArguments& instantiator_type_arguments, 1665 const TypeArguments& instantiator_type_arguments,
1666 Error* bound_error) const; 1666 Error* bound_error) const;
1667 1667
1668 // Return true if this type argument vector has cached instantiations. 1668 // Return true if this type argument vector has cached instantiations.
1669 bool HasInstantiations() const; 1669 bool HasInstantiations() const;
1670 1670
(...skipping 815 matching lines...) Expand 10 before | Expand all | Expand 10 after
2486 // other function. 2486 // other function.
2487 bool HasCompatibleParametersWith(const Function& other, 2487 bool HasCompatibleParametersWith(const Function& other,
2488 Error* bound_error) const; 2488 Error* bound_error) const;
2489 2489
2490 // Returns true if the type of this function is a subtype of the type of 2490 // Returns true if the type of this function is a subtype of the type of
2491 // the other function. 2491 // the other function.
2492 bool IsSubtypeOf(const TypeArguments& type_arguments, 2492 bool IsSubtypeOf(const TypeArguments& type_arguments,
2493 const Function& other, 2493 const Function& other,
2494 const TypeArguments& other_type_arguments, 2494 const TypeArguments& other_type_arguments,
2495 Error* bound_error, 2495 Error* bound_error,
2496 Heap::Space space = Heap::kNew) const { 2496 Heap::Space space) const {
2497 return TypeTest(kIsSubtypeOf, 2497 return TypeTest(kIsSubtypeOf,
2498 type_arguments, 2498 type_arguments,
2499 other, 2499 other,
2500 other_type_arguments, 2500 other_type_arguments,
2501 bound_error, 2501 bound_error,
2502 space); 2502 space);
2503 } 2503 }
2504 2504
2505 // Returns true if the type of this function is more specific than the type of 2505 // Returns true if the type of this function is more specific than the type of
2506 // the other function. 2506 // the other function.
2507 bool IsMoreSpecificThan(const TypeArguments& type_arguments, 2507 bool IsMoreSpecificThan(const TypeArguments& type_arguments,
2508 const Function& other, 2508 const Function& other,
2509 const TypeArguments& other_type_arguments, 2509 const TypeArguments& other_type_arguments,
2510 Error* bound_error, 2510 Error* bound_error,
2511 Heap::Space space = Heap::kNew) const { 2511 Heap::Space space) const {
2512 return TypeTest(kIsMoreSpecificThan, 2512 return TypeTest(kIsMoreSpecificThan,
2513 type_arguments, 2513 type_arguments,
2514 other, 2514 other,
2515 other_type_arguments, 2515 other_type_arguments,
2516 bound_error, 2516 bound_error,
2517 space); 2517 space);
2518 } 2518 }
2519 2519
2520 // Check the subtype or 'more specific' relationship. 2520 // Check the subtype or 'more specific' relationship.
2521 bool TypeTest(TypeTestKind test_kind, 2521 bool TypeTest(TypeTestKind test_kind,
(...skipping 2746 matching lines...) Expand 10 before | Expand all | Expand 10 after
5268 } 5268 }
5269 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 5269 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
5270 virtual bool IsRecursive() const; 5270 virtual bool IsRecursive() const;
5271 5271
5272 // Instantiate this type using the given type argument vector. 5272 // Instantiate this type using the given type argument vector.
5273 // Return a new type, or return 'this' if it is already instantiated. 5273 // Return a new type, or return 'this' if it is already instantiated.
5274 // If bound_error is not NULL, it may be set to reflect a bound error. 5274 // If bound_error is not NULL, it may be set to reflect a bound error.
5275 virtual RawAbstractType* InstantiateFrom( 5275 virtual RawAbstractType* InstantiateFrom(
5276 const TypeArguments& instantiator_type_arguments, 5276 const TypeArguments& instantiator_type_arguments,
5277 Error* bound_error, 5277 Error* bound_error,
5278 TrailPtr instantiation_trail = NULL, 5278 TrailPtr instantiation_trail,
5279 TrailPtr bound_trail = NULL, 5279 TrailPtr bound_trail,
5280 Heap::Space space = Heap::kNew) const; 5280 Heap::Space space) const;
5281 5281
5282 // Return a clone of this unfinalized type or the type itself if it is 5282 // Return a clone of this unfinalized type or the type itself if it is
5283 // already finalized. Apply recursively to type arguments, i.e. finalized 5283 // already finalized. Apply recursively to type arguments, i.e. finalized
5284 // type arguments of an unfinalized type are not cloned, but shared. 5284 // type arguments of an unfinalized type are not cloned, but shared.
5285 virtual RawAbstractType* CloneUnfinalized() const; 5285 virtual RawAbstractType* CloneUnfinalized() const;
5286 5286
5287 // Return a clone of this uninstantiated type where all references to type 5287 // Return a clone of this uninstantiated type where all references to type
5288 // parameters are replaced with references to type parameters of the same name 5288 // parameters are replaced with references to type parameters of the same name
5289 // but belonging to the new owner class. 5289 // but belonging to the new owner class.
5290 // Apply recursively to type arguments, i.e. instantiated type arguments of 5290 // Apply recursively to type arguments, i.e. instantiated type arguments of
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
5383 5383
5384 // Check if this type represents the 'String' type. 5384 // Check if this type represents the 'String' type.
5385 bool IsStringType() const; 5385 bool IsStringType() const;
5386 5386
5387 // Check if this type represents the Dart 'Function' type. 5387 // Check if this type represents the Dart 'Function' type.
5388 bool IsDartFunctionType() const; 5388 bool IsDartFunctionType() const;
5389 5389
5390 // Check the subtype relationship. 5390 // Check the subtype relationship.
5391 bool IsSubtypeOf(const AbstractType& other, 5391 bool IsSubtypeOf(const AbstractType& other,
5392 Error* bound_error, 5392 Error* bound_error,
5393 TrailPtr bound_trail = NULL, 5393 TrailPtr bound_trail,
5394 Heap::Space space = Heap::kNew) const { 5394 Heap::Space space) const {
5395 return TypeTest(kIsSubtypeOf, other, bound_error, bound_trail, space); 5395 return TypeTest(kIsSubtypeOf, other, bound_error, bound_trail, space);
5396 } 5396 }
5397 5397
5398 // Check the 'more specific' relationship. 5398 // Check the 'more specific' relationship.
5399 bool IsMoreSpecificThan(const AbstractType& other, 5399 bool IsMoreSpecificThan(const AbstractType& other,
5400 Error* bound_error, 5400 Error* bound_error,
5401 TrailPtr bound_trail = NULL, 5401 TrailPtr bound_trail,
5402 Heap::Space space = Heap::kNew) const { 5402 Heap::Space space) const {
5403 return TypeTest(kIsMoreSpecificThan, other, 5403 return TypeTest(kIsMoreSpecificThan, other,
5404 bound_error, bound_trail, space); 5404 bound_error, bound_trail, space);
5405 } 5405 }
5406 5406
5407 private: 5407 private:
5408 // Check the subtype or 'more specific' relationship. 5408 // Check the subtype or 'more specific' relationship.
5409 bool TypeTest(TypeTestKind test_kind, 5409 bool TypeTest(TypeTestKind test_kind,
5410 const AbstractType& other, 5410 const AbstractType& other,
5411 Error* bound_error, 5411 Error* bound_error,
5412 TrailPtr bound_trail, 5412 TrailPtr bound_trail,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
5461 virtual RawUnresolvedClass* unresolved_class() const; 5461 virtual RawUnresolvedClass* unresolved_class() const;
5462 virtual RawTypeArguments* arguments() const { return raw_ptr()->arguments_; } 5462 virtual RawTypeArguments* arguments() const { return raw_ptr()->arguments_; }
5463 virtual void set_arguments(const TypeArguments& value) const; 5463 virtual void set_arguments(const TypeArguments& value) const;
5464 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; } 5464 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
5465 virtual bool IsInstantiated(TrailPtr trail = NULL) const; 5465 virtual bool IsInstantiated(TrailPtr trail = NULL) const;
5466 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 5466 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
5467 virtual bool IsRecursive() const; 5467 virtual bool IsRecursive() const;
5468 virtual RawAbstractType* InstantiateFrom( 5468 virtual RawAbstractType* InstantiateFrom(
5469 const TypeArguments& instantiator_type_arguments, 5469 const TypeArguments& instantiator_type_arguments,
5470 Error* bound_error, 5470 Error* bound_error,
5471 TrailPtr instantiation_trail = NULL, 5471 TrailPtr instantiation_trail,
5472 TrailPtr bound_trail = NULL, 5472 TrailPtr bound_trail,
5473 Heap::Space space = Heap::kNew) const; 5473 Heap::Space space) const;
5474 virtual RawAbstractType* CloneUnfinalized() const; 5474 virtual RawAbstractType* CloneUnfinalized() const;
5475 virtual RawAbstractType* CloneUninstantiated( 5475 virtual RawAbstractType* CloneUninstantiated(
5476 const Class& new_owner, 5476 const Class& new_owner,
5477 TrailPtr trail = NULL) const; 5477 TrailPtr trail = NULL) const;
5478 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const; 5478 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
5479 5479
5480 virtual intptr_t Hash() const; 5480 virtual intptr_t Hash() const;
5481 5481
5482 static intptr_t InstanceSize() { 5482 static intptr_t InstanceSize() {
5483 return RoundedAllocationSize(sizeof(RawType)); 5483 return RoundedAllocationSize(sizeof(RawType));
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
5609 virtual RawTypeArguments* arguments() const { return raw_ptr()->arguments_; } 5609 virtual RawTypeArguments* arguments() const { return raw_ptr()->arguments_; }
5610 virtual void set_arguments(const TypeArguments& value) const; 5610 virtual void set_arguments(const TypeArguments& value) const;
5611 RawFunction* signature() const { return raw_ptr()->signature_; } 5611 RawFunction* signature() const { return raw_ptr()->signature_; }
5612 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; } 5612 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
5613 virtual bool IsInstantiated(TrailPtr trail = NULL) const; 5613 virtual bool IsInstantiated(TrailPtr trail = NULL) const;
5614 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 5614 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
5615 virtual bool IsRecursive() const; 5615 virtual bool IsRecursive() const;
5616 virtual RawAbstractType* InstantiateFrom( 5616 virtual RawAbstractType* InstantiateFrom(
5617 const TypeArguments& instantiator_type_arguments, 5617 const TypeArguments& instantiator_type_arguments,
5618 Error* malformed_error, 5618 Error* malformed_error,
5619 TrailPtr instantiation_trail = NULL, 5619 TrailPtr instantiation_trail,
5620 TrailPtr bound_trail = NULL, 5620 TrailPtr bound_trail,
5621 Heap::Space space = Heap::kNew) const; 5621 Heap::Space space) const;
5622 virtual RawAbstractType* CloneUnfinalized() const; 5622 virtual RawAbstractType* CloneUnfinalized() const;
5623 virtual RawAbstractType* CloneUninstantiated( 5623 virtual RawAbstractType* CloneUninstantiated(
5624 const Class& new_owner, 5624 const Class& new_owner,
5625 TrailPtr trail = NULL) const; 5625 TrailPtr trail = NULL) const;
5626 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const; 5626 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
5627 5627
5628 virtual intptr_t Hash() const; 5628 virtual intptr_t Hash() const;
5629 5629
5630 static intptr_t InstanceSize() { 5630 static intptr_t InstanceSize() {
5631 return RoundedAllocationSize(sizeof(RawFunctionType)); 5631 return RoundedAllocationSize(sizeof(RawFunctionType));
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
5686 virtual TokenPosition token_pos() const { 5686 virtual TokenPosition token_pos() const {
5687 return AbstractType::Handle(type()).token_pos(); 5687 return AbstractType::Handle(type()).token_pos();
5688 } 5688 }
5689 virtual bool IsInstantiated(TrailPtr trail = NULL) const; 5689 virtual bool IsInstantiated(TrailPtr trail = NULL) const;
5690 virtual bool IsEquivalent(const Instance& other, 5690 virtual bool IsEquivalent(const Instance& other,
5691 TrailPtr trail = NULL) const; 5691 TrailPtr trail = NULL) const;
5692 virtual bool IsRecursive() const { return true; } 5692 virtual bool IsRecursive() const { return true; }
5693 virtual RawTypeRef* InstantiateFrom( 5693 virtual RawTypeRef* InstantiateFrom(
5694 const TypeArguments& instantiator_type_arguments, 5694 const TypeArguments& instantiator_type_arguments,
5695 Error* bound_error, 5695 Error* bound_error,
5696 TrailPtr instantiation_trail = NULL, 5696 TrailPtr instantiation_trail,
5697 TrailPtr bound_trail = NULL, 5697 TrailPtr bound_trail,
5698 Heap::Space space = Heap::kNew) const; 5698 Heap::Space space) const;
5699 virtual RawTypeRef* CloneUninstantiated( 5699 virtual RawTypeRef* CloneUninstantiated(
5700 const Class& new_owner, 5700 const Class& new_owner,
5701 TrailPtr trail = NULL) const; 5701 TrailPtr trail = NULL) const;
5702 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const; 5702 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const;
5703 5703
5704 virtual intptr_t Hash() const; 5704 virtual intptr_t Hash() const;
5705 5705
5706 static intptr_t InstanceSize() { 5706 static intptr_t InstanceSize() {
5707 return RoundedAllocationSize(sizeof(RawTypeRef)); 5707 return RoundedAllocationSize(sizeof(RawTypeRef));
5708 } 5708 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
5748 void set_index(intptr_t value) const; 5748 void set_index(intptr_t value) const;
5749 RawAbstractType* bound() const { return raw_ptr()->bound_; } 5749 RawAbstractType* bound() const { return raw_ptr()->bound_; }
5750 void set_bound(const AbstractType& value) const; 5750 void set_bound(const AbstractType& value) const;
5751 // Returns true if bounded_type is below upper_bound, otherwise return false 5751 // Returns true if bounded_type is below upper_bound, otherwise return false
5752 // and set bound_error if both bounded_type and upper_bound are instantiated. 5752 // and set bound_error if both bounded_type and upper_bound are instantiated.
5753 // If one or both are not instantiated, returning false only means that the 5753 // If one or both are not instantiated, returning false only means that the
5754 // bound cannot be checked yet and this is not an error. 5754 // bound cannot be checked yet and this is not an error.
5755 bool CheckBound(const AbstractType& bounded_type, 5755 bool CheckBound(const AbstractType& bounded_type,
5756 const AbstractType& upper_bound, 5756 const AbstractType& upper_bound,
5757 Error* bound_error, 5757 Error* bound_error,
5758 TrailPtr bound_trail = NULL, 5758 TrailPtr bound_trail,
5759 Heap::Space space = Heap::kNew) const; 5759 Heap::Space space) const;
5760 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; } 5760 virtual TokenPosition token_pos() const { return raw_ptr()->token_pos_; }
5761 virtual bool IsInstantiated(TrailPtr trail = NULL) const { 5761 virtual bool IsInstantiated(TrailPtr trail = NULL) const {
5762 return false; 5762 return false;
5763 } 5763 }
5764 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 5764 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
5765 virtual bool IsRecursive() const { return false; } 5765 virtual bool IsRecursive() const { return false; }
5766 virtual RawAbstractType* InstantiateFrom( 5766 virtual RawAbstractType* InstantiateFrom(
5767 const TypeArguments& instantiator_type_arguments, 5767 const TypeArguments& instantiator_type_arguments,
5768 Error* bound_error, 5768 Error* bound_error,
5769 TrailPtr instantiation_trail = NULL, 5769 TrailPtr instantiation_trail,
5770 TrailPtr bound_trail = NULL, 5770 TrailPtr bound_trail,
5771 Heap::Space space = Heap::kNew) const; 5771 Heap::Space space) const;
5772 virtual RawAbstractType* CloneUnfinalized() const; 5772 virtual RawAbstractType* CloneUnfinalized() const;
5773 virtual RawAbstractType* CloneUninstantiated( 5773 virtual RawAbstractType* CloneUninstantiated(
5774 const Class& new_owner, TrailPtr trail = NULL) const; 5774 const Class& new_owner, TrailPtr trail = NULL) const;
5775 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const { 5775 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
5776 return raw(); 5776 return raw();
5777 } 5777 }
5778 5778
5779 virtual intptr_t Hash() const; 5779 virtual intptr_t Hash() const;
5780 5780
5781 static intptr_t InstanceSize() { 5781 static intptr_t InstanceSize() {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
5845 // uninstantiated upper bound. Therefore, we do not need to check if the 5845 // uninstantiated upper bound. Therefore, we do not need to check if the
5846 // bound is instantiated. Moreover, doing so could lead into cycles, as in 5846 // bound is instantiated. Moreover, doing so could lead into cycles, as in
5847 // class C<T extends C<C>> { }. 5847 // class C<T extends C<C>> { }.
5848 return AbstractType::Handle(type()).IsInstantiated(); 5848 return AbstractType::Handle(type()).IsInstantiated();
5849 } 5849 }
5850 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const; 5850 virtual bool IsEquivalent(const Instance& other, TrailPtr trail = NULL) const;
5851 virtual bool IsRecursive() const; 5851 virtual bool IsRecursive() const;
5852 virtual RawAbstractType* InstantiateFrom( 5852 virtual RawAbstractType* InstantiateFrom(
5853 const TypeArguments& instantiator_type_arguments, 5853 const TypeArguments& instantiator_type_arguments,
5854 Error* bound_error, 5854 Error* bound_error,
5855 TrailPtr instantiation_trail = NULL, 5855 TrailPtr instantiation_trail,
5856 TrailPtr bound_trail = NULL, 5856 TrailPtr bound_trail,
5857 Heap::Space space = Heap::kNew) const; 5857 Heap::Space space) const;
5858 virtual RawAbstractType* CloneUnfinalized() const; 5858 virtual RawAbstractType* CloneUnfinalized() const;
5859 virtual RawAbstractType* CloneUninstantiated( 5859 virtual RawAbstractType* CloneUninstantiated(
5860 const Class& new_owner, TrailPtr trail = NULL) const; 5860 const Class& new_owner, TrailPtr trail = NULL) const;
5861 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const { 5861 virtual RawAbstractType* Canonicalize(TrailPtr trail = NULL) const {
5862 return raw(); 5862 return raw();
5863 } 5863 }
5864 5864
5865 virtual intptr_t Hash() const; 5865 virtual intptr_t Hash() const;
5866 5866
5867 static intptr_t InstanceSize() { 5867 static intptr_t InstanceSize() {
(...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after
8430 8430
8431 8431
8432 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, 8432 RawObject* MegamorphicCache::GetTargetFunction(const Array& array,
8433 intptr_t index) { 8433 intptr_t index) {
8434 return array.At((index * kEntryLength) + kTargetFunctionIndex); 8434 return array.At((index * kEntryLength) + kTargetFunctionIndex);
8435 } 8435 }
8436 8436
8437 } // namespace dart 8437 } // namespace dart
8438 8438
8439 #endif // VM_OBJECT_H_ 8439 #endif // VM_OBJECT_H_
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698