[CSA][cleanup] Use Name instead of String type for var_name in KeyedLoadICGeneric.

BUG=v8:6949,v8:9396,chromium:1004912

Change-Id: Ifa8207283aadad258281bffda6d49da574402a24
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1809370
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Auto-Submit: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63865}
This commit is contained in:
Ross McIlroy 2019-09-18 11:40:58 +01:00 committed by Commit Bot
parent 761a2e7111
commit b946521f18
2 changed files with 15 additions and 2 deletions

View File

@ -3007,7 +3007,7 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
}
{
TVARIABLE(String, var_name);
TVARIABLE(Name, var_name);
BIND(&if_other);
{
@ -3019,6 +3019,7 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
BIND(&if_notunique);
{
// Try to make it unique by internalizing.
var_name = CAST(p->name());
Goto(&maybe_internalize_on_the_fly);
}
@ -3031,7 +3032,7 @@ void AccessorAssembler::KeyedLoadICGeneric(const LoadICParameters* p) {
// invariant doesn't hold with named property interceptors (at this
// point), so we take the {if_runtime} path instead.
Label if_in_string_table(this);
TryInternalizeString(var_name.value(), &if_index, &var_index,
TryInternalizeString(CAST(var_name.value()), &if_index, &var_index,
&if_in_string_table, &var_unique, &if_runtime,
&if_runtime);

View File

@ -0,0 +1,12 @@
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
var key = {
toString() {
return Symbol();
}
};
var obj = {};
obj[key];