Commit e22f046f authored by verwaest's avatar verwaest Committed by Commit bot

Don't internalize names that are array indexes since they aren't used for lookup (the index is)

This should restore the splay regression.

BUG=

Review URL: https://codereview.chromium.org/1714753003

Cr-Commit-Position: refs/heads/master@{#34144}
parent 7624465b
......@@ -2229,9 +2229,6 @@ 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;
}
......
......@@ -38,7 +38,7 @@ LookupIterator LookupIterator::PropertyOrElement(Isolate* isolate,
LookupIterator it(isolate, receiver, index, configuration);
// Here we try to avoid having to rebuild the string later
// by storing it on the indexed LookupIterator.
it.name_ = isolate->factory()->InternalizeName(name);
it.name_ = name;
return it;
}
......
......@@ -127,27 +127,27 @@ class LookupIterator final BASE_EMBEDDED {
static LookupIterator PropertyOrElement(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Configuration configuration = DEFAULT) {
name = isolate->factory()->InternalizeName(name);
uint32_t index;
LookupIterator it =
name->AsArrayIndex(&index)
? LookupIterator(isolate, receiver, index, configuration)
: LookupIterator(receiver, name, configuration);
it.name_ = name;
return it;
if (name->AsArrayIndex(&index)) {
LookupIterator it =
LookupIterator(isolate, receiver, index, configuration);
it.name_ = name;
return it;
}
return LookupIterator(receiver, name, configuration);
}
static LookupIterator PropertyOrElement(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Handle<JSReceiver> holder, Configuration configuration = DEFAULT) {
name = isolate->factory()->InternalizeName(name);
uint32_t index;
LookupIterator it =
name->AsArrayIndex(&index)
? LookupIterator(isolate, receiver, index, holder, configuration)
: LookupIterator(receiver, name, holder, configuration);
it.name_ = name;
return it;
if (name->AsArrayIndex(&index)) {
LookupIterator it =
LookupIterator(isolate, receiver, index, holder, configuration);
it.name_ = name;
return it;
}
return LookupIterator(receiver, name, holder, configuration);
}
static LookupIterator PropertyOrElement(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment