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

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: 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
« src/objects.cc ('K') | « 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..6f16b3344e8ca5648892fea9f2cc154b2f14577b 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(const Representation& other) const {
danno 2013/05/02 14:26:41 how about "fits_in"? Easier to read e.g. (if this-
Toon Verwaest 2013/05/02 15:15:57 Done.
+ return other.is_more_general_than(*this) || other.Equals(*this);
+ }
+
Representation generalize(Representation other) {
if (is_more_general_than(other)) {
return *this;
« src/objects.cc ('K') | « src/objects.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698