v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::ScriptCompiler::ConsumeCodeCacheTask Class Referencefinal

#include <v8-script.h>

Collaboration diagram for v8::ScriptCompiler::ConsumeCodeCacheTask:

Public Member Functions

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

Private Member Functions

 ConsumeCodeCacheTask (std::unique_ptr< internal::BackgroundDeserializeTask > impl)
 

Private Attributes

std::unique_ptr< internal::BackgroundDeserializeTaskimpl_
 

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 628 of file v8-script.h.

Constructor & Destructor Documentation

◆ ~ConsumeCodeCacheTask()

v8::ScriptCompiler::ConsumeCodeCacheTask::~ConsumeCodeCacheTask ( )
default

◆ ConsumeCodeCacheTask()

v8::ScriptCompiler::ConsumeCodeCacheTask::ConsumeCodeCacheTask ( std::unique_ptr< internal::BackgroundDeserializeTask > impl)
explicitprivate

Definition at line 2558 of file api.cc.

Member Function Documentation

◆ MergeWithExistingScript()

void v8::ScriptCompiler::ConsumeCodeCacheTask::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().

Definition at line 2588 of file api.cc.

◆ Run()

void v8::ScriptCompiler::ConsumeCodeCacheTask::Run ( )

Definition at line 2564 of file api.cc.

◆ ShouldMergeWithExistingScript()

bool v8::ScriptCompiler::ConsumeCodeCacheTask::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.

Definition at line 2579 of file api.cc.

◆ SourceTextAvailable()

void v8::ScriptCompiler::ConsumeCodeCacheTask::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.

Definition at line 2566 of file api.cc.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ ScriptCompiler

friend class ScriptCompiler
friend

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

Member Data Documentation

◆ impl_

std::unique_ptr<internal::BackgroundDeserializeTask> v8::ScriptCompiler::ConsumeCodeCacheTask::impl_
private

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


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