// Copyright 2022 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef V8_CODEGEN_BACKGROUND_MERGE_TASK_H_ #define V8_CODEGEN_BACKGROUND_MERGE_TASK_H_ #include #include "src/handles/maybe-handles.h" namespace v8 { namespace internal { class FeedbackMetadata; class PersistentHandles; class Script; class SharedFunctionInfo; class String; struct ScriptDetails; // Contains data transferred between threads for background merging between a // newly compiled or deserialized script and an existing script from the Isolate // compilation cache. class V8_EXPORT_PRIVATE BackgroundMergeTask { public: // Step 1: on the main thread, check whether the Isolate compilation cache // contains the script. void SetUpOnMainThread(Isolate* isolate, Handle source_text, const ScriptDetails& script_details, LanguageMode language_mode); // Alternative step 1: on the main thread, if the caller has already looked up // the script in the Isolate compilation cache, set up the necessary // persistent data for the background merge. void SetUpOnMainThread(Isolate* isolate, Handle