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 7254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7265 | 7265 |
7266 | 7266 |
7267 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map, | 7267 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map, |
7268 Handle<Name> name, | 7268 Handle<Name> name, |
7269 AccessorComponent component, | 7269 AccessorComponent component, |
7270 Handle<Object> accessor, | 7270 Handle<Object> accessor, |
7271 PropertyAttributes attributes) { | 7271 PropertyAttributes attributes) { |
7272 Isolate* isolate = name->GetIsolate(); | 7272 Isolate* isolate = name->GetIsolate(); |
7273 | 7273 |
7274 // Dictionary maps can always have additional data properties. | 7274 // Dictionary maps can always have additional data properties. |
7275 if (map->is_dictionary_map()) { | 7275 if (map->is_dictionary_map()) return map; |
7276 // For global objects, property cells are inlined. We need to change the | |
7277 // map. | |
7278 if (map->IsGlobalObjectMap()) return Copy(map, "GlobalAccessor"); | |
7279 return map; | |
7280 } | |
7281 | 7276 |
7282 // Migrate to the newest map before transitioning to the new property. | 7277 // Migrate to the newest map before transitioning to the new property. |
7283 map = Update(map); | 7278 map = Update(map); |
7284 | 7279 |
7285 PropertyNormalizationMode mode = map->is_prototype_map() | 7280 PropertyNormalizationMode mode = map->is_prototype_map() |
7286 ? KEEP_INOBJECT_PROPERTIES | 7281 ? KEEP_INOBJECT_PROPERTIES |
7287 : CLEAR_INOBJECT_PROPERTIES; | 7282 : CLEAR_INOBJECT_PROPERTIES; |
7288 | 7283 |
7289 Map* maybe_transition = | 7284 Map* maybe_transition = |
7290 TransitionArray::SearchTransition(*map, kAccessor, *name, attributes); | 7285 TransitionArray::SearchTransition(*map, kAccessor, *name, attributes); |
(...skipping 8829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16120 Handle<Object> new_value) { | 16115 Handle<Object> new_value) { |
16121 if (cell->value() != *new_value) { | 16116 if (cell->value() != *new_value) { |
16122 cell->set_value(*new_value); | 16117 cell->set_value(*new_value); |
16123 Isolate* isolate = cell->GetIsolate(); | 16118 Isolate* isolate = cell->GetIsolate(); |
16124 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16119 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16125 isolate, DependentCode::kPropertyCellChangedGroup); | 16120 isolate, DependentCode::kPropertyCellChangedGroup); |
16126 } | 16121 } |
16127 } | 16122 } |
16128 } // namespace internal | 16123 } // namespace internal |
16129 } // namespace v8 | 16124 } // namespace v8 |
OLD | NEW |