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 7230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7241 return Compile(isolate, uncompiled_bytes.first.get(), | 7241 return Compile(isolate, uncompiled_bytes.first.get(), |
7242 uncompiled_bytes.second); | 7242 uncompiled_bytes.second); |
7243 } | 7243 } |
7244 | 7244 |
7245 MaybeLocal<WasmCompiledModule> WasmCompiledModule::Compile(Isolate* isolate, | 7245 MaybeLocal<WasmCompiledModule> WasmCompiledModule::Compile(Isolate* isolate, |
7246 const uint8_t* start, | 7246 const uint8_t* start, |
7247 size_t length) { | 7247 size_t length) { |
7248 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 7248 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
7249 i::wasm::ErrorThrower thrower(i_isolate, "WasmCompiledModule::Deserialize()"); | 7249 i::wasm::ErrorThrower thrower(i_isolate, "WasmCompiledModule::Deserialize()"); |
7250 i::MaybeHandle<i::JSObject> maybe_compiled = | 7250 i::MaybeHandle<i::JSObject> maybe_compiled = |
7251 i::wasm::CreateModuleObjectFromBytes(i_isolate, start, start + length, | 7251 i::wasm::CreateModuleObjectFromBytes( |
7252 &thrower, | 7252 i_isolate, start, start + length, &thrower, |
7253 i::wasm::ModuleOrigin::kWasmOrigin); | 7253 i::wasm::ModuleOrigin::kWasmOrigin, i::Handle<i::Script>::null(), |
| 7254 nullptr, nullptr); |
7254 if (maybe_compiled.is_null()) return MaybeLocal<WasmCompiledModule>(); | 7255 if (maybe_compiled.is_null()) return MaybeLocal<WasmCompiledModule>(); |
7255 return Local<WasmCompiledModule>::Cast( | 7256 return Local<WasmCompiledModule>::Cast( |
7256 Utils::ToLocal(maybe_compiled.ToHandleChecked())); | 7257 Utils::ToLocal(maybe_compiled.ToHandleChecked())); |
7257 } | 7258 } |
7258 | 7259 |
7259 // static | 7260 // static |
7260 v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() { | 7261 v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() { |
7261 return new ArrayBufferAllocator(); | 7262 return new ArrayBufferAllocator(); |
7262 } | 7263 } |
7263 | 7264 |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9418 Address callback_address = | 9419 Address callback_address = |
9419 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9420 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9420 VMState<EXTERNAL> state(isolate); | 9421 VMState<EXTERNAL> state(isolate); |
9421 ExternalCallbackScope call_scope(isolate, callback_address); | 9422 ExternalCallbackScope call_scope(isolate, callback_address); |
9422 callback(info); | 9423 callback(info); |
9423 } | 9424 } |
9424 | 9425 |
9425 | 9426 |
9426 } // namespace internal | 9427 } // namespace internal |
9427 } // namespace v8 | 9428 } // namespace v8 |
OLD | NEW |