| 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 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2217 details.representation().IsNone()); | 2217 details.representation().IsNone()); |
| 2218 | 2218 |
| 2219 // Skip if already updated the shared descriptor. | 2219 // Skip if already updated the shared descriptor. |
| 2220 if (instance_descriptors()->GetValue(descriptor) == *new_wrapped_type) return; | 2220 if (instance_descriptors()->GetValue(descriptor) == *new_wrapped_type) return; |
| 2221 DataDescriptor d(name, instance_descriptors()->GetFieldIndex(descriptor), | 2221 DataDescriptor d(name, instance_descriptors()->GetFieldIndex(descriptor), |
| 2222 new_wrapped_type, details.attributes(), new_representation); | 2222 new_wrapped_type, details.attributes(), new_representation); |
| 2223 instance_descriptors()->Replace(descriptor, &d); | 2223 instance_descriptors()->Replace(descriptor, &d); |
| 2224 } | 2224 } |
| 2225 | 2225 |
| 2226 | 2226 |
| 2227 bool FieldTypeIsCleared(Representation rep, Handle<HeapType> type) { |
| 2228 return type->Is(HeapType::None()) && rep.IsHeapObject(); |
| 2229 } |
| 2230 |
| 2231 |
| 2227 // static | 2232 // static |
| 2228 Handle<HeapType> Map::GeneralizeFieldType(Handle<HeapType> type1, | 2233 Handle<HeapType> Map::GeneralizeFieldType(Representation rep1, |
| 2234 Handle<HeapType> type1, |
| 2235 Representation rep2, |
| 2229 Handle<HeapType> type2, | 2236 Handle<HeapType> type2, |
| 2230 Isolate* isolate) { | 2237 Isolate* isolate) { |
| 2238 // Cleared field types need special treatment. They represent lost knowledge, |
| 2239 // so we must be conservative, so their generalization with any other type |
| 2240 // is "Any". |
| 2241 if (FieldTypeIsCleared(rep1, type1) || FieldTypeIsCleared(rep2, type2)) { |
| 2242 return HeapType::Any(isolate); |
| 2243 } |
| 2231 if (type1->NowIs(type2)) return type2; | 2244 if (type1->NowIs(type2)) return type2; |
| 2232 if (type2->NowIs(type1)) return type1; | 2245 if (type2->NowIs(type1)) return type1; |
| 2233 return HeapType::Any(isolate); | 2246 return HeapType::Any(isolate); |
| 2234 } | 2247 } |
| 2235 | 2248 |
| 2236 | 2249 |
| 2237 // static | 2250 // static |
| 2238 void Map::GeneralizeFieldType(Handle<Map> map, int modify_index, | 2251 void Map::GeneralizeFieldType(Handle<Map> map, int modify_index, |
| 2239 Representation new_representation, | 2252 Representation new_representation, |
| 2240 Handle<HeapType> new_field_type) { | 2253 Handle<HeapType> new_field_type) { |
| 2241 Isolate* isolate = map->GetIsolate(); | 2254 Isolate* isolate = map->GetIsolate(); |
| 2242 | 2255 |
| 2243 // Check if we actually need to generalize the field type at all. | 2256 // Check if we actually need to generalize the field type at all. |
| 2244 Handle<DescriptorArray> old_descriptors(map->instance_descriptors(), isolate); | 2257 Handle<DescriptorArray> old_descriptors(map->instance_descriptors(), isolate); |
| 2245 Representation old_representation = | 2258 Representation old_representation = |
| 2246 old_descriptors->GetDetails(modify_index).representation(); | 2259 old_descriptors->GetDetails(modify_index).representation(); |
| 2247 Handle<HeapType> old_field_type(old_descriptors->GetFieldType(modify_index), | 2260 Handle<HeapType> old_field_type(old_descriptors->GetFieldType(modify_index), |
| 2248 isolate); | 2261 isolate); |
| 2249 | 2262 |
| 2250 if (old_representation.Equals(new_representation) && | 2263 if (old_representation.Equals(new_representation) && |
| 2264 !FieldTypeIsCleared(new_representation, new_field_type) && |
| 2265 // Checking old_field_type for being cleared is not necessary because |
| 2266 // the NowIs check below would fail anyway in that case. |
| 2251 new_field_type->NowIs(old_field_type)) { | 2267 new_field_type->NowIs(old_field_type)) { |
| 2252 DCHECK(Map::GeneralizeFieldType(old_field_type, | 2268 DCHECK(Map::GeneralizeFieldType(old_representation, old_field_type, |
| 2253 new_field_type, | 2269 new_representation, new_field_type, isolate) |
| 2254 isolate)->NowIs(old_field_type)); | 2270 ->NowIs(old_field_type)); |
| 2255 return; | 2271 return; |
| 2256 } | 2272 } |
| 2257 | 2273 |
| 2258 // Determine the field owner. | 2274 // Determine the field owner. |
| 2259 Handle<Map> field_owner(map->FindFieldOwner(modify_index), isolate); | 2275 Handle<Map> field_owner(map->FindFieldOwner(modify_index), isolate); |
| 2260 Handle<DescriptorArray> descriptors( | 2276 Handle<DescriptorArray> descriptors( |
| 2261 field_owner->instance_descriptors(), isolate); | 2277 field_owner->instance_descriptors(), isolate); |
| 2262 DCHECK_EQ(*old_field_type, descriptors->GetFieldType(modify_index)); | 2278 DCHECK_EQ(*old_field_type, descriptors->GetFieldType(modify_index)); |
| 2263 bool old_field_type_was_cleared = | |
| 2264 old_field_type->Is(HeapType::None()) && old_representation.IsHeapObject(); | |
| 2265 | 2279 |
| 2266 // Determine the generalized new field type. Conservatively assume type Any | |
| 2267 // for cleared field types because the cleared type could have been a | |
| 2268 // deprecated map and there still could be live instances with a non- | |
| 2269 // deprecated version of the map. | |
| 2270 new_field_type = | 2280 new_field_type = |
| 2271 old_field_type_was_cleared | 2281 Map::GeneralizeFieldType(old_representation, old_field_type, |
| 2272 ? HeapType::Any(isolate) | 2282 new_representation, new_field_type, isolate); |
| 2273 : Map::GeneralizeFieldType(old_field_type, new_field_type, isolate); | |
| 2274 | 2283 |
| 2275 PropertyDetails details = descriptors->GetDetails(modify_index); | 2284 PropertyDetails details = descriptors->GetDetails(modify_index); |
| 2276 Handle<Name> name(descriptors->GetKey(modify_index)); | 2285 Handle<Name> name(descriptors->GetKey(modify_index)); |
| 2277 | 2286 |
| 2278 Handle<Object> wrapped_type(WrapType(new_field_type)); | 2287 Handle<Object> wrapped_type(WrapType(new_field_type)); |
| 2279 field_owner->UpdateFieldType(modify_index, name, new_representation, | 2288 field_owner->UpdateFieldType(modify_index, name, new_representation, |
| 2280 wrapped_type); | 2289 wrapped_type); |
| 2281 field_owner->dependent_code()->DeoptimizeDependentCodeGroup( | 2290 field_owner->dependent_code()->DeoptimizeDependentCodeGroup( |
| 2282 isolate, DependentCode::kFieldTypeGroup); | 2291 isolate, DependentCode::kFieldTypeGroup); |
| 2283 | 2292 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2487 PropertyLocation tmp_location = tmp_details.location(); | 2496 PropertyLocation tmp_location = tmp_details.location(); |
| 2488 if (tmp_location == kField) { | 2497 if (tmp_location == kField) { |
| 2489 if (next_kind == kData) { | 2498 if (next_kind == kData) { |
| 2490 Handle<HeapType> next_field_type; | 2499 Handle<HeapType> next_field_type; |
| 2491 if (modify_index == i) { | 2500 if (modify_index == i) { |
| 2492 next_field_type = new_field_type; | 2501 next_field_type = new_field_type; |
| 2493 if (!property_kind_reconfiguration) { | 2502 if (!property_kind_reconfiguration) { |
| 2494 Handle<HeapType> old_field_type = | 2503 Handle<HeapType> old_field_type = |
| 2495 GetFieldType(isolate, old_descriptors, i, | 2504 GetFieldType(isolate, old_descriptors, i, |
| 2496 old_details.location(), tmp_representation); | 2505 old_details.location(), tmp_representation); |
| 2497 next_field_type = | 2506 Representation old_representation = old_details.representation(); |
| 2498 GeneralizeFieldType(next_field_type, old_field_type, isolate); | 2507 next_field_type = GeneralizeFieldType( |
| 2508 old_representation, old_field_type, new_representation, |
| 2509 next_field_type, isolate); |
| 2499 } | 2510 } |
| 2500 } else { | 2511 } else { |
| 2501 Handle<HeapType> old_field_type = | 2512 Handle<HeapType> old_field_type = |
| 2502 GetFieldType(isolate, old_descriptors, i, old_details.location(), | 2513 GetFieldType(isolate, old_descriptors, i, old_details.location(), |
| 2503 tmp_representation); | 2514 tmp_representation); |
| 2504 next_field_type = old_field_type; | 2515 next_field_type = old_field_type; |
| 2505 } | 2516 } |
| 2506 GeneralizeFieldType(tmp_map, i, tmp_representation, next_field_type); | 2517 GeneralizeFieldType(tmp_map, i, tmp_representation, next_field_type); |
| 2507 } | 2518 } |
| 2508 } else if (old_location == kField || | 2519 } else if (old_location == kField || |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2652 DCHECK_EQ(next_attributes, target_details.attributes()); | 2663 DCHECK_EQ(next_attributes, target_details.attributes()); |
| 2653 | 2664 |
| 2654 if (next_location == kField) { | 2665 if (next_location == kField) { |
| 2655 if (next_kind == kData) { | 2666 if (next_kind == kData) { |
| 2656 Handle<HeapType> target_field_type = | 2667 Handle<HeapType> target_field_type = |
| 2657 GetFieldType(isolate, target_descriptors, i, | 2668 GetFieldType(isolate, target_descriptors, i, |
| 2658 target_details.location(), next_representation); | 2669 target_details.location(), next_representation); |
| 2659 | 2670 |
| 2660 Handle<HeapType> next_field_type; | 2671 Handle<HeapType> next_field_type; |
| 2661 if (modify_index == i) { | 2672 if (modify_index == i) { |
| 2662 next_field_type = | 2673 next_field_type = GeneralizeFieldType( |
| 2663 GeneralizeFieldType(target_field_type, new_field_type, isolate); | 2674 target_details.representation(), target_field_type, |
| 2675 new_representation, new_field_type, isolate); |
| 2664 if (!property_kind_reconfiguration) { | 2676 if (!property_kind_reconfiguration) { |
| 2665 Handle<HeapType> old_field_type = | 2677 Handle<HeapType> old_field_type = |
| 2666 GetFieldType(isolate, old_descriptors, i, | 2678 GetFieldType(isolate, old_descriptors, i, |
| 2667 old_details.location(), next_representation); | 2679 old_details.location(), next_representation); |
| 2668 next_field_type = | 2680 next_field_type = GeneralizeFieldType( |
| 2669 GeneralizeFieldType(next_field_type, old_field_type, isolate); | 2681 old_details.representation(), old_field_type, |
| 2682 next_representation, next_field_type, isolate); |
| 2670 } | 2683 } |
| 2671 } else { | 2684 } else { |
| 2672 Handle<HeapType> old_field_type = | 2685 Handle<HeapType> old_field_type = |
| 2673 GetFieldType(isolate, old_descriptors, i, old_details.location(), | 2686 GetFieldType(isolate, old_descriptors, i, old_details.location(), |
| 2674 next_representation); | 2687 next_representation); |
| 2675 next_field_type = | 2688 next_field_type = GeneralizeFieldType( |
| 2676 GeneralizeFieldType(target_field_type, old_field_type, isolate); | 2689 old_details.representation(), old_field_type, next_representation, |
| 2690 target_field_type, isolate); |
| 2677 } | 2691 } |
| 2678 Handle<Object> wrapped_type(WrapType(next_field_type)); | 2692 Handle<Object> wrapped_type(WrapType(next_field_type)); |
| 2679 DataDescriptor d(target_key, current_offset, wrapped_type, | 2693 DataDescriptor d(target_key, current_offset, wrapped_type, |
| 2680 next_attributes, next_representation); | 2694 next_attributes, next_representation); |
| 2681 current_offset += d.GetDetails().field_width_in_words(); | 2695 current_offset += d.GetDetails().field_width_in_words(); |
| 2682 new_descriptors->Set(i, &d); | 2696 new_descriptors->Set(i, &d); |
| 2683 } else { | 2697 } else { |
| 2684 UNIMPLEMENTED(); // TODO(ishell): implement. | 2698 UNIMPLEMENTED(); // TODO(ishell): implement. |
| 2685 } | 2699 } |
| 2686 } else { | 2700 } else { |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2727 | 2741 |
| 2728 if (next_location == kField) { | 2742 if (next_location == kField) { |
| 2729 if (next_kind == kData) { | 2743 if (next_kind == kData) { |
| 2730 Handle<HeapType> next_field_type; | 2744 Handle<HeapType> next_field_type; |
| 2731 if (modify_index == i) { | 2745 if (modify_index == i) { |
| 2732 next_field_type = new_field_type; | 2746 next_field_type = new_field_type; |
| 2733 if (!property_kind_reconfiguration) { | 2747 if (!property_kind_reconfiguration) { |
| 2734 Handle<HeapType> old_field_type = | 2748 Handle<HeapType> old_field_type = |
| 2735 GetFieldType(isolate, old_descriptors, i, | 2749 GetFieldType(isolate, old_descriptors, i, |
| 2736 old_details.location(), next_representation); | 2750 old_details.location(), next_representation); |
| 2737 next_field_type = | 2751 next_field_type = GeneralizeFieldType( |
| 2738 GeneralizeFieldType(next_field_type, old_field_type, isolate); | 2752 old_details.representation(), old_field_type, |
| 2753 next_representation, next_field_type, isolate); |
| 2739 } | 2754 } |
| 2740 } else { | 2755 } else { |
| 2741 Handle<HeapType> old_field_type = | 2756 Handle<HeapType> old_field_type = |
| 2742 GetFieldType(isolate, old_descriptors, i, old_details.location(), | 2757 GetFieldType(isolate, old_descriptors, i, old_details.location(), |
| 2743 next_representation); | 2758 next_representation); |
| 2744 next_field_type = old_field_type; | 2759 next_field_type = old_field_type; |
| 2745 } | 2760 } |
| 2746 | 2761 |
| 2747 Handle<Object> wrapped_type(WrapType(next_field_type)); | 2762 Handle<Object> wrapped_type(WrapType(next_field_type)); |
| 2748 | 2763 |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3290 it->WriteDataValue(to_assign); | 3305 it->WriteDataValue(to_assign); |
| 3291 | 3306 |
| 3292 // Send the change record if there are observers. | 3307 // Send the change record if there are observers. |
| 3293 if (is_observed && !value->SameValue(*maybe_old.ToHandleChecked())) { | 3308 if (is_observed && !value->SameValue(*maybe_old.ToHandleChecked())) { |
| 3294 RETURN_ON_EXCEPTION(it->isolate(), JSObject::EnqueueChangeRecord( | 3309 RETURN_ON_EXCEPTION(it->isolate(), JSObject::EnqueueChangeRecord( |
| 3295 receiver, "update", it->GetName(), | 3310 receiver, "update", it->GetName(), |
| 3296 maybe_old.ToHandleChecked()), | 3311 maybe_old.ToHandleChecked()), |
| 3297 Object); | 3312 Object); |
| 3298 } | 3313 } |
| 3299 | 3314 |
| 3315 #if VERIFY_HEAP |
| 3316 if (FLAG_verify_heap) { |
| 3317 receiver->JSObjectVerify(); |
| 3318 } |
| 3319 #endif |
| 3300 return value; | 3320 return value; |
| 3301 } | 3321 } |
| 3302 | 3322 |
| 3303 | 3323 |
| 3304 MUST_USE_RESULT static MaybeHandle<Object> BeginPerformSplice( | 3324 MUST_USE_RESULT static MaybeHandle<Object> BeginPerformSplice( |
| 3305 Handle<JSArray> object) { | 3325 Handle<JSArray> object) { |
| 3306 Isolate* isolate = object->GetIsolate(); | 3326 Isolate* isolate = object->GetIsolate(); |
| 3307 HandleScope scope(isolate); | 3327 HandleScope scope(isolate); |
| 3308 Handle<Object> args[] = {object}; | 3328 Handle<Object> args[] = {object}; |
| 3309 | 3329 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3412 } | 3432 } |
| 3413 | 3433 |
| 3414 // Send the change record if there are observers. | 3434 // Send the change record if there are observers. |
| 3415 if (receiver->map()->is_observed() && | 3435 if (receiver->map()->is_observed() && |
| 3416 !isolate->IsInternallyUsedPropertyName(it->name())) { | 3436 !isolate->IsInternallyUsedPropertyName(it->name())) { |
| 3417 RETURN_ON_EXCEPTION(isolate, JSObject::EnqueueChangeRecord( | 3437 RETURN_ON_EXCEPTION(isolate, JSObject::EnqueueChangeRecord( |
| 3418 receiver, "add", it->name(), | 3438 receiver, "add", it->name(), |
| 3419 it->factory()->the_hole_value()), | 3439 it->factory()->the_hole_value()), |
| 3420 Object); | 3440 Object); |
| 3421 } | 3441 } |
| 3442 #if VERIFY_HEAP |
| 3443 if (FLAG_verify_heap) { |
| 3444 receiver->JSObjectVerify(); |
| 3445 } |
| 3446 #endif |
| 3422 } | 3447 } |
| 3423 | 3448 |
| 3424 return value; | 3449 return value; |
| 3425 } | 3450 } |
| 3426 | 3451 |
| 3427 | 3452 |
| 3428 void Map::EnsureDescriptorSlack(Handle<Map> map, int slack) { | 3453 void Map::EnsureDescriptorSlack(Handle<Map> map, int slack) { |
| 3429 // Only supports adding slack to owned descriptors. | 3454 // Only supports adding slack to owned descriptors. |
| 3430 DCHECK(map->owns_descriptors()); | 3455 DCHECK(map->owns_descriptors()); |
| 3431 | 3456 |
| (...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4056 | 4081 |
| 4057 | 4082 |
| 4058 void JSObject::MigrateInstance(Handle<JSObject> object) { | 4083 void JSObject::MigrateInstance(Handle<JSObject> object) { |
| 4059 Handle<Map> original_map(object->map()); | 4084 Handle<Map> original_map(object->map()); |
| 4060 Handle<Map> map = Map::Update(original_map); | 4085 Handle<Map> map = Map::Update(original_map); |
| 4061 map->set_migration_target(true); | 4086 map->set_migration_target(true); |
| 4062 MigrateToMap(object, map); | 4087 MigrateToMap(object, map); |
| 4063 if (FLAG_trace_migration) { | 4088 if (FLAG_trace_migration) { |
| 4064 object->PrintInstanceMigration(stdout, *original_map, *map); | 4089 object->PrintInstanceMigration(stdout, *original_map, *map); |
| 4065 } | 4090 } |
| 4091 #if VERIFY_HEAP |
| 4092 if (FLAG_verify_heap) { |
| 4093 object->JSObjectVerify(); |
| 4094 } |
| 4095 #endif |
| 4066 } | 4096 } |
| 4067 | 4097 |
| 4068 | 4098 |
| 4069 // static | 4099 // static |
| 4070 bool JSObject::TryMigrateInstance(Handle<JSObject> object) { | 4100 bool JSObject::TryMigrateInstance(Handle<JSObject> object) { |
| 4071 Isolate* isolate = object->GetIsolate(); | 4101 Isolate* isolate = object->GetIsolate(); |
| 4072 DisallowDeoptimization no_deoptimization(isolate); | 4102 DisallowDeoptimization no_deoptimization(isolate); |
| 4073 Handle<Map> original_map(object->map(), isolate); | 4103 Handle<Map> original_map(object->map(), isolate); |
| 4074 Handle<Map> new_map; | 4104 Handle<Map> new_map; |
| 4075 if (!Map::TryUpdate(original_map).ToHandle(&new_map)) { | 4105 if (!Map::TryUpdate(original_map).ToHandle(&new_map)) { |
| 4076 return false; | 4106 return false; |
| 4077 } | 4107 } |
| 4078 JSObject::MigrateToMap(object, new_map); | 4108 JSObject::MigrateToMap(object, new_map); |
| 4079 if (FLAG_trace_migration) { | 4109 if (FLAG_trace_migration) { |
| 4080 object->PrintInstanceMigration(stdout, *original_map, object->map()); | 4110 object->PrintInstanceMigration(stdout, *original_map, object->map()); |
| 4081 } | 4111 } |
| 4112 #if VERIFY_HEAP |
| 4113 if (FLAG_verify_heap) { |
| 4114 object->JSObjectVerify(); |
| 4115 } |
| 4116 #endif |
| 4082 return true; | 4117 return true; |
| 4083 } | 4118 } |
| 4084 | 4119 |
| 4085 | 4120 |
| 4086 void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name, | 4121 void JSObject::AddProperty(Handle<JSObject> object, Handle<Name> name, |
| 4087 Handle<Object> value, | 4122 Handle<Object> value, |
| 4088 PropertyAttributes attributes) { | 4123 PropertyAttributes attributes) { |
| 4089 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); | 4124 LookupIterator it(object, name, LookupIterator::OWN_SKIP_INTERCEPTOR); |
| 4090 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); | 4125 CHECK_NE(LookupIterator::ACCESS_CHECK, it.state()); |
| 4091 #ifdef DEBUG | 4126 #ifdef DEBUG |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4180 // By clearing the setter we don't have to introduce a lookup to | 4215 // By clearing the setter we don't have to introduce a lookup to |
| 4181 // the setter, simply make it unavailable to reflect the | 4216 // the setter, simply make it unavailable to reflect the |
| 4182 // attributes. | 4217 // attributes. |
| 4183 if (attributes & READ_ONLY) { | 4218 if (attributes & READ_ONLY) { |
| 4184 ExecutableAccessorInfo::ClearSetter(new_data); | 4219 ExecutableAccessorInfo::ClearSetter(new_data); |
| 4185 } | 4220 } |
| 4186 | 4221 |
| 4187 it->TransitionToAccessorPair(new_data, attributes); | 4222 it->TransitionToAccessorPair(new_data, attributes); |
| 4188 } else { | 4223 } else { |
| 4189 it->ReconfigureDataProperty(value, attributes); | 4224 it->ReconfigureDataProperty(value, attributes); |
| 4190 it->WriteDataValue(value); | |
| 4191 } | 4225 } |
| 4192 | 4226 |
| 4193 if (is_observed) { | 4227 if (is_observed) { |
| 4194 RETURN_ON_EXCEPTION( | 4228 RETURN_ON_EXCEPTION( |
| 4195 it->isolate(), | 4229 it->isolate(), |
| 4196 EnqueueChangeRecord(object, "reconfigure", it->GetName(), | 4230 EnqueueChangeRecord(object, "reconfigure", it->GetName(), |
| 4197 it->factory()->the_hole_value()), | 4231 it->factory()->the_hole_value()), |
| 4198 Object); | 4232 Object); |
| 4199 } | 4233 } |
| 4200 | 4234 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 4216 // non-writable nor to non-enumerable. | 4250 // non-writable nor to non-enumerable. |
| 4217 if (it->IsElement() && object->HasFixedTypedArrayElements()) { | 4251 if (it->IsElement() && object->HasFixedTypedArrayElements()) { |
| 4218 return RedefineNonconfigurableProperty(it->isolate(), it->GetName(), | 4252 return RedefineNonconfigurableProperty(it->isolate(), it->GetName(), |
| 4219 value, STRICT); | 4253 value, STRICT); |
| 4220 } | 4254 } |
| 4221 | 4255 |
| 4222 // Reconfigure the data property if the attributes mismatch. | 4256 // Reconfigure the data property if the attributes mismatch. |
| 4223 if (is_observed) old_value = it->GetDataValue(); | 4257 if (is_observed) old_value = it->GetDataValue(); |
| 4224 | 4258 |
| 4225 it->ReconfigureDataProperty(value, attributes); | 4259 it->ReconfigureDataProperty(value, attributes); |
| 4226 it->WriteDataValue(value); | |
| 4227 | 4260 |
| 4228 if (is_observed) { | 4261 if (is_observed) { |
| 4229 if (old_value->SameValue(*value)) { | 4262 if (old_value->SameValue(*value)) { |
| 4230 old_value = it->factory()->the_hole_value(); | 4263 old_value = it->factory()->the_hole_value(); |
| 4231 } | 4264 } |
| 4232 RETURN_ON_EXCEPTION(it->isolate(), | 4265 RETURN_ON_EXCEPTION(it->isolate(), |
| 4233 EnqueueChangeRecord(object, "reconfigure", | 4266 EnqueueChangeRecord(object, "reconfigure", |
| 4234 it->GetName(), old_value), | 4267 it->GetName(), old_value), |
| 4235 Object); | 4268 Object); |
| 4236 } | 4269 } |
| (...skipping 11474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15711 if (cell->value() != *new_value) { | 15744 if (cell->value() != *new_value) { |
| 15712 cell->set_value(*new_value); | 15745 cell->set_value(*new_value); |
| 15713 Isolate* isolate = cell->GetIsolate(); | 15746 Isolate* isolate = cell->GetIsolate(); |
| 15714 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15747 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 15715 isolate, DependentCode::kPropertyCellChangedGroup); | 15748 isolate, DependentCode::kPropertyCellChangedGroup); |
| 15716 } | 15749 } |
| 15717 } | 15750 } |
| 15718 | 15751 |
| 15719 } // namespace internal | 15752 } // namespace internal |
| 15720 } // namespace v8 | 15753 } // namespace v8 |
| OLD | NEW |