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/compiler/types.cc

Issue 2402313003: [turbofan] Quit storing strings in types. (Closed)
Patch Set: Removed StringFromCharCodeTyper optimization. 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/typer.cc ('k') | test/unittests/compiler/graph-unittest.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 6b308232674aa7d556d26cb16fbe80d9df15b9d1..14bfdddc2f5755492dd1eaae506564d064b69d2e 100644
--- a/src/compiler/types.cc
+++ b/src/compiler/types.cc
@@ -406,6 +406,7 @@ HeapConstantType::HeapConstantType(BitsetType::bitset bitset,
i::Handle<i::HeapObject> object)
: TypeBase(kHeapConstant), bitset_(bitset), object_(object) {
DCHECK(!object->IsHeapNumber());
+ DCHECK(!object->IsString());
}
// -----------------------------------------------------------------------------
@@ -781,6 +782,17 @@ Type* Type::NewConstant(i::Handle<i::Object> value, Zone* zone) {
return Range(v, v, zone);
} else if (value->IsHeapNumber()) {
return NewConstant(value->Number(), zone);
+ } else if (value->IsString()) {
+ bitset b = BitsetType::Lub(*value);
+ DCHECK(b == BitsetType::kInternalizedString ||
+ b == BitsetType::kOtherString);
+ if (b == BitsetType::kInternalizedString) {
+ return Type::InternalizedString();
+ } else if (b == BitsetType::kOtherString) {
+ return Type::OtherString();
+ } else {
+ UNREACHABLE();
+ }
}
return HeapConstant(i::Handle<i::HeapObject>::cast(value), zone);
}
« no previous file with comments | « src/compiler/typer.cc ('k') | test/unittests/compiler/graph-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698