OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <iomanip> | 5 #include <iomanip> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 15869 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15880 | 15880 |
15881 | 15881 |
15882 void PropertyCell::UpdateCell(Handle<GlobalDictionary> dictionary, int entry, | 15882 void PropertyCell::UpdateCell(Handle<GlobalDictionary> dictionary, int entry, |
15883 Handle<Object> value, PropertyDetails details) { | 15883 Handle<Object> value, PropertyDetails details) { |
15884 DCHECK(!value->IsTheHole()); | 15884 DCHECK(!value->IsTheHole()); |
15885 DCHECK(dictionary->ValueAt(entry)->IsPropertyCell()); | 15885 DCHECK(dictionary->ValueAt(entry)->IsPropertyCell()); |
15886 Handle<PropertyCell> cell(PropertyCell::cast(dictionary->ValueAt(entry))); | 15886 Handle<PropertyCell> cell(PropertyCell::cast(dictionary->ValueAt(entry))); |
15887 const PropertyDetails original_details = cell->property_details(); | 15887 const PropertyDetails original_details = cell->property_details(); |
15888 // Data accesses could be cached in ics or optimized code. | 15888 // Data accesses could be cached in ics or optimized code. |
15889 bool invalidate = | 15889 bool invalidate = |
15890 original_details.kind() == kData && details.kind() == kAccessor; | 15890 (original_details.kind() == kData && details.kind() == kAccessor) || |
| 15891 ((original_details.attributes() & READ_ONLY) != |
| 15892 (details.attributes() & READ_ONLY)); |
15891 int index = original_details.dictionary_index(); | 15893 int index = original_details.dictionary_index(); |
15892 PropertyCellType old_type = original_details.cell_type(); | 15894 PropertyCellType old_type = original_details.cell_type(); |
15893 // Preserve the enumeration index unless the property was deleted or never | 15895 // Preserve the enumeration index unless the property was deleted or never |
15894 // initialized. | 15896 // initialized. |
15895 if (cell->value()->IsTheHole()) { | 15897 if (cell->value()->IsTheHole()) { |
15896 index = dictionary->NextEnumerationIndex(); | 15898 index = dictionary->NextEnumerationIndex(); |
15897 dictionary->SetNextEnumerationIndex(index + 1); | 15899 dictionary->SetNextEnumerationIndex(index + 1); |
15898 // Negative lookup cells must be invalidated. | 15900 // Negative lookup cells must be invalidated. |
15899 invalidate = true; | 15901 invalidate = true; |
15900 } | 15902 } |
(...skipping 22 matching lines...) Expand all Loading... |
15923 Handle<Object> new_value) { | 15925 Handle<Object> new_value) { |
15924 if (cell->value() != *new_value) { | 15926 if (cell->value() != *new_value) { |
15925 cell->set_value(*new_value); | 15927 cell->set_value(*new_value); |
15926 Isolate* isolate = cell->GetIsolate(); | 15928 Isolate* isolate = cell->GetIsolate(); |
15927 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15929 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
15928 isolate, DependentCode::kPropertyCellChangedGroup); | 15930 isolate, DependentCode::kPropertyCellChangedGroup); |
15929 } | 15931 } |
15930 } | 15932 } |
15931 } // namespace internal | 15933 } // namespace internal |
15932 } // namespace v8 | 15934 } // namespace v8 |
OLD | NEW |