| OLD | NEW |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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/map-updater.h" | 5 #include "src/map-updater.h" |
| 6 | 6 |
| 7 #include "src/field-type.h" | 7 #include "src/field-type.h" |
| 8 #include "src/handles.h" | 8 #include "src/handles.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 new_kind_ = kData; | 94 new_kind_ = kData; |
| 95 new_attributes_ = attributes; | 95 new_attributes_ = attributes; |
| 96 new_location_ = kField; | 96 new_location_ = kField; |
| 97 | 97 |
| 98 PropertyDetails old_details = | 98 PropertyDetails old_details = |
| 99 old_descriptors_->GetDetails(modified_descriptor_); | 99 old_descriptors_->GetDetails(modified_descriptor_); |
| 100 | 100 |
| 101 // If property kind is not reconfigured merge the result with | 101 // If property kind is not reconfigured merge the result with |
| 102 // representation/field type from the old descriptor. | 102 // representation/field type from the old descriptor. |
| 103 if (old_details.kind() == new_kind_) { | 103 if (old_details.kind() == new_kind_) { |
| 104 new_constness_ = old_details.constness(); | 104 new_constness_ = kMutable; |
| 105 | 105 |
| 106 Representation old_representation = old_details.representation(); | 106 Representation old_representation = old_details.representation(); |
| 107 new_representation_ = representation.generalize(old_representation); | 107 new_representation_ = representation.generalize(old_representation); |
| 108 | 108 |
| 109 Handle<FieldType> old_field_type = | 109 Handle<FieldType> old_field_type = |
| 110 GetOrComputeFieldType(old_descriptors_, modified_descriptor_, | 110 GetOrComputeFieldType(old_descriptors_, modified_descriptor_, |
| 111 old_details.location(), new_representation_); | 111 old_details.location(), new_representation_); |
| 112 | 112 |
| 113 new_field_type_ = | 113 new_field_type_ = |
| 114 Map::GeneralizeFieldType(old_representation, old_field_type, | 114 Map::GeneralizeFieldType(old_representation, old_field_type, |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 630 // the new descriptors to maintain descriptors sharing invariant. | 630 // the new descriptors to maintain descriptors sharing invariant. |
| 631 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); | 631 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); |
| 632 | 632 |
| 633 result_map_ = new_map; | 633 result_map_ = new_map; |
| 634 state_ = kEnd; | 634 state_ = kEnd; |
| 635 return state_; // Done. | 635 return state_; // Done. |
| 636 } | 636 } |
| 637 | 637 |
| 638 } // namespace internal | 638 } // namespace internal |
| 639 } // namespace v8 | 639 } // namespace v8 |
| OLD | NEW |