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 7221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7232 return Compile(isolate, uncompiled_bytes.first.get(), | 7232 return Compile(isolate, uncompiled_bytes.first.get(), |
7233 uncompiled_bytes.second); | 7233 uncompiled_bytes.second); |
7234 } | 7234 } |
7235 | 7235 |
7236 MaybeLocal<WasmCompiledModule> WasmCompiledModule::Compile(Isolate* isolate, | 7236 MaybeLocal<WasmCompiledModule> WasmCompiledModule::Compile(Isolate* isolate, |
7237 const uint8_t* start, | 7237 const uint8_t* start, |
7238 size_t length) { | 7238 size_t length) { |
7239 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); | 7239 i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
7240 i::wasm::ErrorThrower thrower(i_isolate, "WasmCompiledModule::Deserialize()"); | 7240 i::wasm::ErrorThrower thrower(i_isolate, "WasmCompiledModule::Deserialize()"); |
7241 i::MaybeHandle<i::JSObject> maybe_compiled = | 7241 i::MaybeHandle<i::JSObject> maybe_compiled = |
7242 i::wasm::CreateModuleObjectFromBytes(i_isolate, start, start + length, | 7242 i::wasm::CreateModuleObjectFromBytes( |
7243 &thrower, | 7243 i_isolate, start, start + length, &thrower, |
7244 i::wasm::ModuleOrigin::kWasmOrigin); | 7244 i::wasm::ModuleOrigin::kWasmOrigin, i::Handle<i::Script>::null(), |
| 7245 nullptr, nullptr); |
7245 if (maybe_compiled.is_null()) return MaybeLocal<WasmCompiledModule>(); | 7246 if (maybe_compiled.is_null()) return MaybeLocal<WasmCompiledModule>(); |
7246 return Local<WasmCompiledModule>::Cast( | 7247 return Local<WasmCompiledModule>::Cast( |
7247 Utils::ToLocal(maybe_compiled.ToHandleChecked())); | 7248 Utils::ToLocal(maybe_compiled.ToHandleChecked())); |
7248 } | 7249 } |
7249 | 7250 |
7250 // static | 7251 // static |
7251 v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() { | 7252 v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() { |
7252 return new ArrayBufferAllocator(); | 7253 return new ArrayBufferAllocator(); |
7253 } | 7254 } |
7254 | 7255 |
(...skipping 2154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9409 Address callback_address = | 9410 Address callback_address = |
9410 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); | 9411 reinterpret_cast<Address>(reinterpret_cast<intptr_t>(callback)); |
9411 VMState<EXTERNAL> state(isolate); | 9412 VMState<EXTERNAL> state(isolate); |
9412 ExternalCallbackScope call_scope(isolate, callback_address); | 9413 ExternalCallbackScope call_scope(isolate, callback_address); |
9413 callback(info); | 9414 callback(info); |
9414 } | 9415 } |
9415 | 9416 |
9416 | 9417 |
9417 } // namespace internal | 9418 } // namespace internal |
9418 } // namespace v8 | 9419 } // namespace v8 |
OLD | NEW |