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

Unified Diff: src/factory.cc

Issue 1704353002: [runtime] Force internalize names used before lookup in in DescriptorArray and TransitionArray (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/factory.h ('k') | src/heap/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698