OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 3815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3826 PropertyDetails new_details = new_descriptors->GetDetails(i); | 3826 PropertyDetails new_details = new_descriptors->GetDetails(i); |
3827 DCHECK_EQ(old_details.kind(), new_details.kind()); | 3827 DCHECK_EQ(old_details.kind(), new_details.kind()); |
3828 DCHECK_EQ(old_details.attributes(), new_details.attributes()); | 3828 DCHECK_EQ(old_details.attributes(), new_details.attributes()); |
3829 if (!old_details.representation().fits_into(new_details.representation())) { | 3829 if (!old_details.representation().fits_into(new_details.representation())) { |
3830 return MaybeHandle<Map>(); | 3830 return MaybeHandle<Map>(); |
3831 } | 3831 } |
3832 switch (new_details.type()) { | 3832 switch (new_details.type()) { |
3833 case DATA: { | 3833 case DATA: { |
3834 HeapType* new_type = new_descriptors->GetFieldType(i); | 3834 HeapType* new_type = new_descriptors->GetFieldType(i); |
3835 // Cleared field types need special treatment. They represent lost | 3835 // Cleared field types need special treatment. They represent lost |
3836 // knowledge, so we must first generalize the old_type to "Any". | 3836 // knowledge, so we must first generalize the new_type to "Any". |
3837 if (!FieldTypeIsCleared(new_details.representation(), new_type)) { | 3837 if (FieldTypeIsCleared(new_details.representation(), new_type)) { |
3838 return MaybeHandle<Map>(); | 3838 return MaybeHandle<Map>(); |
3839 } | 3839 } |
3840 PropertyType old_property_type = old_details.type(); | 3840 PropertyType old_property_type = old_details.type(); |
3841 if (old_property_type == DATA) { | 3841 if (old_property_type == DATA) { |
3842 HeapType* old_type = old_descriptors->GetFieldType(i); | 3842 HeapType* old_type = old_descriptors->GetFieldType(i); |
3843 if (FieldTypeIsCleared(old_details.representation(), old_type) || | 3843 if (FieldTypeIsCleared(old_details.representation(), old_type) || |
3844 !old_type->NowIs(new_type)) { | 3844 !old_type->NowIs(new_type)) { |
3845 return MaybeHandle<Map>(); | 3845 return MaybeHandle<Map>(); |
3846 } | 3846 } |
3847 } else { | 3847 } else { |
(...skipping 15633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
19481 if (cell->value() != *new_value) { | 19481 if (cell->value() != *new_value) { |
19482 cell->set_value(*new_value); | 19482 cell->set_value(*new_value); |
19483 Isolate* isolate = cell->GetIsolate(); | 19483 Isolate* isolate = cell->GetIsolate(); |
19484 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 19484 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
19485 isolate, DependentCode::kPropertyCellChangedGroup); | 19485 isolate, DependentCode::kPropertyCellChangedGroup); |
19486 } | 19486 } |
19487 } | 19487 } |
19488 | 19488 |
19489 } // namespace internal | 19489 } // namespace internal |
19490 } // namespace v8 | 19490 } // namespace v8 |
OLD | NEW |