| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 kFloat64Array = 'F', | 147 kFloat64Array = 'F', |
| 148 kDataView = '?', | 148 kDataView = '?', |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 enum class WasmEncodingTag : uint8_t { | 151 enum class WasmEncodingTag : uint8_t { |
| 152 kRawBytes = 'y', | 152 kRawBytes = 'y', |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 } // namespace | 155 } // namespace |
| 156 | 156 |
| 157 // static |
| 158 uint32_t ValueSerializer::GetCurrentDataFormatVersion() { |
| 159 return kLatestVersion; |
| 160 } |
| 161 |
| 157 ValueSerializer::ValueSerializer(Isolate* isolate, | 162 ValueSerializer::ValueSerializer(Isolate* isolate, |
| 158 v8::ValueSerializer::Delegate* delegate) | 163 v8::ValueSerializer::Delegate* delegate) |
| 159 : isolate_(isolate), | 164 : isolate_(isolate), |
| 160 delegate_(delegate), | 165 delegate_(delegate), |
| 161 zone_(isolate->allocator(), ZONE_NAME), | 166 zone_(isolate->allocator(), ZONE_NAME), |
| 162 id_map_(isolate->heap(), ZoneAllocationPolicy(&zone_)), | 167 id_map_(isolate->heap(), ZoneAllocationPolicy(&zone_)), |
| 163 array_buffer_transfer_map_(isolate->heap(), | 168 array_buffer_transfer_map_(isolate->heap(), |
| 164 ZoneAllocationPolicy(&zone_)) {} | 169 ZoneAllocationPolicy(&zone_)) {} |
| 165 | 170 |
| 166 ValueSerializer::~ValueSerializer() { | 171 ValueSerializer::~ValueSerializer() { |
| (...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2009 if (stack.size() != 1) { | 2014 if (stack.size() != 1) { |
| 2010 isolate_->Throw(*isolate_->factory()->NewError( | 2015 isolate_->Throw(*isolate_->factory()->NewError( |
| 2011 MessageTemplate::kDataCloneDeserializationError)); | 2016 MessageTemplate::kDataCloneDeserializationError)); |
| 2012 return MaybeHandle<Object>(); | 2017 return MaybeHandle<Object>(); |
| 2013 } | 2018 } |
| 2014 return scope.CloseAndEscape(stack[0]); | 2019 return scope.CloseAndEscape(stack[0]); |
| 2015 } | 2020 } |
| 2016 | 2021 |
| 2017 } // namespace internal | 2022 } // namespace internal |
| 2018 } // namespace v8 | 2023 } // namespace v8 |
| OLD | NEW |