| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 9798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9809 map->PrintReconfiguration(stdout, descriptor, kind, attributes); | 9809 map->PrintReconfiguration(stdout, descriptor, kind, attributes); |
| 9810 } | 9810 } |
| 9811 | 9811 |
| 9812 Isolate* isolate = map->GetIsolate(); | 9812 Isolate* isolate = map->GetIsolate(); |
| 9813 Handle<Map> new_map = ReconfigureProperty( | 9813 Handle<Map> new_map = ReconfigureProperty( |
| 9814 map, descriptor, kind, attributes, Representation::None(), | 9814 map, descriptor, kind, attributes, Representation::None(), |
| 9815 FieldType::None(isolate), FORCE_FIELD); | 9815 FieldType::None(isolate), FORCE_FIELD); |
| 9816 return new_map; | 9816 return new_map; |
| 9817 } | 9817 } |
| 9818 | 9818 |
| 9819 | |
| 9820 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map, | 9819 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map, |
| 9821 Handle<Name> name, | 9820 Handle<Name> name, int descriptor, |
| 9822 AccessorComponent component, | 9821 AccessorComponent component, |
| 9823 Handle<Object> accessor, | 9822 Handle<Object> accessor, |
| 9824 PropertyAttributes attributes) { | 9823 PropertyAttributes attributes) { |
| 9825 DCHECK(name->IsUniqueName()); | 9824 DCHECK(name->IsUniqueName()); |
| 9826 Isolate* isolate = name->GetIsolate(); | 9825 Isolate* isolate = name->GetIsolate(); |
| 9827 | 9826 |
| 9828 // Dictionary maps can always have additional data properties. | 9827 // Dictionary maps can always have additional data properties. |
| 9829 if (map->is_dictionary_map()) return map; | 9828 if (map->is_dictionary_map()) return map; |
| 9830 | 9829 |
| 9831 // Migrate to the newest map before transitioning to the new property. | 9830 // Migrate to the newest map before transitioning to the new property. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 9854 Handle<AccessorPair> pair = Handle<AccessorPair>::cast(maybe_pair); | 9853 Handle<AccessorPair> pair = Handle<AccessorPair>::cast(maybe_pair); |
| 9855 if (pair->get(component) != *accessor) { | 9854 if (pair->get(component) != *accessor) { |
| 9856 return Map::Normalize(map, mode, "TransitionToDifferentAccessor"); | 9855 return Map::Normalize(map, mode, "TransitionToDifferentAccessor"); |
| 9857 } | 9856 } |
| 9858 | 9857 |
| 9859 return transition; | 9858 return transition; |
| 9860 } | 9859 } |
| 9861 | 9860 |
| 9862 Handle<AccessorPair> pair; | 9861 Handle<AccessorPair> pair; |
| 9863 DescriptorArray* old_descriptors = map->instance_descriptors(); | 9862 DescriptorArray* old_descriptors = map->instance_descriptors(); |
| 9864 int descriptor = old_descriptors->SearchWithCache(isolate, *name, *map); | |
| 9865 if (descriptor != DescriptorArray::kNotFound) { | 9863 if (descriptor != DescriptorArray::kNotFound) { |
| 9866 if (descriptor != map->LastAdded()) { | 9864 if (descriptor != map->LastAdded()) { |
| 9867 return Map::Normalize(map, mode, "AccessorsOverwritingNonLast"); | 9865 return Map::Normalize(map, mode, "AccessorsOverwritingNonLast"); |
| 9868 } | 9866 } |
| 9869 PropertyDetails old_details = old_descriptors->GetDetails(descriptor); | 9867 PropertyDetails old_details = old_descriptors->GetDetails(descriptor); |
| 9870 if (old_details.type() != ACCESSOR_CONSTANT) { | 9868 if (old_details.type() != ACCESSOR_CONSTANT) { |
| 9871 return Map::Normalize(map, mode, "AccessorsOverwritingNonAccessors"); | 9869 return Map::Normalize(map, mode, "AccessorsOverwritingNonAccessors"); |
| 9872 } | 9870 } |
| 9873 | 9871 |
| 9874 if (old_details.attributes() != attributes) { | 9872 if (old_details.attributes() != attributes) { |
| (...skipping 9894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19769 if (cell->value() != *new_value) { | 19767 if (cell->value() != *new_value) { |
| 19770 cell->set_value(*new_value); | 19768 cell->set_value(*new_value); |
| 19771 Isolate* isolate = cell->GetIsolate(); | 19769 Isolate* isolate = cell->GetIsolate(); |
| 19772 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19770 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19773 isolate, DependentCode::kPropertyCellChangedGroup); | 19771 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19774 } | 19772 } |
| 19775 } | 19773 } |
| 19776 | 19774 |
| 19777 } // namespace internal | 19775 } // namespace internal |
| 19778 } // namespace v8 | 19776 } // namespace v8 |
| OLD | NEW |