| 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 "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 2708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2719 details.representation().IsNone()); | 2719 details.representation().IsNone()); |
| 2720 | 2720 |
| 2721 // Skip if already updated the shared descriptor. | 2721 // Skip if already updated the shared descriptor. |
| 2722 if (instance_descriptors()->GetValue(descriptor) == *new_wrapped_type) return; | 2722 if (instance_descriptors()->GetValue(descriptor) == *new_wrapped_type) return; |
| 2723 DataDescriptor d(name, instance_descriptors()->GetFieldIndex(descriptor), | 2723 DataDescriptor d(name, instance_descriptors()->GetFieldIndex(descriptor), |
| 2724 new_wrapped_type, details.attributes(), new_representation); | 2724 new_wrapped_type, details.attributes(), new_representation); |
| 2725 instance_descriptors()->Replace(descriptor, &d); | 2725 instance_descriptors()->Replace(descriptor, &d); |
| 2726 } | 2726 } |
| 2727 | 2727 |
| 2728 | 2728 |
| 2729 bool FieldTypeIsCleared(Representation rep, Handle<HeapType> type) { |
| 2730 return type->Is(HeapType::None()) && rep.IsHeapObject(); |
| 2731 } |
| 2732 |
| 2733 |
| 2729 // static | 2734 // static |
| 2730 Handle<HeapType> Map::GeneralizeFieldType(Handle<HeapType> type1, | 2735 Handle<HeapType> Map::GeneralizeFieldType(Representation rep1, |
| 2736 Handle<HeapType> type1, |
| 2737 Representation rep2, |
| 2731 Handle<HeapType> type2, | 2738 Handle<HeapType> type2, |
| 2732 Isolate* isolate) { | 2739 Isolate* isolate) { |
| 2740 // Cleared field types need special treatment. They represent lost knowledge, |
| 2741 // so we must be conservative, so their generalization with any other type |
| 2742 // is "Any". |
| 2743 if (FieldTypeIsCleared(rep1, type1) || FieldTypeIsCleared(rep2, type2)) { |
| 2744 return HeapType::Any(isolate); |
| 2745 } |
| 2733 if (type1->NowIs(type2)) return type2; | 2746 if (type1->NowIs(type2)) return type2; |
| 2734 if (type2->NowIs(type1)) return type1; | 2747 if (type2->NowIs(type1)) return type1; |
| 2735 return HeapType::Any(isolate); | 2748 return HeapType::Any(isolate); |
| 2736 } | 2749 } |
| 2737 | 2750 |
| 2738 | 2751 |
| 2739 // static | 2752 // static |
| 2740 void Map::GeneralizeFieldType(Handle<Map> map, int modify_index, | 2753 void Map::GeneralizeFieldType(Handle<Map> map, int modify_index, |
| 2741 Representation new_representation, | 2754 Representation new_representation, |
| 2742 Handle<HeapType> new_field_type) { | 2755 Handle<HeapType> new_field_type) { |
| 2743 Isolate* isolate = map->GetIsolate(); | 2756 Isolate* isolate = map->GetIsolate(); |
| 2744 | 2757 |
| 2745 // Check if we actually need to generalize the field type at all. | 2758 // Check if we actually need to generalize the field type at all. |
| 2746 Handle<DescriptorArray> old_descriptors(map->instance_descriptors(), isolate); | 2759 Handle<DescriptorArray> old_descriptors(map->instance_descriptors(), isolate); |
| 2747 Representation old_representation = | 2760 Representation old_representation = |
| 2748 old_descriptors->GetDetails(modify_index).representation(); | 2761 old_descriptors->GetDetails(modify_index).representation(); |
| 2749 Handle<HeapType> old_field_type(old_descriptors->GetFieldType(modify_index), | 2762 Handle<HeapType> old_field_type(old_descriptors->GetFieldType(modify_index), |
| 2750 isolate); | 2763 isolate); |
| 2751 | 2764 |
| 2752 if (old_representation.Equals(new_representation) && | 2765 if (old_representation.Equals(new_representation) && |
| 2766 !FieldTypeIsCleared(new_representation, new_field_type) && |
| 2767 // Checking old_field_type for being cleared is not necessary because |
| 2768 // the NowIs check below would fail anyway in that case. |
| 2753 new_field_type->NowIs(old_field_type)) { | 2769 new_field_type->NowIs(old_field_type)) { |
| 2754 DCHECK(Map::GeneralizeFieldType(old_field_type, | 2770 DCHECK(Map::GeneralizeFieldType(old_representation, old_field_type, |
| 2755 new_field_type, | 2771 new_representation, new_field_type, isolate) |
| 2756 isolate)->NowIs(old_field_type)); | 2772 ->NowIs(old_field_type)); |
| 2757 return; | 2773 return; |
| 2758 } | 2774 } |
| 2759 | 2775 |
| 2760 // Determine the field owner. | 2776 // Determine the field owner. |
| 2761 Handle<Map> field_owner(map->FindFieldOwner(modify_index), isolate); | 2777 Handle<Map> field_owner(map->FindFieldOwner(modify_index), isolate); |
| 2762 Handle<DescriptorArray> descriptors( | 2778 Handle<DescriptorArray> descriptors( |
| 2763 field_owner->instance_descriptors(), isolate); | 2779 field_owner->instance_descriptors(), isolate); |
| 2764 DCHECK_EQ(*old_field_type, descriptors->GetFieldType(modify_index)); | 2780 DCHECK_EQ(*old_field_type, descriptors->GetFieldType(modify_index)); |
| 2765 bool old_field_type_was_cleared = | |
| 2766 old_field_type->Is(HeapType::None()) && old_representation.IsHeapObject(); | |
| 2767 | 2781 |
| 2768 // Determine the generalized new field type. Conservatively assume type Any | |
| 2769 // for cleared field types because the cleared type could have been a | |
| 2770 // deprecated map and there still could be live instances with a non- | |
| 2771 // deprecated version of the map. | |
| 2772 new_field_type = | 2782 new_field_type = |
| 2773 old_field_type_was_cleared | 2783 Map::GeneralizeFieldType(old_representation, old_field_type, |
| 2774 ? HeapType::Any(isolate) | 2784 new_representation, new_field_type, isolate); |
| 2775 : Map::GeneralizeFieldType(old_field_type, new_field_type, isolate); | |
| 2776 | 2785 |
| 2777 PropertyDetails details = descriptors->GetDetails(modify_index); | 2786 PropertyDetails details = descriptors->GetDetails(modify_index); |
| 2778 Handle<Name> name(descriptors->GetKey(modify_index)); | 2787 Handle<Name> name(descriptors->GetKey(modify_index)); |
| 2779 | 2788 |
| 2780 Handle<Object> wrapped_type(WrapType(new_field_type)); | 2789 Handle<Object> wrapped_type(WrapType(new_field_type)); |
| 2781 field_owner->UpdateFieldType(modify_index, name, new_representation, | 2790 field_owner->UpdateFieldType(modify_index, name, new_representation, |
| 2782 wrapped_type); | 2791 wrapped_type); |
| 2783 field_owner->dependent_code()->DeoptimizeDependentCodeGroup( | 2792 field_owner->dependent_code()->DeoptimizeDependentCodeGroup( |
| 2784 isolate, DependentCode::kFieldTypeGroup); | 2793 isolate, DependentCode::kFieldTypeGroup); |
| 2785 | 2794 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2989 PropertyLocation tmp_location = tmp_details.location(); | 2998 PropertyLocation tmp_location = tmp_details.location(); |
| 2990 if (tmp_location == kField) { | 2999 if (tmp_location == kField) { |
| 2991 if (next_kind == kData) { | 3000 if (next_kind == kData) { |
| 2992 Handle<HeapType> next_field_type; | 3001 Handle<HeapType> next_field_type; |
| 2993 if (modify_index == i) { | 3002 if (modify_index == i) { |
| 2994 next_field_type = new_field_type; | 3003 next_field_type = new_field_type; |
| 2995 if (!property_kind_reconfiguration) { | 3004 if (!property_kind_reconfiguration) { |
| 2996 Handle<HeapType> old_field_type = | 3005 Handle<HeapType> old_field_type = |
| 2997 GetFieldType(isolate, old_descriptors, i, | 3006 GetFieldType(isolate, old_descriptors, i, |
| 2998 old_details.location(), tmp_representation); | 3007 old_details.location(), tmp_representation); |
| 2999 next_field_type = | 3008 Representation old_representation = old_details.representation(); |
| 3000 GeneralizeFieldType(next_field_type, old_field_type, isolate); | 3009 next_field_type = GeneralizeFieldType( |
| 3010 old_representation, old_field_type, new_representation, |
| 3011 next_field_type, isolate); |
| 3001 } | 3012 } |
| 3002 } else { | 3013 } else { |
| 3003 Handle<HeapType> old_field_type = | 3014 Handle<HeapType> old_field_type = |
| 3004 GetFieldType(isolate, old_descriptors, i, old_details.location(), | 3015 GetFieldType(isolate, old_descriptors, i, old_details.location(), |
| 3005 tmp_representation); | 3016 tmp_representation); |
| 3006 next_field_type = old_field_type; | 3017 next_field_type = old_field_type; |
| 3007 } | 3018 } |
| 3008 GeneralizeFieldType(tmp_map, i, tmp_representation, next_field_type); | 3019 GeneralizeFieldType(tmp_map, i, tmp_representation, next_field_type); |
| 3009 } | 3020 } |
| 3010 } else if (old_location == kField || | 3021 } else if (old_location == kField || |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3154 DCHECK_EQ(next_attributes, target_details.attributes()); | 3165 DCHECK_EQ(next_attributes, target_details.attributes()); |
| 3155 | 3166 |
| 3156 if (next_location == kField) { | 3167 if (next_location == kField) { |
| 3157 if (next_kind == kData) { | 3168 if (next_kind == kData) { |
| 3158 Handle<HeapType> target_field_type = | 3169 Handle<HeapType> target_field_type = |
| 3159 GetFieldType(isolate, target_descriptors, i, | 3170 GetFieldType(isolate, target_descriptors, i, |
| 3160 target_details.location(), next_representation); | 3171 target_details.location(), next_representation); |
| 3161 | 3172 |
| 3162 Handle<HeapType> next_field_type; | 3173 Handle<HeapType> next_field_type; |
| 3163 if (modify_index == i) { | 3174 if (modify_index == i) { |
| 3164 next_field_type = | 3175 next_field_type = GeneralizeFieldType( |
| 3165 GeneralizeFieldType(target_field_type, new_field_type, isolate); | 3176 target_details.representation(), target_field_type, |
| 3177 new_representation, new_field_type, isolate); |
| 3166 if (!property_kind_reconfiguration) { | 3178 if (!property_kind_reconfiguration) { |
| 3167 Handle<HeapType> old_field_type = | 3179 Handle<HeapType> old_field_type = |
| 3168 GetFieldType(isolate, old_descriptors, i, | 3180 GetFieldType(isolate, old_descriptors, i, |
| 3169 old_details.location(), next_representation); | 3181 old_details.location(), next_representation); |
| 3170 next_field_type = | 3182 next_field_type = GeneralizeFieldType( |
| 3171 GeneralizeFieldType(next_field_type, old_field_type, isolate); | 3183 old_details.representation(), old_field_type, |
| 3184 next_representation, next_field_type, isolate); |
| 3172 } | 3185 } |
| 3173 } else { | 3186 } else { |
| 3174 Handle<HeapType> old_field_type = | 3187 Handle<HeapType> old_field_type = |
| 3175 GetFieldType(isolate, old_descriptors, i, old_details.location(), | 3188 GetFieldType(isolate, old_descriptors, i, old_details.location(), |
| 3176 next_representation); | 3189 next_representation); |
| 3177 next_field_type = | 3190 next_field_type = GeneralizeFieldType( |
| 3178 GeneralizeFieldType(target_field_type, old_field_type, isolate); | 3191 old_details.representation(), old_field_type, next_representation, |
| 3192 target_field_type, isolate); |
| 3179 } | 3193 } |
| 3180 Handle<Object> wrapped_type(WrapType(next_field_type)); | 3194 Handle<Object> wrapped_type(WrapType(next_field_type)); |
| 3181 DataDescriptor d(target_key, current_offset, wrapped_type, | 3195 DataDescriptor d(target_key, current_offset, wrapped_type, |
| 3182 next_attributes, next_representation); | 3196 next_attributes, next_representation); |
| 3183 current_offset += d.GetDetails().field_width_in_words(); | 3197 current_offset += d.GetDetails().field_width_in_words(); |
| 3184 new_descriptors->Set(i, &d); | 3198 new_descriptors->Set(i, &d); |
| 3185 } else { | 3199 } else { |
| 3186 UNIMPLEMENTED(); // TODO(ishell): implement. | 3200 UNIMPLEMENTED(); // TODO(ishell): implement. |
| 3187 } | 3201 } |
| 3188 } else { | 3202 } else { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3229 | 3243 |
| 3230 if (next_location == kField) { | 3244 if (next_location == kField) { |
| 3231 if (next_kind == kData) { | 3245 if (next_kind == kData) { |
| 3232 Handle<HeapType> next_field_type; | 3246 Handle<HeapType> next_field_type; |
| 3233 if (modify_index == i) { | 3247 if (modify_index == i) { |
| 3234 next_field_type = new_field_type; | 3248 next_field_type = new_field_type; |
| 3235 if (!property_kind_reconfiguration) { | 3249 if (!property_kind_reconfiguration) { |
| 3236 Handle<HeapType> old_field_type = | 3250 Handle<HeapType> old_field_type = |
| 3237 GetFieldType(isolate, old_descriptors, i, | 3251 GetFieldType(isolate, old_descriptors, i, |
| 3238 old_details.location(), next_representation); | 3252 old_details.location(), next_representation); |
| 3239 next_field_type = | 3253 next_field_type = GeneralizeFieldType( |
| 3240 GeneralizeFieldType(next_field_type, old_field_type, isolate); | 3254 old_details.representation(), old_field_type, |
| 3255 next_representation, next_field_type, isolate); |
| 3241 } | 3256 } |
| 3242 } else { | 3257 } else { |
| 3243 Handle<HeapType> old_field_type = | 3258 Handle<HeapType> old_field_type = |
| 3244 GetFieldType(isolate, old_descriptors, i, old_details.location(), | 3259 GetFieldType(isolate, old_descriptors, i, old_details.location(), |
| 3245 next_representation); | 3260 next_representation); |
| 3246 next_field_type = old_field_type; | 3261 next_field_type = old_field_type; |
| 3247 } | 3262 } |
| 3248 | 3263 |
| 3249 Handle<Object> wrapped_type(WrapType(next_field_type)); | 3264 Handle<Object> wrapped_type(WrapType(next_field_type)); |
| 3250 | 3265 |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3791 it->WriteDataValue(to_assign); | 3806 it->WriteDataValue(to_assign); |
| 3792 | 3807 |
| 3793 // Send the change record if there are observers. | 3808 // Send the change record if there are observers. |
| 3794 if (is_observed && !value->SameValue(*maybe_old.ToHandleChecked())) { | 3809 if (is_observed && !value->SameValue(*maybe_old.ToHandleChecked())) { |
| 3795 RETURN_ON_EXCEPTION(it->isolate(), JSObject::EnqueueChangeRecord( | 3810 RETURN_ON_EXCEPTION(it->isolate(), JSObject::EnqueueChangeRecord( |
| 3796 receiver, "update", it->GetName(), | 3811 receiver, "update", it->GetName(), |
| 3797 maybe_old.ToHandleChecked()), | 3812 maybe_old.ToHandleChecked()), |
| 3798 Object); | 3813 Object); |
| 3799 } | 3814 } |
| 3800 | 3815 |
| 3816 #if VERIFY_HEAP |
| 3817 if (FLAG_verify_heap) { |
| 3818 receiver->JSObjectVerify(); |
| 3819 } |
| 3820 #endif |
| 3801 return value; | 3821 return value; |
| 3802 } | 3822 } |
| 3803 | 3823 |
| 3804 | 3824 |
| 3805 MUST_USE_RESULT static MaybeHandle<Object> BeginPerformSplice( | 3825 MUST_USE_RESULT static MaybeHandle<Object> BeginPerformSplice( |
| 3806 Handle<JSArray> object) { | 3826 Handle<JSArray> object) { |
| 3807 Isolate* isolate = object->GetIsolate(); | 3827 Isolate* isolate = object->GetIsolate(); |
| 3808 HandleScope scope(isolate); | 3828 HandleScope scope(isolate); |
| 3809 Handle<Object> args[] = {object}; | 3829 Handle<Object> args[] = {object}; |
| 3810 | 3830 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3913 } | 3933 } |
| 3914 | 3934 |
| 3915 // Send the change record if there are observers. | 3935 // Send the change record if there are observers. |
| 3916 if (receiver->map()->is_observed() && | 3936 if (receiver->map()->is_observed() && |
| 3917 !isolate->IsInternallyUsedPropertyName(it->name())) { | 3937 !isolate->IsInternallyUsedPropertyName(it->name())) { |
| 3918 RETURN_ON_EXCEPTION(isolate, JSObject::EnqueueChangeRecord( | 3938 RETURN_ON_EXCEPTION(isolate, JSObject::EnqueueChangeRecord( |
| 3919 receiver, "add", it->name(), | 3939 receiver, "add", it->name(), |
| 3920 it->factory()->the_hole_value()), | 3940 it->factory()->the_hole_value()), |
| 3921 Object); | 3941 Object); |
| 3922 } | 3942 } |
| 3943 #if VERIFY_HEAP |
| 3944 if (FLAG_verify_heap) { |
| 3945 receiver->JSObjectVerify(); |
| 3946 } |
| 3947 #endif |
| 3923 } | 3948 } |
| 3924 | 3949 |
| 3925 return value; | 3950 return value; |
| 3926 } | 3951 } |
| 3927 | 3952 |
| 3928 | 3953 |
| 3929 void Map::EnsureDescriptorSlack(Handle<Map> map, int slack) { | 3954 void Map::EnsureDescriptorSlack(Handle<Map> map, int slack) { |
| 3930 // Only supports adding slack to owned descriptors. | 3955 // Only supports adding slack to owned descriptors. |
| 3931 DCHECK(map->owns_descriptors()); | 3956 DCHECK(map->owns_descriptors()); |
| 3932 | 3957 |
| (...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4565 | 4590 |
| 4566 | 4591 |
| 4567 void JSObject::MigrateInstance(Handle<JSObject> object) { | 4592 void JSObject::MigrateInstance(Handle<JSObject> object) { |
| 4568 Handle<Map> original_map(object->map()); | 4593 Handle<Map> original_map(object->map()); |
| 4569 Handle<Map> map = Map::Update(original_map); | 4594 Handle<Map> map = Map::Update(original_map); |
| 4570 map->set_migration_target(true); | 4595 map->set_migration_target(true); |
| 4571 MigrateToMap(object, map); | 4596 MigrateToMap(object, map); |
| 4572 if (FLAG_trace_migration) { | 4597 if (FLAG_trace_migration) { |
| 4573 object->PrintInstanceMigration(stdout, *original_map, *map); | 4598 object->PrintInstanceMigration(stdout, *original_map, *map); |
| 4574 } | 4599 } |
| 4600 #if VERIFY_HEAP |
| 4601 if (FLAG_verify_heap) { |
| 4602 object->JSObjectVerify(); |
| 4603 } |
| 4604 #endif |
| 4575 } | 4605 } |
| 4576 | 4606 |
| 4577 | 4607 |
| 4578 // static | 4608 // static |
| 4579 bool JSObject::TryMigrateInstance(Handle<JSObject> object) { | 4609 bool JSObject::TryMigrateInstance(Handle<JSObject> object) { |
| 4580 Isolate* isolate = object->GetIsolate(); | 4610 Isolate* isolate = object->GetIsolate(); |
| 4581 DisallowDeoptimization no_deoptimization(isolate); | 4611 DisallowDeoptimization no_deoptimization(isolate); |
| 4582 Handle<Map> original_map(object->map(), isolate); | 4612 Handle<Map> original_map(object->map(), isolate); |
| 4583 Handle<Map> new_map; | 4613 Handle<Map> new_map; |
| 4584 if (!Map::TryUpdate(original_map).ToHandle(&new_map)) { | 4614 if (!Map::TryUpdate(original_map).ToHandle(&new_map)) { |
| 4585 return false; | 4615 return false; |
| 4586 } | 4616 } |
| 4587 JSObject::MigrateToMap(object, new_map); | 4617 JSObject::MigrateToMap(object, new_map); |
| 4588 if (FLAG_trace_migration) { | 4618 if (FLAG_trace_migration) { |
| 4589 object->PrintInstanceMigration(stdout, *original_map, object->map()); | 4619 object->PrintInstanceMigration(stdout, *original_map, object->map()); |
| 4590 } | 4620 } |
| 4621 #if VERIFY_HEAP |
| 4622 if (FLAG_verify_heap) { |
| 4623 object->JSObjectVerify(); |
| 4624 } |
| 4625 #endif |
| 4591 return true; | 4626 return true; |
| 4592 } | 4627 } |
| 4593 | 4628 |
| 4594 | 4629 |
| 4595 void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name, | 4630 void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name, |
| 4596 Handle<Object> value, | 4631 Handle<Object> value, |
| 4597 PropertyAttributes attributes) { | 4632 PropertyAttributes attributes) { |
| 4598 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); | 4633 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 4599 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); | 4634 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); |
| 4600 #ifdef DEBUG | 4635 #ifdef DEBUG |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4689 // By clearing the setter we don't have to introduce a lookup to | 4724 // By clearing the setter we don't have to introduce a lookup to |
| 4690 // the setter, simply make it unavailable to reflect the | 4725 // the setter, simply make it unavailable to reflect the |
| 4691 // attributes. | 4726 // attributes. |
| 4692 if (attributes & READ_ONLY) { | 4727 if (attributes & READ_ONLY) { |
| 4693 ExecutableAccessorInfo::ClearSetter(new_data); | 4728 ExecutableAccessorInfo::ClearSetter(new_data); |
| 4694 } | 4729 } |
| 4695 | 4730 |
| 4696 it->TransitionToAccessorPair(new_data, attributes); | 4731 it->TransitionToAccessorPair(new_data, attributes); |
| 4697 } else { | 4732 } else { |
| 4698 it->ReconfigureDataProperty(value, attributes); | 4733 it->ReconfigureDataProperty(value, attributes); |
| 4699 it->WriteDataValue(value); | |
| 4700 } | 4734 } |
| 4701 | 4735 |
| 4702 if (is_observed) { | 4736 if (is_observed) { |
| 4703 RETURN_ON_EXCEPTION( | 4737 RETURN_ON_EXCEPTION( |
| 4704 it->isolate(), | 4738 it->isolate(), |
| 4705 EnqueueChangeRecord(object, "reconfigure", it->GetName(), | 4739 EnqueueChangeRecord(object, "reconfigure", it->GetName(), |
| 4706 it->factory()->the_hole_value()), | 4740 it->factory()->the_hole_value()), |
| 4707 Object); | 4741 Object); |
| 4708 } | 4742 } |
| 4709 | 4743 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 4725 // non-writable nor to non-enumerable. | 4759 // non-writable nor to non-enumerable. |
| 4726 if (it->IsElement() && object->HasFixedTypedArrayElements()) { | 4760 if (it->IsElement() && object->HasFixedTypedArrayElements()) { |
| 4727 return RedefineNonconfigurableProperty(it->isolate(), it->GetName(), | 4761 return RedefineNonconfigurableProperty(it->isolate(), it->GetName(), |
| 4728 value, STRICT); | 4762 value, STRICT); |
| 4729 } | 4763 } |
| 4730 | 4764 |
| 4731 // Reconfigure the data property if the attributes mismatch. | 4765 // Reconfigure the data property if the attributes mismatch. |
| 4732 if (is_observed) old_value = it->GetDataValue(); | 4766 if (is_observed) old_value = it->GetDataValue(); |
| 4733 | 4767 |
| 4734 it->ReconfigureDataProperty(value, attributes); | 4768 it->ReconfigureDataProperty(value, attributes); |
| 4735 it->WriteDataValue(value); | |
| 4736 | 4769 |
| 4737 if (is_observed) { | 4770 if (is_observed) { |
| 4738 if (old_value->SameValue(*value)) { | 4771 if (old_value->SameValue(*value)) { |
| 4739 old_value = it->factory()->the_hole_value(); | 4772 old_value = it->factory()->the_hole_value(); |
| 4740 } | 4773 } |
| 4741 RETURN_ON_EXCEPTION(it->isolate(), | 4774 RETURN_ON_EXCEPTION(it->isolate(), |
| 4742 EnqueueChangeRecord(object, "reconfigure", | 4775 EnqueueChangeRecord(object, "reconfigure", |
| 4743 it->GetName(), old_value), | 4776 it->GetName(), old_value), |
| 4744 Object); | 4777 Object); |
| 4745 } | 4778 } |
| (...skipping 11944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16690 if (cell->value() != *new_value) { | 16723 if (cell->value() != *new_value) { |
| 16691 cell->set_value(*new_value); | 16724 cell->set_value(*new_value); |
| 16692 Isolate* isolate = cell->GetIsolate(); | 16725 Isolate* isolate = cell->GetIsolate(); |
| 16693 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 16726 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 16694 isolate, DependentCode::kPropertyCellChangedGroup); | 16727 isolate, DependentCode::kPropertyCellChangedGroup); |
| 16695 } | 16728 } |
| 16696 } | 16729 } |
| 16697 | 16730 |
| 16698 } // namespace internal | 16731 } // namespace internal |
| 16699 } // namespace v8 | 16732 } // namespace v8 |
| OLD | NEW |