| 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);
|
| }
|
|
|