Commit a439a7a2 authored by Georg Neis's avatar Georg Neis Committed by Commit Bot

[ic] Rename FindFirstName & FindFirstMap to GetName & GetFirstMap

... as there's no search involved and there are never multiple names.

Change-Id: Ice88c4d98195e74f6540926b0a1199df62b42da2
Reviewed-on: https://chromium-review.googlesource.com/c/1466645Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59532}
parent c9ef0405
...@@ -1814,7 +1814,7 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess( ...@@ -1814,7 +1814,7 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess(
} }
// Check if we have feedback for a named access. // Check if we have feedback for a named access.
Name name = nexus.FindFirstName(); Name name = nexus.GetName();
if (!name.is_null()) { if (!name.is_null()) {
return ReduceNamedAccess(node, value, receiver_maps, return ReduceNamedAccess(node, value, receiver_maps,
handle(name, isolate()), access_mode, index); handle(name, isolate()), access_mode, index);
...@@ -2402,7 +2402,7 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreDataPropertyInLiteral( ...@@ -2402,7 +2402,7 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreDataPropertyInLiteral(
DCHECK_EQ(MONOMORPHIC, nexus.ic_state()); DCHECK_EQ(MONOMORPHIC, nexus.ic_state());
Map map = nexus.FindFirstMap(); Map map = nexus.GetFirstMap();
if (map.is_null()) { if (map.is_null()) {
// Maps are weakly held in the type feedback vector, we may not have one. // Maps are weakly held in the type feedback vector, we may not have one.
return NoChange(); return NoChange();
......
...@@ -545,7 +545,7 @@ bool FeedbackNexus::ConfigureMegamorphic(IcCheckType property_type) { ...@@ -545,7 +545,7 @@ bool FeedbackNexus::ConfigureMegamorphic(IcCheckType property_type) {
return changed; return changed;
} }
Map FeedbackNexus::FindFirstMap() const { Map FeedbackNexus::GetFirstMap() const {
MapHandles maps; MapHandles maps;
ExtractMaps(&maps); ExtractMaps(&maps);
if (maps.size() > 0) return *maps.at(0); if (maps.size() > 0) return *maps.at(0);
...@@ -1061,7 +1061,7 @@ bool FeedbackNexus::FindHandlers(MaybeObjectHandles* code_list, ...@@ -1061,7 +1061,7 @@ bool FeedbackNexus::FindHandlers(MaybeObjectHandles* code_list,
return count == length; return count == length;
} }
Name FeedbackNexus::FindFirstName() const { Name FeedbackNexus::GetName() const {
if (IsKeyedStoreICKind(kind()) || IsKeyedLoadICKind(kind())) { if (IsKeyedStoreICKind(kind()) || IsKeyedLoadICKind(kind())) {
MaybeObject feedback = GetFeedback(); MaybeObject feedback = GetFeedback();
if (IsPropertyNameFeedback(feedback)) { if (IsPropertyNameFeedback(feedback)) {
......
...@@ -604,7 +604,7 @@ class FeedbackNexus final { ...@@ -604,7 +604,7 @@ class FeedbackNexus final {
void Print(std::ostream& os); // NOLINT void Print(std::ostream& os); // NOLINT
// For map-based ICs (load, keyed-load, store, keyed-store). // For map-based ICs (load, keyed-load, store, keyed-store).
Map FindFirstMap() const; Map GetFirstMap() const;
InlineCacheState StateFromFeedback() const; InlineCacheState StateFromFeedback() const;
int ExtractMaps(MapHandles* maps) const; int ExtractMaps(MapHandles* maps) const;
...@@ -648,7 +648,7 @@ class FeedbackNexus final { ...@@ -648,7 +648,7 @@ class FeedbackNexus final {
// For KeyedLoad and KeyedStore ICs. // For KeyedLoad and KeyedStore ICs.
IcCheckType GetKeyType() const; IcCheckType GetKeyType() const;
Name FindFirstName() const; Name GetName() const;
// For Call ICs. // For Call ICs.
int GetCallCount(); int GetCallCount();
......
...@@ -277,7 +277,7 @@ bool IC::RecomputeHandlerForName(Handle<Object> name) { ...@@ -277,7 +277,7 @@ bool IC::RecomputeHandlerForName(Handle<Object> name) {
if (is_keyed()) { if (is_keyed()) {
// Determine whether the failure is due to a name failure. // Determine whether the failure is due to a name failure.
if (!name->IsName()) return false; if (!name->IsName()) return false;
Name stub_name = nexus()->FindFirstName(); Name stub_name = nexus()->GetName();
if (*name != stub_name) return false; if (*name != stub_name) return false;
} }
...@@ -547,7 +547,7 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, ...@@ -547,7 +547,7 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
const MaybeObjectHandle& handler) { const MaybeObjectHandle& handler) {
DCHECK(IsHandler(*handler)); DCHECK(IsHandler(*handler));
if (is_keyed() && state() != RECOMPUTE_HANDLER) { if (is_keyed() && state() != RECOMPUTE_HANDLER) {
if (nexus()->FindFirstName() != *name) return false; if (nexus()->GetName() != *name) return false;
} }
Handle<Map> map = receiver_map(); Handle<Map> map = receiver_map();
MapHandles maps; MapHandles maps;
...@@ -596,7 +596,7 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name, ...@@ -596,7 +596,7 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
if (number_of_valid_maps == 1) { if (number_of_valid_maps == 1) {
ConfigureVectorState(name, receiver_map(), handler); ConfigureVectorState(name, receiver_map(), handler);
} else { } else {
if (is_keyed() && nexus()->FindFirstName() != *name) return false; if (is_keyed() && nexus()->GetName() != *name) return false;
if (handler_to_overwrite >= 0) { if (handler_to_overwrite >= 0) {
handlers[handler_to_overwrite] = handler; handlers[handler_to_overwrite] = handler;
if (!map.is_identical_to(maps.at(handler_to_overwrite))) { if (!map.is_identical_to(maps.at(handler_to_overwrite))) {
......
...@@ -785,7 +785,7 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyInLiteral) { ...@@ -785,7 +785,7 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyInLiteral) {
nexus.ConfigureMegamorphic(PROPERTY); nexus.ConfigureMegamorphic(PROPERTY);
} }
} else if (nexus.ic_state() == MONOMORPHIC) { } else if (nexus.ic_state() == MONOMORPHIC) {
if (nexus.FindFirstMap() != object->map() || if (nexus.GetFirstMap() != object->map() ||
nexus.GetFeedbackExtra() != MaybeObject::FromObject(*name)) { nexus.GetFeedbackExtra() != MaybeObject::FromObject(*name)) {
nexus.ConfigureMegamorphic(PROPERTY); nexus.ConfigureMegamorphic(PROPERTY);
} }
......
...@@ -433,7 +433,7 @@ TEST(VectorLoadICStates) { ...@@ -433,7 +433,7 @@ TEST(VectorLoadICStates) {
CcTest::global()->Get(context.local(), v8_str("o")); CcTest::global()->Get(context.local(), v8_str("o"));
Handle<JSObject> o = Handle<JSObject> o =
Handle<JSObject>::cast(v8::Utils::OpenHandle(*v8_o.ToLocalChecked())); Handle<JSObject>::cast(v8::Utils::OpenHandle(*v8_o.ToLocalChecked()));
CHECK_EQ(o->map(), nexus.FindFirstMap()); CHECK_EQ(o->map(), nexus.GetFirstMap());
// Now go polymorphic. // Now go polymorphic.
CompileRun("f({ blarg: 3, foo: 2 })"); CompileRun("f({ blarg: 3, foo: 2 })");
...@@ -453,7 +453,7 @@ TEST(VectorLoadICStates) { ...@@ -453,7 +453,7 @@ TEST(VectorLoadICStates) {
// Finally driven megamorphic. // Finally driven megamorphic.
CompileRun("f({ blarg: 3, gran: 3, torino: 10, foo: 2 })"); CompileRun("f({ blarg: 3, gran: 3, torino: 10, foo: 2 })");
CHECK_EQ(MEGAMORPHIC, nexus.StateFromFeedback()); CHECK_EQ(MEGAMORPHIC, nexus.StateFromFeedback());
CHECK(nexus.FindFirstMap().is_null()); CHECK(nexus.GetFirstMap().is_null());
// After a collection, state should not be reset to PREMONOMORPHIC. // After a collection, state should not be reset to PREMONOMORPHIC.
CcTest::CollectAllGarbage(); CcTest::CollectAllGarbage();
...@@ -523,7 +523,7 @@ TEST(VectorLoadICOnSmi) { ...@@ -523,7 +523,7 @@ TEST(VectorLoadICOnSmi) {
CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback()); CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback());
// Verify that the monomorphic map is the one we expect. // Verify that the monomorphic map is the one we expect.
Map number_map = ReadOnlyRoots(heap).heap_number_map(); Map number_map = ReadOnlyRoots(heap).heap_number_map();
CHECK_EQ(number_map, nexus.FindFirstMap()); CHECK_EQ(number_map, nexus.GetFirstMap());
// Now go polymorphic on o. // Now go polymorphic on o.
CompileRun("f(o)"); CompileRun("f(o)");
......
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