[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/1466645
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59532}
This commit is contained in:
Georg Neis 2019-02-12 13:27:10 +01:00 committed by Commit Bot
parent c9ef0405c7
commit a439a7a210
6 changed files with 13 additions and 13 deletions

View File

@ -1814,7 +1814,7 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess(
}
// Check if we have feedback for a named access.
Name name = nexus.FindFirstName();
Name name = nexus.GetName();
if (!name.is_null()) {
return ReduceNamedAccess(node, value, receiver_maps,
handle(name, isolate()), access_mode, index);
@ -2402,7 +2402,7 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreDataPropertyInLiteral(
DCHECK_EQ(MONOMORPHIC, nexus.ic_state());
Map map = nexus.FindFirstMap();
Map map = nexus.GetFirstMap();
if (map.is_null()) {
// Maps are weakly held in the type feedback vector, we may not have one.
return NoChange();

View File

@ -545,7 +545,7 @@ bool FeedbackNexus::ConfigureMegamorphic(IcCheckType property_type) {
return changed;
}
Map FeedbackNexus::FindFirstMap() const {
Map FeedbackNexus::GetFirstMap() const {
MapHandles maps;
ExtractMaps(&maps);
if (maps.size() > 0) return *maps.at(0);
@ -1061,7 +1061,7 @@ bool FeedbackNexus::FindHandlers(MaybeObjectHandles* code_list,
return count == length;
}
Name FeedbackNexus::FindFirstName() const {
Name FeedbackNexus::GetName() const {
if (IsKeyedStoreICKind(kind()) || IsKeyedLoadICKind(kind())) {
MaybeObject feedback = GetFeedback();
if (IsPropertyNameFeedback(feedback)) {

View File

@ -604,7 +604,7 @@ class FeedbackNexus final {
void Print(std::ostream& os); // NOLINT
// For map-based ICs (load, keyed-load, store, keyed-store).
Map FindFirstMap() const;
Map GetFirstMap() const;
InlineCacheState StateFromFeedback() const;
int ExtractMaps(MapHandles* maps) const;
@ -648,7 +648,7 @@ class FeedbackNexus final {
// For KeyedLoad and KeyedStore ICs.
IcCheckType GetKeyType() const;
Name FindFirstName() const;
Name GetName() const;
// For Call ICs.
int GetCallCount();

View File

@ -277,7 +277,7 @@ bool IC::RecomputeHandlerForName(Handle<Object> name) {
if (is_keyed()) {
// Determine whether the failure is due to a name failure.
if (!name->IsName()) return false;
Name stub_name = nexus()->FindFirstName();
Name stub_name = nexus()->GetName();
if (*name != stub_name) return false;
}
@ -547,7 +547,7 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
const MaybeObjectHandle& handler) {
DCHECK(IsHandler(*handler));
if (is_keyed() && state() != RECOMPUTE_HANDLER) {
if (nexus()->FindFirstName() != *name) return false;
if (nexus()->GetName() != *name) return false;
}
Handle<Map> map = receiver_map();
MapHandles maps;
@ -596,7 +596,7 @@ bool IC::UpdatePolymorphicIC(Handle<Name> name,
if (number_of_valid_maps == 1) {
ConfigureVectorState(name, receiver_map(), handler);
} else {
if (is_keyed() && nexus()->FindFirstName() != *name) return false;
if (is_keyed() && nexus()->GetName() != *name) return false;
if (handler_to_overwrite >= 0) {
handlers[handler_to_overwrite] = handler;
if (!map.is_identical_to(maps.at(handler_to_overwrite))) {

View File

@ -785,7 +785,7 @@ RUNTIME_FUNCTION(Runtime_DefineDataPropertyInLiteral) {
nexus.ConfigureMegamorphic(PROPERTY);
}
} else if (nexus.ic_state() == MONOMORPHIC) {
if (nexus.FindFirstMap() != object->map() ||
if (nexus.GetFirstMap() != object->map() ||
nexus.GetFeedbackExtra() != MaybeObject::FromObject(*name)) {
nexus.ConfigureMegamorphic(PROPERTY);
}

View File

@ -433,7 +433,7 @@ TEST(VectorLoadICStates) {
CcTest::global()->Get(context.local(), v8_str("o"));
Handle<JSObject> o =
Handle<JSObject>::cast(v8::Utils::OpenHandle(*v8_o.ToLocalChecked()));
CHECK_EQ(o->map(), nexus.FindFirstMap());
CHECK_EQ(o->map(), nexus.GetFirstMap());
// Now go polymorphic.
CompileRun("f({ blarg: 3, foo: 2 })");
@ -453,7 +453,7 @@ TEST(VectorLoadICStates) {
// Finally driven megamorphic.
CompileRun("f({ blarg: 3, gran: 3, torino: 10, foo: 2 })");
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.
CcTest::CollectAllGarbage();
@ -523,7 +523,7 @@ TEST(VectorLoadICOnSmi) {
CHECK_EQ(MONOMORPHIC, nexus.StateFromFeedback());
// Verify that the monomorphic map is the one we expect.
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.
CompileRun("f(o)");