| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 DCHECK(old_map_->is_deprecated()); | 143 DCHECK(old_map_->is_deprecated()); |
| 144 | 144 |
| 145 if (FindRootMap() == kEnd) return result_map_; | 145 if (FindRootMap() == kEnd) return result_map_; |
| 146 if (FindTargetMap() == kEnd) return result_map_; | 146 if (FindTargetMap() == kEnd) return result_map_; |
| 147 ConstructNewMap(); | 147 ConstructNewMap(); |
| 148 DCHECK_EQ(kEnd, state_); | 148 DCHECK_EQ(kEnd, state_); |
| 149 return result_map_; | 149 return result_map_; |
| 150 } | 150 } |
| 151 | 151 |
| 152 MapUpdater::State MapUpdater::CopyGeneralizeAllFields(const char* reason) { | 152 MapUpdater::State MapUpdater::CopyGeneralizeAllFields(const char* reason) { |
| 153 StoreMode store_mode = | 153 result_map_ = Map::CopyGeneralizeAllFields(old_map_, new_elements_kind_, |
| 154 modified_descriptor_ >= 0 ? FORCE_FIELD : ALLOW_IN_DESCRIPTOR; | 154 modified_descriptor_, new_kind_, |
| 155 result_map_ = Map::CopyGeneralizeAllFields( | 155 new_attributes_, reason); |
| 156 old_map_, new_elements_kind_, modified_descriptor_, store_mode, new_kind_, | |
| 157 new_attributes_, reason); | |
| 158 state_ = kEnd; | 156 state_ = kEnd; |
| 159 return state_; // Done. | 157 return state_; // Done. |
| 160 } | 158 } |
| 161 | 159 |
| 162 MapUpdater::State MapUpdater::TryRecofigureToDataFieldInplace() { | 160 MapUpdater::State MapUpdater::TryRecofigureToDataFieldInplace() { |
| 163 // If it's just a representation generalization case (i.e. property kind and | 161 // If it's just a representation generalization case (i.e. property kind and |
| 164 // attributes stays unchanged) it's fine to transition from None to anything | 162 // attributes stays unchanged) it's fine to transition from None to anything |
| 165 // but double without any modification to the object, because the default | 163 // but double without any modification to the object, because the default |
| 166 // uninitialized value for representation None can be overwritten by both | 164 // uninitialized value for representation None can be overwritten by both |
| 167 // smi and tagged values. Doubles, however, would require a box allocation. | 165 // smi and tagged values. Doubles, however, would require a box allocation. |
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 // the new descriptors to maintain descriptors sharing invariant. | 606 // the new descriptors to maintain descriptors sharing invariant. |
| 609 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); | 607 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); |
| 610 | 608 |
| 611 result_map_ = new_map; | 609 result_map_ = new_map; |
| 612 state_ = kEnd; | 610 state_ = kEnd; |
| 613 return state_; // Done. | 611 return state_; // Done. |
| 614 } | 612 } |
| 615 | 613 |
| 616 } // namespace internal | 614 } // namespace internal |
| 617 } // namespace v8 | 615 } // namespace v8 |
| OLD | NEW |