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 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2360 new_field_type, | 2360 new_field_type, |
2361 isolate)->NowIs(old_field_type)); | 2361 isolate)->NowIs(old_field_type)); |
2362 return; | 2362 return; |
2363 } | 2363 } |
2364 | 2364 |
2365 // Determine the field owner. | 2365 // Determine the field owner. |
2366 Handle<Map> field_owner(map->FindFieldOwner(modify_index), isolate); | 2366 Handle<Map> field_owner(map->FindFieldOwner(modify_index), isolate); |
2367 Handle<DescriptorArray> descriptors( | 2367 Handle<DescriptorArray> descriptors( |
2368 field_owner->instance_descriptors(), isolate); | 2368 field_owner->instance_descriptors(), isolate); |
2369 DCHECK_EQ(*old_field_type, descriptors->GetFieldType(modify_index)); | 2369 DCHECK_EQ(*old_field_type, descriptors->GetFieldType(modify_index)); |
| 2370 bool old_field_type_was_cleared = |
| 2371 old_field_type->Is(HeapType::None()) && old_representation.IsHeapObject(); |
2370 | 2372 |
2371 // Determine the generalized new field type. | 2373 // Determine the generalized new field type. Conservatively assume type Any |
2372 new_field_type = Map::GeneralizeFieldType( | 2374 // for cleared field types because the cleared type could have been a |
2373 old_field_type, new_field_type, isolate); | 2375 // deprecated map and there still could be live instances with a non- |
| 2376 // deprecated version of the map. |
| 2377 new_field_type = |
| 2378 old_field_type_was_cleared |
| 2379 ? HeapType::Any(isolate) |
| 2380 : Map::GeneralizeFieldType(old_field_type, new_field_type, isolate); |
2374 | 2381 |
2375 PropertyDetails details = descriptors->GetDetails(modify_index); | 2382 PropertyDetails details = descriptors->GetDetails(modify_index); |
2376 Handle<Name> name(descriptors->GetKey(modify_index)); | 2383 Handle<Name> name(descriptors->GetKey(modify_index)); |
2377 | 2384 |
2378 Handle<Object> wrapped_type(WrapType(new_field_type)); | 2385 Handle<Object> wrapped_type(WrapType(new_field_type)); |
2379 field_owner->UpdateFieldType(modify_index, name, new_representation, | 2386 field_owner->UpdateFieldType(modify_index, name, new_representation, |
2380 wrapped_type); | 2387 wrapped_type); |
2381 field_owner->dependent_code()->DeoptimizeDependentCodeGroup( | 2388 field_owner->dependent_code()->DeoptimizeDependentCodeGroup( |
2382 isolate, DependentCode::kFieldTypeGroup); | 2389 isolate, DependentCode::kFieldTypeGroup); |
2383 | 2390 |
(...skipping 14786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17170 CompilationInfo* info) { | 17177 CompilationInfo* info) { |
17171 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( | 17178 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( |
17172 handle(cell->dependent_code(), info->isolate()), | 17179 handle(cell->dependent_code(), info->isolate()), |
17173 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); | 17180 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); |
17174 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); | 17181 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); |
17175 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( | 17182 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( |
17176 cell, info->zone()); | 17183 cell, info->zone()); |
17177 } | 17184 } |
17178 | 17185 |
17179 } } // namespace v8::internal | 17186 } } // namespace v8::internal |
OLD | NEW |