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, ...@@ -2229,9 +2229,6 @@ Handle<String> Factory::NumberToString(Handle<Object> number,
// We tenure the allocated string since it is referenced from the // We tenure the allocated string since it is referenced from the
// number-string cache which lives in the old space. // number-string cache which lives in the old space.
Handle<String> js_string = NewStringFromAsciiChecked(str, TENURED); 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); SetNumberStringCache(number, js_string);
return js_string; return js_string;
} }
......
...@@ -38,7 +38,7 @@ LookupIterator LookupIterator::PropertyOrElement(Isolate* isolate, ...@@ -38,7 +38,7 @@ LookupIterator LookupIterator::PropertyOrElement(Isolate* isolate,
LookupIterator it(isolate, receiver, index, configuration); LookupIterator it(isolate, receiver, index, configuration);
// Here we try to avoid having to rebuild the string later // Here we try to avoid having to rebuild the string later
// by storing it on the indexed LookupIterator. // by storing it on the indexed LookupIterator.
it.name_ = isolate->factory()->InternalizeName(name); it.name_ = name;
return it; return it;
} }
......
...@@ -127,27 +127,27 @@ class LookupIterator final BASE_EMBEDDED { ...@@ -127,27 +127,27 @@ class LookupIterator final BASE_EMBEDDED {
static LookupIterator PropertyOrElement( static LookupIterator PropertyOrElement(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name, Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Configuration configuration = DEFAULT) { Configuration configuration = DEFAULT) {
name = isolate->factory()->InternalizeName(name);
uint32_t index; uint32_t index;
LookupIterator it = if (name->AsArrayIndex(&index)) {
name->AsArrayIndex(&index) LookupIterator it =
? LookupIterator(isolate, receiver, index, configuration) LookupIterator(isolate, receiver, index, configuration);
: LookupIterator(receiver, name, configuration); it.name_ = name;
it.name_ = name; return it;
return it; }
return LookupIterator(receiver, name, configuration);
} }
static LookupIterator PropertyOrElement( static LookupIterator PropertyOrElement(
Isolate* isolate, Handle<Object> receiver, Handle<Name> name, Isolate* isolate, Handle<Object> receiver, Handle<Name> name,
Handle<JSReceiver> holder, Configuration configuration = DEFAULT) { Handle<JSReceiver> holder, Configuration configuration = DEFAULT) {
name = isolate->factory()->InternalizeName(name);
uint32_t index; uint32_t index;
LookupIterator it = if (name->AsArrayIndex(&index)) {
name->AsArrayIndex(&index) LookupIterator it =
? LookupIterator(isolate, receiver, index, holder, configuration) LookupIterator(isolate, receiver, index, holder, configuration);
: LookupIterator(receiver, name, holder, configuration); it.name_ = name;
it.name_ = name; return it;
return it; }
return LookupIterator(receiver, name, holder, configuration);
} }
static LookupIterator PropertyOrElement( 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