Commit ffcb51b2 authored by Shiyu Zhang's avatar Shiyu Zhang Committed by Commit Bot

[ic] Do not convert undefined key to undefined_string.

In the special case of KeyedLoadIC, where the key is always undefined,
LowerCheckEqualsInternalizedString fails and triggers deoptimization
loops. It's because {exp}, which is undefined_string, does not match
{val}, which is undefined_value.

This patch drops the convertion from undefined_value to undefined_string
for undefined key in KeyedLoadIC. It makes undefined key be able to pass
LowerCheckEqualsInternalizedString and avoids the deoptimization loops.

Bug: 
Change-Id: Ie15358e705490fb2e4907f4d37a3ef7921f74844
Reviewed-on: https://chromium-review.googlesource.com/789613
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarIgor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49779}
parent 2a50797d
......@@ -957,8 +957,6 @@ static Handle<Object> TryConvertKey(Handle<Object> key, Isolate* isolate) {
key = handle(Smi::FromInt(int_value), isolate);
}
}
} else if (key->IsUndefined(isolate)) {
key = isolate->factory()->undefined_string();
} else if (key->IsString()) {
key = isolate->factory()->InternalizeString(Handle<String>::cast(key));
}
......
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