Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 11c4ed7f15c88bb2809d06084424fd81c2562138..de0d756966db9720d9a284d1f5d3a565add14ea1 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -11139,8 +11139,8 @@ |
value |= length << String::ArrayIndexLengthBits::kShift; |
DCHECK((value & String::kIsNotArrayIndexMask) == 0); |
- DCHECK_EQ(length <= String::kMaxCachedArrayIndexLength, |
- (value & String::kContainsCachedArrayIndexMask) == 0); |
+ DCHECK((length > String::kMaxCachedArrayIndexLength) || |
+ (value & String::kContainsCachedArrayIndexMask) == 0); |
return value; |
} |
@@ -15170,11 +15170,6 @@ |
} |
} |
} |
-template <typename Derived, typename Shape, typename Key> |
-void Dictionary<Derived, Shape, Key>::Print() { |
- OFStream os(stdout); |
- Print(os); |
-} |
#endif |
@@ -15906,7 +15901,15 @@ |
Object* element = this->get(index); |
if (element->IsUndefined()) break; // Empty entry. |
if (*key == element) return entry; |
- DCHECK(element->IsTheHole() || element->IsUniqueName()); |
+ if (!element->IsUniqueName() && |
+ !element->IsTheHole() && |
+ Name::cast(element)->Equals(*key)) { |
+ // Replace a key that is a non-internalized string by the equivalent |
+ // internalized string for faster further lookups. |
+ this->set(index, *key); |
+ return entry; |
+ } |
+ DCHECK(element->IsTheHole() || !Name::cast(element)->Equals(*key)); |
entry = Derived::NextProbe(entry, count++, capacity); |
} |
return Derived::kNotFound; |