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 9293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9304 // invariant since the last map is not yet connected to the transition tree | 9304 // invariant since the last map is not yet connected to the transition tree |
9305 // we create here. But it is safe because GC never trims map's descriptors | 9305 // we create here. But it is safe because GC never trims map's descriptors |
9306 // if there are no dead transitions from that map and this is exactly the | 9306 // if there are no dead transitions from that map and this is exactly the |
9307 // case for all the intermediate maps we create here. | 9307 // case for all the intermediate maps we create here. |
9308 Handle<Map> map = split_map; | 9308 Handle<Map> map = split_map; |
9309 for (int i = split_nof; i < nof_descriptors - 1; ++i) { | 9309 for (int i = split_nof; i < nof_descriptors - 1; ++i) { |
9310 Handle<Map> new_map = CopyDropDescriptors(map); | 9310 Handle<Map> new_map = CopyDropDescriptors(map); |
9311 InstallDescriptors(map, new_map, i, descriptors, full_layout_descriptor); | 9311 InstallDescriptors(map, new_map, i, descriptors, full_layout_descriptor); |
9312 map = new_map; | 9312 map = new_map; |
9313 } | 9313 } |
| 9314 map->NotifyLeafMapLayoutChange(); |
9314 InstallDescriptors(map, last_map, nof_descriptors - 1, descriptors, | 9315 InstallDescriptors(map, last_map, nof_descriptors - 1, descriptors, |
9315 full_layout_descriptor); | 9316 full_layout_descriptor); |
9316 return last_map; | 9317 return last_map; |
9317 } | 9318 } |
9318 | 9319 |
9319 | 9320 |
9320 // Since this method is used to rewrite an existing transition tree, it can | 9321 // Since this method is used to rewrite an existing transition tree, it can |
9321 // always insert transitions without checking. | 9322 // always insert transitions without checking. |
9322 void Map::InstallDescriptors(Handle<Map> parent, Handle<Map> child, | 9323 void Map::InstallDescriptors(Handle<Map> parent, Handle<Map> child, |
9323 int new_descriptor, | 9324 int new_descriptor, |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9420 break; | 9421 break; |
9421 default: | 9422 default: |
9422 UNREACHABLE(); | 9423 UNREACHABLE(); |
9423 break; | 9424 break; |
9424 } | 9425 } |
9425 Map* maybe_transition = | 9426 Map* maybe_transition = |
9426 TransitionArray::SearchSpecial(*initial_map, *transition_symbol); | 9427 TransitionArray::SearchSpecial(*initial_map, *transition_symbol); |
9427 if (maybe_transition != NULL) { | 9428 if (maybe_transition != NULL) { |
9428 return handle(maybe_transition, isolate); | 9429 return handle(maybe_transition, isolate); |
9429 } | 9430 } |
| 9431 initial_map->NotifyLeafMapLayoutChange(); |
9430 | 9432 |
9431 // Create new map taking descriptors from the |function_map| and all | 9433 // Create new map taking descriptors from the |function_map| and all |
9432 // the other details from the |initial_map|. | 9434 // the other details from the |initial_map|. |
9433 Handle<Map> map = | 9435 Handle<Map> map = |
9434 Map::CopyInitialMap(function_map, initial_map->instance_size(), | 9436 Map::CopyInitialMap(function_map, initial_map->instance_size(), |
9435 initial_map->GetInObjectProperties(), | 9437 initial_map->GetInObjectProperties(), |
9436 initial_map->unused_property_fields()); | 9438 initial_map->unused_property_fields()); |
9437 map->SetConstructor(initial_map->GetConstructor()); | 9439 map->SetConstructor(initial_map->GetConstructor()); |
9438 map->set_prototype(initial_map->prototype()); | 9440 map->set_prototype(initial_map->prototype()); |
9439 | 9441 |
(...skipping 10041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19481 if (cell->value() != *new_value) { | 19483 if (cell->value() != *new_value) { |
19482 cell->set_value(*new_value); | 19484 cell->set_value(*new_value); |
19483 Isolate* isolate = cell->GetIsolate(); | 19485 Isolate* isolate = cell->GetIsolate(); |
19484 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19486 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19485 isolate, DependentCode::kPropertyCellChangedGroup); | 19487 isolate, DependentCode::kPropertyCellChangedGroup); |
19486 } | 19488 } |
19487 } | 19489 } |
19488 | 19490 |
19489 } // namespace internal | 19491 } // namespace internal |
19490 } // namespace v8 | 19492 } // namespace v8 |
OLD | NEW |