| 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 7890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7901 DCHECK(attrs == FROZEN); | 7901 DCHECK(attrs == FROZEN); |
| 7902 transition_marker = isolate->factory()->frozen_symbol(); | 7902 transition_marker = isolate->factory()->frozen_symbol(); |
| 7903 } | 7903 } |
| 7904 | 7904 |
| 7905 Handle<Map> old_map(object->map(), isolate); | 7905 Handle<Map> old_map(object->map(), isolate); |
| 7906 Map* transition = | 7906 Map* transition = |
| 7907 TransitionArray::SearchSpecial(*old_map, *transition_marker); | 7907 TransitionArray::SearchSpecial(*old_map, *transition_marker); |
| 7908 if (transition != NULL) { | 7908 if (transition != NULL) { |
| 7909 Handle<Map> transition_map(transition, isolate); | 7909 Handle<Map> transition_map(transition, isolate); |
| 7910 DCHECK(transition_map->has_dictionary_elements() || | 7910 DCHECK(transition_map->has_dictionary_elements() || |
| 7911 transition_map->has_fixed_typed_array_elements()); | 7911 transition_map->has_fixed_typed_array_elements() || |
| 7912 transition_map->elements_kind() == SLOW_STRING_WRAPPER_ELEMENTS); |
| 7912 DCHECK(!transition_map->is_extensible()); | 7913 DCHECK(!transition_map->is_extensible()); |
| 7913 JSObject::MigrateToMap(object, transition_map); | 7914 JSObject::MigrateToMap(object, transition_map); |
| 7914 } else if (TransitionArray::CanHaveMoreTransitions(old_map)) { | 7915 } else if (TransitionArray::CanHaveMoreTransitions(old_map)) { |
| 7915 // Create a new descriptor array with the appropriate property attributes | 7916 // Create a new descriptor array with the appropriate property attributes |
| 7916 Handle<Map> new_map = Map::CopyForPreventExtensions( | 7917 Handle<Map> new_map = Map::CopyForPreventExtensions( |
| 7917 old_map, attrs, transition_marker, "CopyForPreventExtensions"); | 7918 old_map, attrs, transition_marker, "CopyForPreventExtensions"); |
| 7918 JSObject::MigrateToMap(object, new_map); | 7919 JSObject::MigrateToMap(object, new_map); |
| 7919 } else { | 7920 } else { |
| 7920 DCHECK(old_map->is_dictionary_map() || !old_map->is_prototype_map()); | 7921 DCHECK(old_map->is_dictionary_map() || !old_map->is_prototype_map()); |
| 7921 // Slow path: need to normalize properties for safety | 7922 // Slow path: need to normalize properties for safety |
| (...skipping 11847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19769 if (cell->value() != *new_value) { | 19770 if (cell->value() != *new_value) { |
| 19770 cell->set_value(*new_value); | 19771 cell->set_value(*new_value); |
| 19771 Isolate* isolate = cell->GetIsolate(); | 19772 Isolate* isolate = cell->GetIsolate(); |
| 19772 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19773 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 19773 isolate, DependentCode::kPropertyCellChangedGroup); | 19774 isolate, DependentCode::kPropertyCellChangedGroup); |
| 19774 } | 19775 } |
| 19775 } | 19776 } |
| 19776 | 19777 |
| 19777 } // namespace internal | 19778 } // namespace internal |
| 19778 } // namespace v8 | 19779 } // namespace v8 |
| OLD | NEW |