[turbofan] Drop unnecessary InternalizeName call.

Bug: v8:7790
Change-Id: Iad9a3087ea7915bade6c70c56f6d8f6f640f26cb
Reviewed-on: https://chromium-review.googlesource.com/c/1408889
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58773}
This commit is contained in:
Georg Neis 2019-01-14 11:42:19 +01:00 committed by Commit Bot
parent 5e87da67d1
commit 514033ab09
3 changed files with 11 additions and 9 deletions

View File

@ -341,15 +341,14 @@ bool AccessInfoFactory::ComputeElementAccessInfos(
bool AccessInfoFactory::ComputePropertyAccessInfo(
Handle<Map> map, Handle<Name> name, AccessMode access_mode,
PropertyAccessInfo* access_info) {
CHECK(name->IsUniqueName());
// Check if it is safe to inline property access for the {map}.
if (!CanInlinePropertyAccess(map)) return false;
// Compute the receiver type.
Handle<Map> receiver_map = map;
// Property lookups require the name to be internalized.
name = isolate()->factory()->InternalizeName(name);
// We support fast inline cases for certain JSObject getters.
if (access_mode == AccessMode::kLoad &&
LookupSpecialFieldAccessor(map, name, access_info)) {

View File

@ -1814,7 +1814,7 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess(
// Use the constant array index.
index = jsgraph()->Constant(static_cast<double>(array_index));
} else {
name = factory()->InternalizeName(name);
name = factory()->InternalizeName(name); // TODO(neis): Do up-front.
return ReduceNamedAccess(node, value, receiver_maps, name, access_mode);
}
}
@ -2407,9 +2407,9 @@ Reduction JSNativeContextSpecialization::ReduceJSStoreDataPropertyInLiteral(
if (!Map::TryUpdate(isolate(), receiver_map).ToHandle(&receiver_map))
return NoChange();
Handle<Name> cached_name =
handle(Name::cast(nexus.GetFeedbackExtra()->GetHeapObjectAssumeStrong()),
isolate());
Handle<Name> cached_name(
Name::cast(nexus.GetFeedbackExtra()->GetHeapObjectAssumeStrong()),
isolate());
PropertyAccessInfo access_info;
AccessInfoFactory access_info_factory(
@ -3158,7 +3158,7 @@ Node* JSNativeContextSpecialization::BuildCheckEqualsName(Handle<Name> name,
bool JSNativeContextSpecialization::CanTreatHoleAsUndefined(
MapHandles const& receiver_maps) {
// Check if all {receiver_maps} either have one of the initial Array.prototype
// Check if all {receiver_maps} have one of the initial Array.prototype
// or Object.prototype objects as their prototype (in any of the current
// native contexts, as the global Array protector works isolate-wide).
for (Handle<Map> map : receiver_maps) {

View File

@ -43,7 +43,10 @@ bool FeedbackVectorSpec::HasTypeProfileSlot() const {
static bool IsPropertyNameFeedback(MaybeObject feedback) {
HeapObject heap_object;
if (!feedback->GetHeapObjectIfStrong(&heap_object)) return false;
if (heap_object->IsString()) return true;
if (heap_object->IsString()) {
DCHECK(heap_object->IsInternalizedString());
return true;
}
if (!heap_object->IsSymbol()) return false;
Symbol symbol = Symbol::cast(heap_object);
ReadOnlyRoots roots = symbol->GetReadOnlyRoots();