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

Unified Diff: src/types.cc

Issue 1217803004: Add a type for objects with typed properties. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 6 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
« no previous file with comments | « src/types.h ('k') | src/types-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/types.cc
diff --git a/src/types.cc b/src/types.cc
index 1c6b84e2dc67da07ce3c809810b163bf306e2ca1..f07196a06c7816b062eb1b87708c28bd20aaad93 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -180,6 +180,7 @@ TypeImpl<Config>::BitsetType::Lub(TypeImpl* type) {
if (type->IsContext()) return kInternal & kTaggedPointer;
if (type->IsArray()) return kOtherObject;
if (type->IsFunction()) return kOtherObject; // TODO(rossberg): kFunction
+ if (type->IsObject()) return kOtherObject;
UNREACHABLE();
return kNone;
}
@@ -473,6 +474,18 @@ bool TypeImpl<Config>::SimplyEquals(TypeImpl* that) {
}
return true;
}
+ if (that->IsObject()) {
+ if (!this->IsObject()) return false;
+ ObjectType* this_obj = this->AsObject();
+ ObjectType* that_obj = that->AsObject();
+ if (this_obj->Width() < that_obj->Width()) return false;
+ for (int i = 0; i < that_obj->Width(); ++i) {
+ if (!this_obj->Name(i)->Equals(*that_obj->Name(i)) ||
+ !this_obj->Property(i)->Equals(that_obj->Property(i)))
+ return false;
+ }
+ return true;
+ }
UNREACHABLE();
return false;
}
« no previous file with comments | « src/types.h ('k') | src/types-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698