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

Unified Diff: runtime/vm/object.h

Issue 81363002: Improve type test and type equality for generics (issue 15148). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 30544)
+++ runtime/vm/object.h (working copy)
@@ -1187,10 +1187,6 @@
// Returns true if all types of this vector are finalized.
virtual bool IsFinalized() const { return true; }
- // Returns true if both arguments represent vectors of equal types.
- static bool AreEqual(const AbstractTypeArguments& arguments,
- const AbstractTypeArguments& other_arguments);
-
// Return 'this' if this type argument vector is instantiated, i.e. if it does
// not refer to type parameters. Otherwise, return a new type argument vector
// where each reference to a type parameter is replaced with the corresponding
@@ -1220,10 +1216,10 @@
return SubvectorName(0, Length(), kUserVisibleName);
}
- // Check if this type argument vector consists solely of DynamicType,
- // considering only a prefix of length 'len'.
- bool IsRaw(intptr_t len) const {
- return IsDynamicTypes(false, len);
+ // Check if the subvector of length 'len' starting at 'from_index' of this
+ // type argument vector consists solely of DynamicType.
+ bool IsRaw(intptr_t from_index, intptr_t len) const {
+ return IsDynamicTypes(false, from_index, len);
}
// Check if this type argument vector would consist solely of DynamicType if
@@ -1231,24 +1227,28 @@
// parameter as it would be first instantiated from a vector of dynamic types.
// Consider only a prefix of length 'len'.
bool IsRawInstantiatedRaw(intptr_t len) const {
- return IsDynamicTypes(true, len);
+ return IsDynamicTypes(true, 0, len);
}
- // Check the subtype relationship, considering only a prefix of length 'len'.
+ // Check the subtype relationship, considering only a subvector of length
+ // 'len' starting at 'from_index'.
bool IsSubtypeOf(const AbstractTypeArguments& other,
+ intptr_t from_index,
intptr_t len,
Error* bound_error) const {
- return TypeTest(kIsSubtypeOf, other, len, bound_error);
+ return TypeTest(kIsSubtypeOf, other, from_index, len, bound_error);
}
- // Check the 'more specific' relationship, considering only a prefix of
- // length 'len'.
+ // Check the 'more specific' relationship, considering only a subvector of
+ // length 'len' starting at 'from_index'.
bool IsMoreSpecificThan(const AbstractTypeArguments& other,
+ intptr_t from_index,
intptr_t len,
Error* bound_error) const {
- return TypeTest(kIsMoreSpecificThan, other, len, bound_error);
+ return TypeTest(kIsMoreSpecificThan, other, from_index, len, bound_error);
}
+ // Check if the vectors are equal.
bool Equals(const AbstractTypeArguments& other) const;
// UNREACHABLEs as AbstractTypeArguments is an abstract class.
@@ -1265,16 +1265,19 @@
virtual intptr_t Hash() const;
private:
- // Check if this type argument vector consists solely of DynamicType,
- // considering only a prefix of length 'len'.
+ // Check if the subvector of length 'len' starting at 'from_index' of this
+ // type argument vector consists solely of DynamicType.
// If raw_instantiated is true, consider each type parameter to be first
// instantiated from a vector of dynamic types.
- bool IsDynamicTypes(bool raw_instantiated, intptr_t len) const;
+ bool IsDynamicTypes(bool raw_instantiated,
+ intptr_t from_index,
+ intptr_t len) const;
// Check the subtype or 'more specific' relationship, considering only a
- // prefix of length 'len'.
+ // subvector of length 'len' starting at 'from_index'.
bool TypeTest(TypeTestKind test_kind,
const AbstractTypeArguments& other,
+ intptr_t from_index,
intptr_t len,
Error* bound_error) const;
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698