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 1646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1657 PropertyDetails details = | 1657 PropertyDetails details = |
1658 target->instance_descriptors()->GetDetails(descriptor); | 1658 target->instance_descriptors()->GetDetails(descriptor); |
1659 Representation expected_representation = details.representation(); | 1659 Representation expected_representation = details.representation(); |
1660 if (value->FitsRepresentation(expected_representation)) { | 1660 if (value->FitsRepresentation(expected_representation)) { |
1661 if (expected_representation.IsHeapObject() && | 1661 if (expected_representation.IsHeapObject() && |
1662 !target->instance_descriptors() | 1662 !target->instance_descriptors() |
1663 ->GetFieldType(descriptor) | 1663 ->GetFieldType(descriptor) |
1664 ->NowContains(value)) { | 1664 ->NowContains(value)) { |
1665 Handle<FieldType> value_type = | 1665 Handle<FieldType> value_type = |
1666 value->OptimalType(isolate_, expected_representation); | 1666 value->OptimalType(isolate_, expected_representation); |
1667 Map::GeneralizeFieldType(target, descriptor, | 1667 Map::GeneralizeField(target, descriptor, expected_representation, |
1668 expected_representation, value_type); | 1668 value_type); |
1669 } | 1669 } |
1670 DCHECK(target->instance_descriptors() | 1670 DCHECK(target->instance_descriptors() |
1671 ->GetFieldType(descriptor) | 1671 ->GetFieldType(descriptor) |
1672 ->NowContains(value)); | 1672 ->NowContains(value)); |
1673 properties.push_back(value); | 1673 properties.push_back(value); |
1674 map = target; | 1674 map = target; |
1675 continue; | 1675 continue; |
1676 } else { | 1676 } else { |
1677 transitioning = false; | 1677 transitioning = false; |
1678 } | 1678 } |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 if (stack.size() != 1) { | 1870 if (stack.size() != 1) { |
1871 isolate_->Throw(*isolate_->factory()->NewError( | 1871 isolate_->Throw(*isolate_->factory()->NewError( |
1872 MessageTemplate::kDataCloneDeserializationError)); | 1872 MessageTemplate::kDataCloneDeserializationError)); |
1873 return MaybeHandle<Object>(); | 1873 return MaybeHandle<Object>(); |
1874 } | 1874 } |
1875 return scope.CloseAndEscape(stack[0]); | 1875 return scope.CloseAndEscape(stack[0]); |
1876 } | 1876 } |
1877 | 1877 |
1878 } // namespace internal | 1878 } // namespace internal |
1879 } // namespace v8 | 1879 } // namespace v8 |
OLD | NEW |