diff options
Diffstat (limited to 'chromium/v8/src/map-updater.cc')
-rw-r--r-- | chromium/v8/src/map-updater.cc | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/chromium/v8/src/map-updater.cc b/chromium/v8/src/map-updater.cc index 05ef5fd3e21..3a9a9caf14c 100644 --- a/chromium/v8/src/map-updater.cc +++ b/chromium/v8/src/map-updater.cc @@ -123,8 +123,9 @@ Handle<Map> MapUpdater::ReconfigureToDataField(int descriptor, new_field_type_ = field_type; } - GeneralizeIfTransitionableFastElementsKind( - &new_constness_, &new_representation_, &new_field_type_); + Map::GeneralizeIfCanHaveTransitionableFastElementsKind( + isolate_, old_map_->instance_type(), &new_constness_, + &new_representation_, &new_field_type_); if (TryRecofigureToDataFieldInplace() == kEnd) return result_map_; if (FindRootMap() == kEnd) return result_map_; @@ -158,28 +159,6 @@ Handle<Map> MapUpdater::Update() { return result_map_; } -void MapUpdater::GeneralizeIfTransitionableFastElementsKind( - PropertyConstness* constness, Representation* representation, - Handle<FieldType>* field_type) { - DCHECK_EQ(is_transitionable_fast_elements_kind_, - IsTransitionableFastElementsKind(new_elements_kind_)); - if (is_transitionable_fast_elements_kind_ && - Map::IsInplaceGeneralizableField(*constness, *representation, - **field_type)) { - // We don't support propagation of field generalization through elements - // kind transitions because they are inserted into the transition tree - // before field transitions. In order to avoid complexity of handling - // such a case we ensure that all maps with transitionable elements kinds - // do not have fields that can be generalized in-place (without creation - // of a new map). - if (FLAG_track_constant_fields && FLAG_modify_map_inplace) { - *constness = kMutable; - } - DCHECK(representation->IsHeapObject()); - *field_type = FieldType::Any(isolate_); - } -} - void MapUpdater::GeneralizeField(Handle<Map> map, int modify_index, PropertyConstness new_constness, Representation new_representation, @@ -437,6 +416,7 @@ MapUpdater::State MapUpdater::FindTargetMap() { } Handle<DescriptorArray> MapUpdater::BuildDescriptorArray() { + InstanceType instance_type = old_map_->instance_type(); int target_nof = target_map_->NumberOfOwnDescriptors(); Handle<DescriptorArray> target_descriptors( target_map_->instance_descriptors(), isolate_); @@ -518,8 +498,9 @@ Handle<DescriptorArray> MapUpdater::BuildDescriptorArray() { old_details.representation(), old_field_type, next_representation, target_field_type, isolate_); - GeneralizeIfTransitionableFastElementsKind( - &next_constness, &next_representation, &next_field_type); + Map::GeneralizeIfCanHaveTransitionableFastElementsKind( + isolate_, instance_type, &next_constness, &next_representation, + &next_field_type); Handle<Object> wrapped_type(Map::WrapFieldType(next_field_type)); Descriptor d; |