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

Unified Diff: src/property-details.h

Issue 14629005: Adding fast path for generalizing maps. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 7 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
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property-details.h
diff --git a/src/property-details.h b/src/property-details.h
index dc912c8a0566a123eb11d0907eee5bd3f1e9ab0d..f025f152b7f02c46d641ba53f1b9f6a59d8336b0 100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -99,16 +99,20 @@ class Representation {
static Representation FromKind(Kind kind) { return Representation(kind); }
- bool Equals(const Representation& other) {
+ bool Equals(const Representation& other) const {
return kind_ == other.kind_;
}
- bool is_more_general_than(const Representation& other) {
+ bool is_more_general_than(const Representation& other) const {
ASSERT(kind_ != kExternal);
ASSERT(other.kind_ != kExternal);
return kind_ > other.kind_;
}
+ bool fits_into(const Representation& other) const {
+ return other.is_more_general_than(*this) || other.Equals(*this);
+ }
+
Representation generalize(Representation other) {
if (is_more_general_than(other)) {
return *this;
« no previous file with comments | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698