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 2547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2558 if (modify_index >= 0) { | 2558 if (modify_index >= 0) { |
2559 PropertyDetails details = target_descriptors->GetDetails(modify_index); | 2559 PropertyDetails details = target_descriptors->GetDetails(modify_index); |
2560 DCHECK_EQ(new_kind, details.kind()); | 2560 DCHECK_EQ(new_kind, details.kind()); |
2561 DCHECK_EQ(new_attributes, details.attributes()); | 2561 DCHECK_EQ(new_attributes, details.attributes()); |
2562 DCHECK(new_representation.fits_into(details.representation())); | 2562 DCHECK(new_representation.fits_into(details.representation())); |
2563 DCHECK(details.location() != kField || | 2563 DCHECK(details.location() != kField || |
2564 new_field_type->NowIs( | 2564 new_field_type->NowIs( |
2565 target_descriptors->GetFieldType(modify_index))); | 2565 target_descriptors->GetFieldType(modify_index))); |
2566 } | 2566 } |
2567 #endif | 2567 #endif |
| 2568 if (*target_map != *old_map) { |
| 2569 old_map->NotifyLeafMapLayoutChange(); |
| 2570 } |
2568 return target_map; | 2571 return target_map; |
2569 } | 2572 } |
2570 | 2573 |
2571 // Find the last compatible target map in the transition tree. | 2574 // Find the last compatible target map in the transition tree. |
2572 for (int i = target_nof; i < old_nof; ++i) { | 2575 for (int i = target_nof; i < old_nof; ++i) { |
2573 PropertyDetails old_details = old_descriptors->GetDetails(i); | 2576 PropertyDetails old_details = old_descriptors->GetDetails(i); |
2574 PropertyKind next_kind; | 2577 PropertyKind next_kind; |
2575 PropertyAttributes next_attributes; | 2578 PropertyAttributes next_attributes; |
2576 if (modify_index == i) { | 2579 if (modify_index == i) { |
2577 next_kind = new_kind; | 2580 next_kind = new_kind; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2811 split_attributes = new_attributes; | 2814 split_attributes = new_attributes; |
2812 } else { | 2815 } else { |
2813 PropertyDetails split_prop_details = old_descriptors->GetDetails(split_nof); | 2816 PropertyDetails split_prop_details = old_descriptors->GetDetails(split_nof); |
2814 split_kind = split_prop_details.kind(); | 2817 split_kind = split_prop_details.kind(); |
2815 split_attributes = split_prop_details.attributes(); | 2818 split_attributes = split_prop_details.attributes(); |
2816 } | 2819 } |
2817 bool transition_target_deprecated = split_map->DeprecateTarget( | 2820 bool transition_target_deprecated = split_map->DeprecateTarget( |
2818 split_kind, old_descriptors->GetKey(split_nof), split_attributes, | 2821 split_kind, old_descriptors->GetKey(split_nof), split_attributes, |
2819 *new_descriptors, *new_layout_descriptor); | 2822 *new_descriptors, *new_layout_descriptor); |
2820 | 2823 |
2821 if (from_kind != to_kind) { | |
2822 // There was an elements kind change in the middle of transition tree and | |
2823 // we reconstructed the tree so that all elements kind transitions are | |
2824 // done at the beginning, therefore the |old_map| is no longer stable. | |
2825 old_map->NotifyLeafMapLayoutChange(); | |
2826 } | |
2827 | |
2828 // If |transition_target_deprecated| is true then the transition array | 2824 // If |transition_target_deprecated| is true then the transition array |
2829 // already contains entry for given descriptor. This means that the transition | 2825 // already contains entry for given descriptor. This means that the transition |
2830 // could be inserted regardless of whether transitions array is full or not. | 2826 // could be inserted regardless of whether transitions array is full or not. |
2831 if (!transition_target_deprecated && | 2827 if (!transition_target_deprecated && |
2832 !TransitionArray::CanHaveMoreTransitions(split_map)) { | 2828 !TransitionArray::CanHaveMoreTransitions(split_map)) { |
2833 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode, | 2829 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode, |
2834 new_kind, new_attributes, | 2830 new_kind, new_attributes, |
2835 "GenAll_CantHaveMoreTransitions"); | 2831 "GenAll_CantHaveMoreTransitions"); |
2836 } | 2832 } |
2837 | 2833 |
| 2834 old_map->NotifyLeafMapLayoutChange(); |
| 2835 |
2838 if (FLAG_trace_generalization && modify_index >= 0) { | 2836 if (FLAG_trace_generalization && modify_index >= 0) { |
2839 PropertyDetails old_details = old_descriptors->GetDetails(modify_index); | 2837 PropertyDetails old_details = old_descriptors->GetDetails(modify_index); |
2840 PropertyDetails new_details = new_descriptors->GetDetails(modify_index); | 2838 PropertyDetails new_details = new_descriptors->GetDetails(modify_index); |
2841 Handle<HeapType> old_field_type = | 2839 Handle<HeapType> old_field_type = |
2842 (old_details.type() == DATA) | 2840 (old_details.type() == DATA) |
2843 ? handle(old_descriptors->GetFieldType(modify_index), isolate) | 2841 ? handle(old_descriptors->GetFieldType(modify_index), isolate) |
2844 : HeapType::Constant( | 2842 : HeapType::Constant( |
2845 handle(old_descriptors->GetValue(modify_index), isolate), | 2843 handle(old_descriptors->GetValue(modify_index), isolate), |
2846 isolate); | 2844 isolate); |
2847 Handle<HeapType> new_field_type = | 2845 Handle<HeapType> new_field_type = |
(...skipping 13794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
16642 Handle<Object> new_value) { | 16640 Handle<Object> new_value) { |
16643 if (cell->value() != *new_value) { | 16641 if (cell->value() != *new_value) { |
16644 cell->set_value(*new_value); | 16642 cell->set_value(*new_value); |
16645 Isolate* isolate = cell->GetIsolate(); | 16643 Isolate* isolate = cell->GetIsolate(); |
16646 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16644 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
16647 isolate, DependentCode::kPropertyCellChangedGroup); | 16645 isolate, DependentCode::kPropertyCellChangedGroup); |
16648 } | 16646 } |
16649 } | 16647 } |
16650 } // namespace internal | 16648 } // namespace internal |
16651 } // namespace v8 | 16649 } // namespace v8 |
OLD | NEW |