Commit 20a803fd authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[runtime] Make sure we don't internalize string-encoded indices on KeyedGetProperty

BUG=chromium:703226

Change-Id: I2232d4a721beb35478066b25143b9635bcc6b238
Reviewed-on: https://chromium-review.googlesource.com/458429Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44073}
parent a2687daa
......@@ -50,6 +50,13 @@ static MaybeHandle<Object> KeyedGetObjectProperty(Isolate* isolate,
//
// Additionally, we need to make sure that we do not cache results
// for objects that require access checks.
// Convert string-index keys to their number variant to avoid internalization
// below; and speed up subsequent conversion to index.
uint32_t index;
if (key_obj->IsString() && String::cast(*key_obj)->AsArrayIndex(&index)) {
key_obj = isolate->factory()->NewNumberFromUint(index);
}
if (receiver_obj->IsJSObject()) {
if (!receiver_obj->IsJSGlobalProxy() &&
!receiver_obj->IsAccessCheckNeeded() && key_obj->IsName()) {
......
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