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 1655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 PropertyDetails details = | 1666 PropertyDetails details = |
1667 target->instance_descriptors()->GetDetails(descriptor); | 1667 target->instance_descriptors()->GetDetails(descriptor); |
1668 Representation expected_representation = details.representation(); | 1668 Representation expected_representation = details.representation(); |
1669 if (value->FitsRepresentation(expected_representation)) { | 1669 if (value->FitsRepresentation(expected_representation)) { |
1670 if (expected_representation.IsHeapObject() && | 1670 if (expected_representation.IsHeapObject() && |
1671 !target->instance_descriptors() | 1671 !target->instance_descriptors() |
1672 ->GetFieldType(descriptor) | 1672 ->GetFieldType(descriptor) |
1673 ->NowContains(value)) { | 1673 ->NowContains(value)) { |
1674 Handle<FieldType> value_type = | 1674 Handle<FieldType> value_type = |
1675 value->OptimalType(isolate_, expected_representation); | 1675 value->OptimalType(isolate_, expected_representation); |
1676 Map::GeneralizeField(target, descriptor, expected_representation, | 1676 Map::GeneralizeField(target, descriptor, details.constness(), |
1677 value_type); | 1677 expected_representation, value_type); |
1678 } | 1678 } |
1679 DCHECK(target->instance_descriptors() | 1679 DCHECK(target->instance_descriptors() |
1680 ->GetFieldType(descriptor) | 1680 ->GetFieldType(descriptor) |
1681 ->NowContains(value)); | 1681 ->NowContains(value)); |
1682 properties.push_back(value); | 1682 properties.push_back(value); |
1683 map = target; | 1683 map = target; |
1684 continue; | 1684 continue; |
1685 } else { | 1685 } else { |
1686 transitioning = false; | 1686 transitioning = false; |
1687 } | 1687 } |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1879 if (stack.size() != 1) { | 1879 if (stack.size() != 1) { |
1880 isolate_->Throw(*isolate_->factory()->NewError( | 1880 isolate_->Throw(*isolate_->factory()->NewError( |
1881 MessageTemplate::kDataCloneDeserializationError)); | 1881 MessageTemplate::kDataCloneDeserializationError)); |
1882 return MaybeHandle<Object>(); | 1882 return MaybeHandle<Object>(); |
1883 } | 1883 } |
1884 return scope.CloseAndEscape(stack[0]); | 1884 return scope.CloseAndEscape(stack[0]); |
1885 } | 1885 } |
1886 | 1886 |
1887 } // namespace internal | 1887 } // namespace internal |
1888 } // namespace v8 | 1888 } // namespace v8 |
OLD | NEW |