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

Unified Diff: src/compiler/types.cc

Issue 2390823011: [turbofan] HeapConstant types should compare by handle address (Closed)
Patch Set: HeapConstantType holds a HeapObject. Created 4 years, 2 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/compiler/types.h ('k') | test/cctest/test-types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/types.cc
diff --git a/src/compiler/types.cc b/src/compiler/types.cc
index 3827cccd9f599ebfe916f01280b62a9fa7455c2f..4ae749d535c5c390c86a020cee14994acac3c04e 100644
--- a/src/compiler/types.cc
+++ b/src/compiler/types.cc
@@ -402,11 +402,9 @@ bool OtherNumberConstantType::IsOtherNumberConstant(Object* value) {
}
HeapConstantType::HeapConstantType(BitsetType::bitset bitset,
- i::Handle<i::Object> object)
+ i::Handle<i::HeapObject> object)
: TypeBase(kHeapConstant), bitset_(bitset), object_(object) {
- // All number types should be expressed as Ranges, OtherNumberConstants,
- // or bitsets (nan, negative-zero).
- DCHECK(!object->IsSmi() && !object->IsHeapNumber());
+ DCHECK(!object->IsHeapNumber());
}
// -----------------------------------------------------------------------------
@@ -416,7 +414,8 @@ bool Type::SimplyEquals(Type* that) {
DisallowHeapAllocation no_allocation;
if (this->IsHeapConstant()) {
return that->IsHeapConstant() &&
- *this->AsHeapConstant()->Value() == *that->AsHeapConstant()->Value();
+ this->AsHeapConstant()->Value().address() ==
+ that->AsHeapConstant()->Value().address();
}
if (this->IsOtherNumberConstant()) {
return that->IsOtherNumberConstant() &&
@@ -782,7 +781,7 @@ Type* Type::NewConstant(i::Handle<i::Object> value, Zone* zone) {
} else if (value->IsHeapNumber()) {
return NewConstant(value->Number(), zone);
}
- return HeapConstant(value, zone);
+ return HeapConstant(i::Handle<i::HeapObject>::cast(value), zone);
}
Type* Type::Union(Type* type1, Type* type2, Zone* zone) {
« no previous file with comments | « src/compiler/types.h ('k') | test/cctest/test-types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698