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 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 | 999 |
1000 void ValueDeserializer::TransferArrayBuffer( | 1000 void ValueDeserializer::TransferArrayBuffer( |
1001 uint32_t transfer_id, Handle<JSArrayBuffer> array_buffer) { | 1001 uint32_t transfer_id, Handle<JSArrayBuffer> array_buffer) { |
1002 if (array_buffer_transfer_map_.is_null()) { | 1002 if (array_buffer_transfer_map_.is_null()) { |
1003 array_buffer_transfer_map_ = | 1003 array_buffer_transfer_map_ = |
1004 Handle<SeededNumberDictionary>::cast(isolate_->global_handles()->Create( | 1004 Handle<SeededNumberDictionary>::cast(isolate_->global_handles()->Create( |
1005 *SeededNumberDictionary::New(isolate_, 0))); | 1005 *SeededNumberDictionary::New(isolate_, 0))); |
1006 } | 1006 } |
1007 Handle<SeededNumberDictionary> dictionary = | 1007 Handle<SeededNumberDictionary> dictionary = |
1008 array_buffer_transfer_map_.ToHandleChecked(); | 1008 array_buffer_transfer_map_.ToHandleChecked(); |
1009 const bool used_as_prototype = false; | 1009 Handle<JSObject> not_a_prototype_holder; |
1010 Handle<SeededNumberDictionary> new_dictionary = | 1010 Handle<SeededNumberDictionary> new_dictionary = |
1011 SeededNumberDictionary::AtNumberPut(dictionary, transfer_id, array_buffer, | 1011 SeededNumberDictionary::AtNumberPut(dictionary, transfer_id, array_buffer, |
1012 used_as_prototype); | 1012 not_a_prototype_holder); |
1013 if (!new_dictionary.is_identical_to(dictionary)) { | 1013 if (!new_dictionary.is_identical_to(dictionary)) { |
1014 GlobalHandles::Destroy(Handle<Object>::cast(dictionary).location()); | 1014 GlobalHandles::Destroy(Handle<Object>::cast(dictionary).location()); |
1015 array_buffer_transfer_map_ = Handle<SeededNumberDictionary>::cast( | 1015 array_buffer_transfer_map_ = Handle<SeededNumberDictionary>::cast( |
1016 isolate_->global_handles()->Create(*new_dictionary)); | 1016 isolate_->global_handles()->Create(*new_dictionary)); |
1017 } | 1017 } |
1018 } | 1018 } |
1019 | 1019 |
1020 MaybeHandle<Object> ValueDeserializer::ReadObject() { | 1020 MaybeHandle<Object> ValueDeserializer::ReadObject() { |
1021 MaybeHandle<Object> result = ReadObjectInternal(); | 1021 MaybeHandle<Object> result = ReadObjectInternal(); |
1022 | 1022 |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1860 if (stack.size() != 1) { | 1860 if (stack.size() != 1) { |
1861 isolate_->Throw(*isolate_->factory()->NewError( | 1861 isolate_->Throw(*isolate_->factory()->NewError( |
1862 MessageTemplate::kDataCloneDeserializationError)); | 1862 MessageTemplate::kDataCloneDeserializationError)); |
1863 return MaybeHandle<Object>(); | 1863 return MaybeHandle<Object>(); |
1864 } | 1864 } |
1865 return scope.CloseAndEscape(stack[0]); | 1865 return scope.CloseAndEscape(stack[0]); |
1866 } | 1866 } |
1867 | 1867 |
1868 } // namespace internal | 1868 } // namespace internal |
1869 } // namespace v8 | 1869 } // namespace v8 |
OLD | NEW |