OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/api.h" | 5 #include "src/api.h" |
6 | 6 |
7 #include <string.h> // For memcpy, strlen. | 7 #include <string.h> // For memcpy, strlen. |
8 #ifdef V8_USE_ADDRESS_SANITIZER | 8 #ifdef V8_USE_ADDRESS_SANITIZER |
9 #include <sanitizer/asan_interface.h> | 9 #include <sanitizer/asan_interface.h> |
10 #endif // V8_USE_ADDRESS_SANITIZER | 10 #endif // V8_USE_ADDRESS_SANITIZER |
(...skipping 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3026 | 3026 |
3027 Maybe<bool> ValueSerializer::Delegate::WriteHostObject(Isolate* v8_isolate, | 3027 Maybe<bool> ValueSerializer::Delegate::WriteHostObject(Isolate* v8_isolate, |
3028 Local<Object> object) { | 3028 Local<Object> object) { |
3029 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | 3029 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
3030 isolate->ScheduleThrow(*isolate->factory()->NewError( | 3030 isolate->ScheduleThrow(*isolate->factory()->NewError( |
3031 isolate->error_function(), i::MessageTemplate::kDataCloneError, | 3031 isolate->error_function(), i::MessageTemplate::kDataCloneError, |
3032 Utils::OpenHandle(*object))); | 3032 Utils::OpenHandle(*object))); |
3033 return Nothing<bool>(); | 3033 return Nothing<bool>(); |
3034 } | 3034 } |
3035 | 3035 |
3036 Maybe<uint32_t> ValueSerializer::Delegate::GetSharedArrayBufferId( | |
3037 Isolate* v8_isolate, Local<SharedArrayBuffer> shared_array_buffer) { | |
3038 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); | |
3039 isolate->ScheduleThrow(*isolate->factory()->NewError( | |
3040 isolate->error_function(), i::MessageTemplate::kDataCloneError, | |
3041 Utils::OpenHandle(*shared_array_buffer))); | |
3042 return Nothing<uint32_t>(); | |
3043 } | |
3044 | |
3045 void* ValueSerializer::Delegate::ReallocateBufferMemory(void* old_buffer, | 3036 void* ValueSerializer::Delegate::ReallocateBufferMemory(void* old_buffer, |
3046 size_t size, | 3037 size_t size, |
3047 size_t* actual_size) { | 3038 size_t* actual_size) { |
3048 *actual_size = size; | 3039 *actual_size = size; |
3049 return realloc(old_buffer, size); | 3040 return realloc(old_buffer, size); |
3050 } | 3041 } |
3051 | 3042 |
3052 void ValueSerializer::Delegate::FreeBufferMemory(void* buffer) { | 3043 void ValueSerializer::Delegate::FreeBufferMemory(void* buffer) { |
3053 return free(buffer); | 3044 return free(buffer); |
3054 } | 3045 } |
(...skipping 6841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9896 Address callback_address = | 9887 Address callback_address = |
9897 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9888 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9898 VMState<EXTERNAL> state(isolate); | 9889 VMState<EXTERNAL> state(isolate); |
9899 ExternalCallbackScope call_scope(isolate, callback_address); | 9890 ExternalCallbackScope call_scope(isolate, callback_address); |
9900 callback(info); | 9891 callback(info); |
9901 } | 9892 } |
9902 | 9893 |
9903 | 9894 |
9904 } // namespace internal | 9895 } // namespace internal |
9905 } // namespace v8 | 9896 } // namespace v8 |
OLD | NEW |