diff options
Diffstat (limited to 'deps/v8/src/wasm/module-compiler.h')
-rw-r--r-- | deps/v8/src/wasm/module-compiler.h | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/deps/v8/src/wasm/module-compiler.h b/deps/v8/src/wasm/module-compiler.h index 0e1c33b257..e984ad436c 100644 --- a/deps/v8/src/wasm/module-compiler.h +++ b/deps/v8/src/wasm/module-compiler.h @@ -56,14 +56,11 @@ struct WasmModule; V8_EXPORT_PRIVATE std::shared_ptr<NativeModule> CompileToNativeModule( - Isolate* isolate, const WasmFeatures& enabled, ErrorThrower* thrower, - std::shared_ptr<const WasmModule> module, const ModuleWireBytes& wire_bytes, + Isolate* isolate, WasmFeatures enabled_features, ErrorThrower* thrower, + std::shared_ptr<const WasmModule> module, ModuleWireBytes wire_bytes, int compilation_id, v8::metrics::Recorder::ContextId context_id, ProfileInformation* pgo_info); -void RecompileNativeModule(NativeModule* native_module, - TieringState new_tiering_state); - V8_EXPORT_PRIVATE void CompileJsToWasmWrappers(Isolate* isolate, const WasmModule* module); @@ -72,10 +69,9 @@ void CompileJsToWasmWrappers(Isolate* isolate, const WasmModule* module); // compiled yet. V8_EXPORT_PRIVATE WasmCode* CompileImportWrapper( - NativeModule* native_module, Counters* counters, - compiler::WasmImportCallKind kind, const FunctionSig* sig, - uint32_t canonical_type_index, int expected_arity, Suspend suspend, - WasmImportWrapperCache::ModificationScope* cache_scope); + NativeModule* native_module, Counters* counters, ImportCallKind kind, + const FunctionSig* sig, uint32_t canonical_type_index, int expected_arity, + Suspend suspend, WasmImportWrapperCache::ModificationScope* cache_scope); // Triggered by the WasmCompileLazy builtin. The return value indicates whether // compilation was successful. Lazy compilation can fail only if validation is @@ -138,8 +134,8 @@ class WrapperQueue { // TODO(wasm): factor out common parts of this with the synchronous pipeline. class AsyncCompileJob { public: - AsyncCompileJob(Isolate* isolate, const WasmFeatures& enabled_features, - std::unique_ptr<byte[]> bytes_copy, size_t length, + AsyncCompileJob(Isolate* isolate, WasmFeatures enabled_features, + base::OwnedVector<const uint8_t> bytes, Handle<Context> context, Handle<Context> incumbent_context, const char* api_method_name, std::shared_ptr<CompilationResultResolver> resolver, @@ -164,11 +160,25 @@ class AsyncCompileJob { class CompilationStateCallback; // States of the AsyncCompileJob. - class DecodeModule; // Step 1 (async) - class DecodeFail; // Step 1b (sync) - class PrepareAndStartCompile; // Step 2 (sync) - class CompileFailed; // Step 3a (sync) - class CompileFinished; // Step 3b (sync) + // Step 1 (async). Decodes the wasm module. + // --> Fail on decoding failure, + // --> PrepareAndStartCompile on success. + class DecodeModule; + + // Step 2 (sync). Prepares runtime objects and starts background compilation. + // --> finish directly on native module cache hit, + // --> finish directly on validation error, + // --> trigger eager compilation, if any; FinishCompile is triggered when + // done. + class PrepareAndStartCompile; + + // Step 3 (sync). Compilation finished. Finalize the module and resolve the + // promise. + class FinishCompilation; + + // Step 4 (sync). Decoding, validation or compilation failed. Reject the + // promise. + class Fail; friend class AsyncStreamingProcessor; @@ -217,12 +227,11 @@ class AsyncCompileJob { void FinishCompile(bool is_after_cache_hit); - void DecodeFailed(const WasmError&); - void AsyncCompileFailed(); + void Failed(); void AsyncCompileSucceeded(Handle<WasmModuleObject> result); - void FinishModule(); + void FinishSuccessfully(); void StartForegroundTask(); void ExecuteForegroundTaskImmediately(); @@ -263,7 +272,7 @@ class AsyncCompileJob { base::TimeTicks start_time_; // Copy of the module wire bytes, moved into the {native_module_} on its // creation. - std::unique_ptr<byte[]> bytes_copy_; + base::OwnedVector<const uint8_t> bytes_copy_; // Reference to the wire bytes (held in {bytes_copy_} or as part of // {native_module_}). ModuleWireBytes wire_bytes_; |