OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/value-serializer.h" | 5 #include "src/value-serializer.h" |
6 | 6 |
7 #include <type_traits> | 7 #include <type_traits> |
8 | 8 |
9 #include "src/base/logging.h" | 9 #include "src/base/logging.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1716 PropertyDetails details = | 1716 PropertyDetails details = |
1717 target->instance_descriptors()->GetDetails(descriptor); | 1717 target->instance_descriptors()->GetDetails(descriptor); |
1718 Representation expected_representation = details.representation(); | 1718 Representation expected_representation = details.representation(); |
1719 if (value->FitsRepresentation(expected_representation)) { | 1719 if (value->FitsRepresentation(expected_representation)) { |
1720 if (expected_representation.IsHeapObject() && | 1720 if (expected_representation.IsHeapObject() && |
1721 !target->instance_descriptors() | 1721 !target->instance_descriptors() |
1722 ->GetFieldType(descriptor) | 1722 ->GetFieldType(descriptor) |
1723 ->NowContains(value)) { | 1723 ->NowContains(value)) { |
1724 Handle<FieldType> value_type = | 1724 Handle<FieldType> value_type = |
1725 value->OptimalType(isolate_, expected_representation); | 1725 value->OptimalType(isolate_, expected_representation); |
1726 Map::GeneralizeField(target, descriptor, expected_representation, | 1726 Map::GeneralizeField(target, descriptor, details.constness(), |
1727 value_type); | 1727 expected_representation, value_type); |
1728 } | 1728 } |
1729 DCHECK(target->instance_descriptors() | 1729 DCHECK(target->instance_descriptors() |
1730 ->GetFieldType(descriptor) | 1730 ->GetFieldType(descriptor) |
1731 ->NowContains(value)); | 1731 ->NowContains(value)); |
1732 properties.push_back(value); | 1732 properties.push_back(value); |
1733 map = target; | 1733 map = target; |
1734 continue; | 1734 continue; |
1735 } else { | 1735 } else { |
1736 transitioning = false; | 1736 transitioning = false; |
1737 } | 1737 } |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 if (stack.size() != 1) { | 1929 if (stack.size() != 1) { |
1930 isolate_->Throw(*isolate_->factory()->NewError( | 1930 isolate_->Throw(*isolate_->factory()->NewError( |
1931 MessageTemplate::kDataCloneDeserializationError)); | 1931 MessageTemplate::kDataCloneDeserializationError)); |
1932 return MaybeHandle<Object>(); | 1932 return MaybeHandle<Object>(); |
1933 } | 1933 } |
1934 return scope.CloseAndEscape(stack[0]); | 1934 return scope.CloseAndEscape(stack[0]); |
1935 } | 1935 } |
1936 | 1936 |
1937 } // namespace internal | 1937 } // namespace internal |
1938 } // namespace v8 | 1938 } // namespace v8 |
OLD | NEW |