Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 339b9ba1627c3270f72dc63bf67ac79ce4335592..235faa3c3998dc1f9e22db7948927177d51abf92 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -211,13 +211,6 @@ Handle<String> Factory::InternalizeUtf8String(Vector<const char> string) { |
} |
-// Internalized strings are created in the old generation (data space). |
-Handle<String> Factory::InternalizeString(Handle<String> string) { |
- if (string->IsInternalizedString()) return string; |
- return StringTable::LookupString(isolate(), string); |
-} |
- |
- |
Handle<String> Factory::InternalizeOneByteString(Vector<const uint8_t> string) { |
OneByteStringKey key(string, isolate()->heap()->HashSeed()); |
return InternalizeStringWithKey(&key); |
@@ -243,12 +236,6 @@ Handle<String> Factory::InternalizeStringWithKey(StringTableKey* key) { |
} |
-Handle<Name> Factory::InternalizeName(Handle<Name> name) { |
- if (name->IsUniqueName()) return name; |
- return InternalizeString(Handle<String>::cast(name)); |
-} |
- |
- |
MaybeHandle<String> Factory::NewStringFromOneByte(Vector<const uint8_t> string, |
PretenureFlag pretenure) { |
int length = string.length(); |
@@ -2242,6 +2229,9 @@ Handle<String> Factory::NumberToString(Handle<Object> number, |
// We tenure the allocated string since it is referenced from the |
// number-string cache which lives in the old space. |
Handle<String> js_string = NewStringFromAsciiChecked(str, TENURED); |
+ // Make sure the string cached in the number cache is also the internalized |
+ // version of the same string. |
+ js_string = InternalizeString(js_string); |
SetNumberStringCache(number, js_string); |
return js_string; |
} |