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 6924 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6935 const WasmCompiledModule::SerializedModule& serialized_data) { | 6935 const WasmCompiledModule::SerializedModule& serialized_data) { |
6936 int size = static_cast<int>(serialized_data.second); | 6936 int size = static_cast<int>(serialized_data.second); |
6937 i::ScriptData sc(serialized_data.first.get(), size); | 6937 i::ScriptData sc(serialized_data.first.get(), size); |
6938 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 6938 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
6939 i::MaybeHandle<i::FixedArray> maybe_compiled_part = | 6939 i::MaybeHandle<i::FixedArray> maybe_compiled_part = |
6940 i::WasmCompiledModuleSerializer::DeserializeWasmModule(i_isolate, &sc); | 6940 i::WasmCompiledModuleSerializer::DeserializeWasmModule(i_isolate, &sc); |
6941 i::Handle<i::FixedArray> compiled_part; | 6941 i::Handle<i::FixedArray> compiled_part; |
6942 if (!maybe_compiled_part.ToHandle(&compiled_part)) { | 6942 if (!maybe_compiled_part.ToHandle(&compiled_part)) { |
6943 return MaybeLocal<WasmCompiledModule>(); | 6943 return MaybeLocal<WasmCompiledModule>(); |
6944 } | 6944 } |
6945 return Local<WasmCompiledModule>::Cast(Utils::ToLocal( | 6945 return Local<WasmCompiledModule>::Cast( |
6946 i::wasm::CreateCompiledModuleObject(i_isolate, compiled_part))); | 6946 Utils::ToLocal(i::wasm::CreateCompiledModuleObject( |
| 6947 i_isolate, compiled_part, i::wasm::ModuleOrigin::kWasmOrigin))); |
6947 } | 6948 } |
6948 | 6949 |
6949 // static | 6950 // static |
6950 v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() { | 6951 v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() { |
6951 return new ArrayBufferAllocator(); | 6952 return new ArrayBufferAllocator(); |
6952 } | 6953 } |
6953 | 6954 |
6954 bool v8::ArrayBuffer::IsExternal() const { | 6955 bool v8::ArrayBuffer::IsExternal() const { |
6955 return Utils::OpenHandle(this)->is_external(); | 6956 return Utils::OpenHandle(this)->is_external(); |
6956 } | 6957 } |
(...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9107 Address callback_address = | 9108 Address callback_address = |
9108 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9109 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9109 VMState<EXTERNAL> state(isolate); | 9110 VMState<EXTERNAL> state(isolate); |
9110 ExternalCallbackScope call_scope(isolate, callback_address); | 9111 ExternalCallbackScope call_scope(isolate, callback_address); |
9111 callback(info); | 9112 callback(info); |
9112 } | 9113 } |
9113 | 9114 |
9114 | 9115 |
9115 } // namespace internal | 9116 } // namespace internal |
9116 } // namespace v8 | 9117 } // namespace v8 |
OLD | NEW |