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

Unified Diff: src/lookup.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/api.cc ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.h
diff --git a/src/lookup.h b/src/lookup.h
index c2b98070c04c52b2b9cdcd913b971354cabe7b10..d0ee6cb54dfc589ff68eb6718677868f3bf939b6 100644
--- a/src/lookup.h
+++ b/src/lookup.h
@@ -52,7 +52,7 @@ class LookupIterator final BASE_EMBEDDED {
interceptor_state_(InterceptorState::kUninitialized),
property_details_(PropertyDetails::Empty()),
isolate_(name->GetIsolate()),
- name_(name),
+ name_(Name::Flatten(name)),
// kMaxUInt32 isn't a valid index.
index_(kMaxUInt32),
receiver_(receiver),
@@ -76,7 +76,7 @@ class LookupIterator final BASE_EMBEDDED {
interceptor_state_(InterceptorState::kUninitialized),
property_details_(PropertyDetails::Empty()),
isolate_(name->GetIsolate()),
- name_(name),
+ name_(Name::Flatten(name)),
// kMaxUInt32 isn't a valid index.
index_(kMaxUInt32),
receiver_(receiver),
@@ -135,6 +135,7 @@ class LookupIterator final BASE_EMBEDDED {
static LookupIterator PropertyOrElement(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Configuration configuration = DEFAULT) {
+ name = Name::Flatten(name);
uint32_t index;
LookupIterator it =
name->AsArrayIndex(&index)
@@ -147,6 +148,7 @@ class LookupIterator final BASE_EMBEDDED {
static LookupIterator PropertyOrElement(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Handle<JSReceiver> holder, Configuration configuration = DEFAULT) {
+ name = Name::Flatten(name);
uint32_t index;
LookupIterator it =
name->AsArrayIndex(&index)
@@ -155,6 +157,7 @@ class LookupIterator final BASE_EMBEDDED {
it.name_ = name;
return it;
}
+
Isolate* isolate() const { return isolate_; }
State state() const { return state_; }
« no previous file with comments | « src/api.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698