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

Unified Diff: src/property-details.h

Issue 14996004: Track heap objects. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 7 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-inl.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | 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 62140fe9629944f6a1a91afeb8195690adb9050e..674fc8869ad58b59e17e0a85df999a0c74563974 100644
--- a/src/property-details.h
+++ b/src/property-details.h
@@ -83,6 +83,7 @@ class Representation {
kSmi,
kInteger32,
kDouble,
+ kHeapObject,
kTagged,
kExternal,
kNumRepresentations
@@ -95,6 +96,7 @@ class Representation {
static Representation Smi() { return Representation(kSmi); }
static Representation Integer32() { return Representation(kInteger32); }
static Representation Double() { return Representation(kDouble); }
+ static Representation HeapObject() { return Representation(kHeapObject); }
static Representation External() { return Representation(kExternal); }
static Representation FromKind(Kind kind) { return Representation(kind); }
@@ -111,6 +113,7 @@ class Representation {
bool is_more_general_than(const Representation& other) const {
ASSERT(kind_ != kExternal);
ASSERT(other.kind_ != kExternal);
+ if (IsHeapObject()) return other.IsDouble();
return kind_ > other.kind_;
}
@@ -119,11 +122,9 @@ class Representation {
}
Representation generalize(Representation other) {
- if (is_more_general_than(other)) {
- return *this;
- } else {
- return other;
- }
+ if (other.fits_into(*this)) return *this;
+ if (other.is_more_general_than(*this)) return other;
+ return Representation::Tagged();
}
Kind kind() const { return static_cast<Kind>(kind_); }
@@ -132,6 +133,7 @@ class Representation {
bool IsSmi() const { return kind_ == kSmi; }
bool IsInteger32() const { return kind_ == kInteger32; }
bool IsDouble() const { return kind_ == kDouble; }
+ bool IsHeapObject() const { return kind_ == kHeapObject; }
bool IsExternal() const { return kind_ == kExternal; }
bool IsSpecialization() const {
return kind_ == kInteger32 || kind_ == kDouble;
« no previous file with comments | « src/objects-inl.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698