Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: src/objects.cc

Issue 1541403002: [field type tracking] Fix handling of cleared WeakCells. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698