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

Unified Diff: src/factory.h

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/crankshaft/hydrogen.h ('k') | src/factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.h
diff --git a/src/factory.h b/src/factory.h
index fbc92222da71301df89b08e3fa076ce43c39de62..5b16d8408459ed5536f3b6c3955f3ce895390817 100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -70,7 +70,7 @@ class Factory final {
Handle<String> InternalizeUtf8String(const char* str) {
return InternalizeUtf8String(CStrVector(str));
}
- Handle<String> InternalizeString(Handle<String> str);
+
Handle<String> InternalizeOneByteString(Vector<const uint8_t> str);
Handle<String> InternalizeOneByteString(
Handle<SeqOneByteString>, int from, int length);
@@ -80,8 +80,16 @@ class Factory final {
template<class StringTableKey>
Handle<String> InternalizeStringWithKey(StringTableKey* key);
- Handle<Name> InternalizeName(Handle<Name> name);
+ // Internalized strings are created in the old generation (data space).
+ Handle<String> InternalizeString(Handle<String> string) {
+ if (string->IsInternalizedString()) return string;
+ return StringTable::LookupString(isolate(), string);
+ }
+ Handle<Name> InternalizeName(Handle<Name> name) {
+ if (name->IsUniqueName()) return name;
+ return StringTable::LookupString(isolate(), Handle<String>::cast(name));
+ }
// String creation functions. Most of the string creation functions take
// a Heap::PretenureFlag argument to optionally request that they be
« no previous file with comments | « src/crankshaft/hydrogen.h ('k') | src/factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698