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

Unified Diff: runtime/vm/object.cc

Issue 10209002: Progress toward inlined type checks for classes with type arguments: factor out code, optimize typ… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 6912)
+++ runtime/vm/object.cc (working copy)
@@ -2739,6 +2739,32 @@
}
+bool InstantiatedType::Equals(const AbstractType& other) const {
+ if (raw() == other.raw()) {
+ return true;
+ }
+ if (!other.IsInstantiatedType()) {
+ return false;
+ }
+ InstantiatedType& other_instantiated = InstantiatedType::Handle();
+ other_instantiated ^= other.raw();
+ if (IsFinalized() != other_instantiated.IsFinalized()) {
regis 2012/04/25 01:53:53 I do not think this is necessary. An InstantiatedT
srdjan 2012/04/25 16:38:01 Is is used for canonicalization. Will try to do it
+ return false;
+ }
+ const AbstractType& this_type = AbstractType::Handle(uninstantiated_type());
+ const AbstractType& other_type =
+ AbstractType::Handle(other_instantiated.uninstantiated_type());
+ if (!this_type.Equals(other_type)) {
+ return false;
+ }
+ if (instantiator_type_arguments() !=
regis 2012/04/25 01:53:53 Using != is not correct. You should be using Equal
srdjan 2012/04/25 16:38:01 Using AreEqual.
+ other_instantiated.instantiator_type_arguments()) {
+ return false;
+ }
+ return true;
+}
+
+
const char* InstantiatedType::ToCString() const {
return "InstantiatedType";
}

Powered by Google App Engine
This is Rietveld 408576698