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

Unified Diff: src/objects-inl.h

Issue 1177043009: Make sure to flatten names before lookup. Lookup using cons strings is really slow. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 2a74bf2d856296b2f93f5c61e023253f9ccfbb18..c3ee543b7c4e8c6666257688cef2d5db5be1229d 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -3226,6 +3226,12 @@ Handle<String> String::Flatten(Handle<String> string, PretenureFlag pretenure) {
}
+Handle<Name> Name::Flatten(Handle<Name> name, PretenureFlag pretenure) {
+ if (name->IsSymbol()) return name;
+ return String::Flatten(Handle<String>::cast(name));
+}
+
+
uint16_t String::Get(int index) {
DCHECK(index >= 0 && index < length());
switch (StringShape(this).full_representation_tag()) {
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698