v8 12.4.254 (node 22.4.1)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
ScriptCompiler::ConsumeCodeCacheTask Class Referencefinal

#include <v8-script.h>

Public Member Functions

 ~ConsumeCodeCacheTask ()
 
void Run ()
 
void SourceTextAvailable (Isolate *isolate, Local< String > source_text, const ScriptOrigin &origin)
 
bool ShouldMergeWithExistingScript () const
 
void MergeWithExistingScript ()
 

Friends

class ScriptCompiler
 

Detailed Description

A task which the embedder must run on a background thread to consume a V8 code cache. Returned by ScriptCompiler::StartConsumingCodeCache.

Definition at line 596 of file v8-script.h.

Constructor & Destructor Documentation

◆ ~ConsumeCodeCacheTask()

Member Function Documentation

◆ MergeWithExistingScript()

void MergeWithExistingScript ( )

Merges newly deserialized data into an existing script which was found during SourceTextAvailable. May be called only after Run() has completed. Can execute on any thread, like Run().

◆ Run()

void Run ( )

◆ ShouldMergeWithExistingScript()

bool ShouldMergeWithExistingScript ( ) const

Returns whether the embedder should call MergeWithExistingScript. This function may be called from any thread, any number of times, but its return value is only meaningful after SourceTextAvailable has completed.

◆ SourceTextAvailable()

void SourceTextAvailable ( Isolate isolate,
Local< String source_text,
const ScriptOrigin origin 
)

Provides the source text string and origin information to the consumption task. May be called before, during, or after Run(). This step checks whether the script matches an existing script in the Isolate's compilation cache. To check whether such a script was found, call ShouldMergeWithExistingScript.

The Isolate provided must be the same one used during StartConsumingCodeCache and must be currently entered on the thread that calls this function. The source text and origin provided in this step must precisely match those used later in the ScriptCompiler::Source that will contain this ConsumeCodeCacheTask.

Friends And Related Symbol Documentation

◆ ScriptCompiler

friend class ScriptCompiler
friend

Definition at line 633 of file v8-script.h.


The documentation for this class was generated from the following file: