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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 kFloat64Array = 'F', | 123 kFloat64Array = 'F', |
124 kDataView = '?', | 124 kDataView = '?', |
125 }; | 125 }; |
126 | 126 |
127 } // namespace | 127 } // namespace |
128 | 128 |
129 ValueSerializer::ValueSerializer(Isolate* isolate, | 129 ValueSerializer::ValueSerializer(Isolate* isolate, |
130 v8::ValueSerializer::Delegate* delegate) | 130 v8::ValueSerializer::Delegate* delegate) |
131 : isolate_(isolate), | 131 : isolate_(isolate), |
132 delegate_(delegate), | 132 delegate_(delegate), |
133 zone_(isolate->allocator()), | 133 zone_(isolate->allocator(), ZONE_NAME), |
134 id_map_(isolate->heap(), &zone_), | 134 id_map_(isolate->heap(), &zone_), |
135 array_buffer_transfer_map_(isolate->heap(), &zone_) {} | 135 array_buffer_transfer_map_(isolate->heap(), &zone_) {} |
136 | 136 |
137 ValueSerializer::~ValueSerializer() {} | 137 ValueSerializer::~ValueSerializer() {} |
138 | 138 |
139 void ValueSerializer::WriteHeader() { | 139 void ValueSerializer::WriteHeader() { |
140 WriteTag(SerializationTag::kVersion); | 140 WriteTag(SerializationTag::kVersion); |
141 WriteVarint(kLatestVersion); | 141 WriteVarint(kLatestVersion); |
142 } | 142 } |
143 | 143 |
(...skipping 1590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1734 if (stack.size() != 1) { | 1734 if (stack.size() != 1) { |
1735 isolate_->Throw(*isolate_->factory()->NewError( | 1735 isolate_->Throw(*isolate_->factory()->NewError( |
1736 MessageTemplate::kDataCloneDeserializationError)); | 1736 MessageTemplate::kDataCloneDeserializationError)); |
1737 return MaybeHandle<Object>(); | 1737 return MaybeHandle<Object>(); |
1738 } | 1738 } |
1739 return scope.CloseAndEscape(stack[0]); | 1739 return scope.CloseAndEscape(stack[0]); |
1740 } | 1740 } |
1741 | 1741 |
1742 } // namespace internal | 1742 } // namespace internal |
1743 } // namespace v8 | 1743 } // namespace v8 |
OLD | NEW |