Commit 1bdf1001 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[turbofan] Don't specialize for keyed access with constant name

Instead optimize based on the name feedback. This simplifies matters
for concurrent optimization.

Drive-by: Rename "index" to "key" for clarity where appropriate.

Bug: v8:7790
Change-Id: Id6db1174c7840c24044bc655e0ffee6a5b0de21c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1559742
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60709}
parent a667b6b3
......@@ -614,11 +614,7 @@ StringData* StringData::GetCharAsString(JSHeapBroker* broker, uint32_t index,
InternalizedStringData::InternalizedStringData(
JSHeapBroker* broker, ObjectData** storage,
Handle<InternalizedString> object)
: StringData(broker, storage, object) {
if (!object->AsArrayIndex(&array_index_)) {
array_index_ = InternalizedStringRef::kNotAnArrayIndex;
}
}
: StringData(broker, storage, object) {}
namespace {
......@@ -2428,19 +2424,6 @@ base::Optional<double> StringRef::ToNumber() {
return data()->AsString()->to_number();
}
uint32_t InternalizedStringRef::array_index() const {
if (broker()->mode() == JSHeapBroker::kDisabled) {
AllowHandleDereference allow_handle_dereference;
AllowHandleAllocation allow_handle_allocation;
uint32_t result;
if (!object()->AsArrayIndex(&result)) {
result = kNotAnArrayIndex;
}
return result;
}
return data()->AsInternalizedString()->array_index();
}
ObjectRef FixedArrayRef::get(int i) const {
if (broker()->mode() == JSHeapBroker::kDisabled) {
AllowHandleAllocation handle_allocation;
......
......@@ -652,9 +652,6 @@ class InternalizedStringRef : public StringRef {
public:
using StringRef::StringRef;
Handle<InternalizedString> object() const;
uint32_t array_index() const;
static const uint32_t kNotAnArrayIndex = -1; // 2^32-1 is not a valid index.
};
class ProcessedFeedback : public ZoneObject {
......
......@@ -98,7 +98,7 @@ class V8_EXPORT_PRIVATE JSNativeContextSpecialization final
AccessMode access_mode,
KeyedAccessLoadMode load_mode,
KeyedAccessStoreMode store_mode);
Reduction ReduceKeyedAccess(Node* node, Node* index, Node* value,
Reduction ReduceKeyedAccess(Node* node, Node* key, Node* value,
FeedbackNexus const& nexus,
AccessMode access_mode,
KeyedAccessLoadMode load_mode,
......@@ -110,15 +110,14 @@ class V8_EXPORT_PRIVATE JSNativeContextSpecialization final
Reduction ReduceNamedAccess(Node* node, Node* value,
MapHandles const& receiver_maps,
Handle<Name> name, AccessMode access_mode,
Node* index = nullptr);
Node* key = nullptr);
Reduction ReduceGlobalAccess(Node* node, Node* receiver, Node* value,
Handle<Name> name, AccessMode access_mode,
Node* index = nullptr);
Node* key = nullptr);
Reduction ReduceGlobalAccess(Node* node, Node* receiver, Node* value,
Handle<Name> name, AccessMode access_mode,
Node* index,
PropertyCellRef const& property_cell);
Reduction ReduceKeyedLoadFromHeapConstant(Node* node, Node* index,
Node* key, PropertyCellRef const& property_cell);
Reduction ReduceKeyedLoadFromHeapConstant(Node* node, Node* key,
FeedbackNexus const& nexus,
AccessMode access_mode,
KeyedAccessLoadMode load_mode);
......
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