From 8bc4fe57a4192d06f34efdd75d9e975062f235c3 Mon Sep 17 00:00:00 2001 From: Toon Verwaest Date: Fri, 16 Jun 2017 16:27:09 +0200 Subject: [PATCH] [runtime] Get rid of unnecessary DictionaryDetailsAtPut Bug: Change-Id: I87b2c33dbf537aae949b25b2cd56fd20985e5980 Reviewed-on: https://chromium-review.googlesource.com/538659 Reviewed-by: Camillo Bruni Commit-Queue: Toon Verwaest Cr-Commit-Position: refs/heads/master@{#45984} --- src/objects-inl.h | 4 ++++ src/objects.cc | 20 +------------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/objects-inl.h b/src/objects-inl.h index 37d54ac40a..9153af70bb 100644 --- a/src/objects-inl.h +++ b/src/objects-inl.h @@ -6130,6 +6130,10 @@ void GlobalDictionaryShape::DetailsAtPut(Dictionary* dict, int entry, Object* raw_value = dict->ValueAt(entry); DCHECK(raw_value->IsPropertyCell()); PropertyCell* cell = PropertyCell::cast(raw_value); + if (cell->property_details().IsReadOnly() != value.IsReadOnly()) { + cell->dependent_code()->DeoptimizeDependentCodeGroup( + cell->GetIsolate(), DependentCode::kPropertyCellChangedGroup); + } cell->set_property_details(value); } diff --git a/src/objects.cc b/src/objects.cc index b1fe46d143..ae1cd6a5ae 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -7689,24 +7689,6 @@ bool JSObject::IsExtensible(Handle object) { namespace { -template -void DictionaryDetailsAtPut(Isolate* isolate, Handle dictionary, - int entry, PropertyDetails details) { - dictionary->DetailsAtPut(entry, details); -} - -template <> -void DictionaryDetailsAtPut( - Isolate* isolate, Handle dictionary, int entry, - PropertyDetails details) { - Object* value = dictionary->ValueAt(entry); - DCHECK(value->IsPropertyCell()); - value = PropertyCell::cast(value)->value(); - if (value->IsTheHole(isolate)) return; - PropertyCell::PrepareForValue(dictionary, entry, handle(value, isolate), - details); -} - template void ApplyAttributesToDictionary(Isolate* isolate, Handle dictionary, @@ -7726,7 +7708,7 @@ void ApplyAttributesToDictionary(Isolate* isolate, } details = details.CopyAddAttributes( static_cast(attrs)); - DictionaryDetailsAtPut(isolate, dictionary, i, details); + dictionary->DetailsAtPut(i, details); } } }