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

#include <source-text-module.h>

Inheritance diagram for v8::internal::SourceTextModule:
Collaboration diagram for v8::internal::SourceTextModule:

Classes

struct  AsyncEvaluationOrdinalCompare
 

Public Types

enum  ExecuteAsyncModuleContextSlots { kModule = Context::MIN_CONTEXT_SLOTS , kContextLength }
 
using BodyDescriptor
 

Public Member Functions

NEVER_READ_ONLY_SPACE Tagged< SharedFunctionInfoGetSharedFunctionInfo () const
 
Tagged< ScriptGetScript () const
 
Tagged< SourceTextModuleInfoinfo () const
 
Tagged< CellGetCell (int cell_index)
 
V8_EXPORT_PRIVATE std::pair< DirectHandleVector< SourceTextModule >, DirectHandleVector< JSMessageObject > > GetStalledTopLevelAwaitMessages (Isolate *isolate)
 

Static Public Member Functions

static Handle< ObjectLoadVariable (Isolate *isolate, DirectHandle< SourceTextModule > module, int cell_index)
 
static void StoreVariable (DirectHandle< SourceTextModule > module, int cell_index, DirectHandle< Object > value)
 
static int ImportIndex (int cell_index)
 
static int ExportIndex (int cell_index)
 
static Maybe< boolAsyncModuleExecutionFulfilled (Isolate *isolate, Handle< SourceTextModule > module)
 
static void AsyncModuleExecutionRejected (Isolate *isolate, DirectHandle< SourceTextModule > module, DirectHandle< Object > exception)
 
static DirectHandle< JSModuleNamespaceGetModuleNamespace (Isolate *isolate, DirectHandle< SourceTextModule > module, int module_request)
 
static V8_EXPORT_PRIVATE MaybeHandle< JSObjectGetImportMeta (Isolate *isolate, DirectHandle< SourceTextModule > module)
 

Static Public Attributes

static constexpr unsigned kFirstAsyncEvaluationOrdinal = 2
 

Private Types

using AvailableAncestorsSet
 

Private Member Functions

Handle< SourceTextModuleGetCycleRoot (Isolate *isolate) const
 
Handle< SourceTextModuleGetAsyncParentModule (Isolate *isolate, int index)
 
int AsyncParentModuleCount ()
 
bool HasAsyncEvaluationOrdinal () const
 
bool HasPendingAsyncDependencies ()
 
void IncrementPendingAsyncDependencies ()
 
void DecrementPendingAsyncDependencies ()
 
bool MaybeHandleEvaluationException (Isolate *isolate, ZoneForwardList< Handle< SourceTextModule > > *stack)
 
V8_EXPORT_PRIVATE void InnerGetStalledTopLevelAwaitModule (Isolate *isolate, UnorderedModuleSet *visited, DirectHandleVector< SourceTextModule > *result)
 

Static Private Member Functions

static void AddAsyncParentModule (Isolate *isolate, DirectHandle< SourceTextModule > module, DirectHandle< SourceTextModule > parent)
 
static void CreateExport (Isolate *isolate, DirectHandle< SourceTextModule > module, int cell_index, DirectHandle< FixedArray > names)
 
static void CreateIndirectExport (Isolate *isolate, DirectHandle< SourceTextModule > module, DirectHandle< String > name, DirectHandle< SourceTextModuleInfoEntry > entry)
 
static V8_WARN_UNUSED_RESULT MaybeHandle< CellResolveExport (Isolate *isolate, Handle< SourceTextModule > module, DirectHandle< String > module_specifier, Handle< String > export_name, MessageLocation loc, bool must_resolve, ResolveSet *resolve_set)
 
static V8_WARN_UNUSED_RESULT MaybeHandle< CellResolveImport (Isolate *isolate, DirectHandle< SourceTextModule > module, Handle< String > name, int module_request_index, MessageLocation loc, bool must_resolve, ResolveSet *resolve_set)
 
static V8_WARN_UNUSED_RESULT MaybeHandle< CellResolveExportUsingStarExports (Isolate *isolate, DirectHandle< SourceTextModule > module, DirectHandle< String > module_specifier, Handle< String > export_name, MessageLocation loc, bool must_resolve, ResolveSet *resolve_set)
 
static V8_WARN_UNUSED_RESULT bool PrepareInstantiate (Isolate *isolate, DirectHandle< SourceTextModule > module, v8::Local< v8::Context > context, v8::Module::ResolveModuleCallback module_callback, v8::Module::ResolveSourceCallback source_callback)
 
static V8_WARN_UNUSED_RESULT bool FinishInstantiate (Isolate *isolate, Handle< SourceTextModule > module, ZoneForwardList< Handle< SourceTextModule > > *stack, unsigned *dfs_index, Zone *zone)
 
static V8_WARN_UNUSED_RESULT bool RunInitializationCode (Isolate *isolate, DirectHandle< SourceTextModule > module)
 
static void FetchStarExports (Isolate *isolate, Handle< SourceTextModule > module, Zone *zone, UnorderedModuleSet *visited)
 
static void GatherAvailableAncestors (Isolate *isolate, Zone *zone, Handle< SourceTextModule > start, AvailableAncestorsSet *exec_list)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< ObjectEvaluate (Isolate *isolate, Handle< SourceTextModule > module)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< ObjectInnerModuleEvaluation (Isolate *isolate, Handle< SourceTextModule > module, ZoneForwardList< Handle< SourceTextModule > > *stack, unsigned *dfs_index)
 
static V8_WARN_UNUSED_RESULT bool MaybeTransitionComponent (Isolate *isolate, DirectHandle< SourceTextModule > module, ZoneForwardList< Handle< SourceTextModule > > *stack, Status new_status)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< ObjectInnerExecuteAsyncModule (Isolate *isolate, DirectHandle< SourceTextModule > module, DirectHandle< JSPromise > capability)
 
static V8_WARN_UNUSED_RESULT MaybeDirectHandle< ObjectExecuteModule (Isolate *isolate, DirectHandle< SourceTextModule > module, MaybeDirectHandle< Object > *exception_out)
 
static V8_WARN_UNUSED_RESULT Maybe< boolExecuteAsyncModule (Isolate *isolate, DirectHandle< SourceTextModule > module)
 
static void Reset (Isolate *isolate, DirectHandle< SourceTextModule > module)
 

Static Private Attributes

static constexpr unsigned kNotAsyncEvaluated = 0
 
static constexpr unsigned kAsyncEvaluateDidFinish = 1
 

Friends

class Factory
 
class Module
 

Detailed Description

Definition at line 28 of file source-text-module.h.

Member Typedef Documentation

◆ AvailableAncestorsSet

Initial value:
ZoneSet<Handle<SourceTextModule>, AsyncEvaluationOrdinalCompare>

Definition at line 99 of file source-text-module.h.

◆ BodyDescriptor

Initial value:
SubclassBodyDescriptor<Module::BodyDescriptor,
FixedBodyDescriptor<kCodeOffset, kSize, kSize>>
FixedBodyDescriptor< kExportsOffset, kHeaderSize, kHeaderSize > BodyDescriptor
Definition module.h:79

Definition at line 78 of file source-text-module.h.

Member Enumeration Documentation

◆ ExecuteAsyncModuleContextSlots

Enumerator
kModule 
kContextLength 

Definition at line 84 of file source-text-module.h.

Member Function Documentation

◆ AddAsyncParentModule()

void v8::internal::SourceTextModule::AddAsyncParentModule ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
DirectHandle< SourceTextModule > parent )
inlinestaticprivate

Definition at line 126 of file module-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AsyncModuleExecutionFulfilled()

Maybe< bool > v8::internal::SourceTextModule::AsyncModuleExecutionFulfilled ( Isolate * isolate,
Handle< SourceTextModule > module )
static

Definition at line 886 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AsyncModuleExecutionRejected()

void v8::internal::SourceTextModule::AsyncModuleExecutionRejected ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
DirectHandle< Object > exception )
static

Definition at line 997 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AsyncParentModuleCount()

int v8::internal::SourceTextModule::AsyncParentModuleCount ( )
inlineprivate

Definition at line 143 of file module-inl.h.

◆ CreateExport()

void v8::internal::SourceTextModule::CreateExport ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
int cell_index,
DirectHandle< FixedArray > names )
staticprivate

Definition at line 135 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateIndirectExport()

void v8::internal::SourceTextModule::CreateIndirectExport ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
DirectHandle< String > name,
DirectHandle< SourceTextModuleInfoEntry > entry )
staticprivate

Definition at line 126 of file source-text-module.cc.

Here is the caller graph for this function:

◆ DecrementPendingAsyncDependencies()

void v8::internal::SourceTextModule::DecrementPendingAsyncDependencies ( )
inlineprivate

Definition at line 160 of file module-inl.h.

◆ Evaluate()

MaybeDirectHandle< Object > v8::internal::SourceTextModule::Evaluate ( Isolate * isolate,
Handle< SourceTextModule > module )
staticprivate

Definition at line 833 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExecuteAsyncModule()

Maybe< bool > v8::internal::SourceTextModule::ExecuteAsyncModule ( Isolate * isolate,
DirectHandle< SourceTextModule > module )
staticprivate

Definition at line 1046 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExecuteModule()

MaybeDirectHandle< Object > v8::internal::SourceTextModule::ExecuteModule ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
MaybeDirectHandle< Object > * exception_out )
staticprivate

Definition at line 1137 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExportIndex()

int v8::internal::SourceTextModule::ExportIndex ( int cell_index)
static

Definition at line 114 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FetchStarExports()

void v8::internal::SourceTextModule::FetchStarExports ( Isolate * isolate,
Handle< SourceTextModule > module,
Zone * zone,
UnorderedModuleSet * visited )
staticprivate

Definition at line 646 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FinishInstantiate()

bool v8::internal::SourceTextModule::FinishInstantiate ( Isolate * isolate,
Handle< SourceTextModule > module,
ZoneForwardList< Handle< SourceTextModule > > * stack,
unsigned * dfs_index,
Zone * zone )
staticprivate

Definition at line 551 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GatherAvailableAncestors()

void v8::internal::SourceTextModule::GatherAvailableAncestors ( Isolate * isolate,
Zone * zone,
Handle< SourceTextModule > start,
AvailableAncestorsSet * exec_list )
staticprivate

Definition at line 726 of file source-text-module.cc.

Here is the caller graph for this function:

◆ GetAsyncParentModule()

Handle< SourceTextModule > v8::internal::SourceTextModule::GetAsyncParentModule ( Isolate * isolate,
int index )
inlineprivate

Definition at line 136 of file module-inl.h.

Here is the call graph for this function:

◆ GetCell()

Tagged< Cell > v8::internal::SourceTextModule::GetCell ( int cell_index)

Definition at line 152 of file source-text-module.cc.

Here is the call graph for this function:

◆ GetCycleRoot()

Handle< SourceTextModule > v8::internal::SourceTextModule::GetCycleRoot ( Isolate * isolate) const
inlineprivate

Definition at line 118 of file module-inl.h.

Here is the call graph for this function:

◆ GetImportMeta()

MaybeHandle< JSObject > v8::internal::SourceTextModule::GetImportMeta ( Isolate * isolate,
DirectHandle< SourceTextModule > module )
static

Definition at line 788 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetModuleNamespace()

DirectHandle< JSModuleNamespace > v8::internal::SourceTextModule::GetModuleNamespace ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
int module_request )
static

Definition at line 776 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetScript()

Tagged< Script > v8::internal::SourceTextModule::GetScript ( ) const

Definition at line 109 of file source-text-module.cc.

Here is the call graph for this function:

◆ GetSharedFunctionInfo()

Tagged< SharedFunctionInfo > v8::internal::SourceTextModule::GetSharedFunctionInfo ( ) const

Definition at line 90 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetStalledTopLevelAwaitMessages()

std::pair< DirectHandleVector< SourceTextModule >, DirectHandleVector< JSMessageObject > > v8::internal::SourceTextModule::GetStalledTopLevelAwaitMessages ( Isolate * isolate)

Definition at line 1367 of file source-text-module.cc.

Here is the call graph for this function:

◆ HasAsyncEvaluationOrdinal()

bool v8::internal::SourceTextModule::HasAsyncEvaluationOrdinal ( ) const
inlineprivate

Definition at line 147 of file module-inl.h.

Here is the caller graph for this function:

◆ HasPendingAsyncDependencies()

bool v8::internal::SourceTextModule::HasPendingAsyncDependencies ( )
inlineprivate

Definition at line 151 of file module-inl.h.

Here is the caller graph for this function:

◆ ImportIndex()

int v8::internal::SourceTextModule::ImportIndex ( int cell_index)
static

Definition at line 120 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IncrementPendingAsyncDependencies()

void v8::internal::SourceTextModule::IncrementPendingAsyncDependencies ( )
inlineprivate

Definition at line 156 of file module-inl.h.

◆ info()

Tagged< SourceTextModuleInfo > v8::internal::SourceTextModule::info ( ) const
inline

Definition at line 60 of file module-inl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InnerExecuteAsyncModule()

MaybeDirectHandle< Object > v8::internal::SourceTextModule::InnerExecuteAsyncModule ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
DirectHandle< JSPromise > capability )
staticprivate

Definition at line 1122 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InnerGetStalledTopLevelAwaitModule()

void v8::internal::SourceTextModule::InnerGetStalledTopLevelAwaitModule ( Isolate * isolate,
UnorderedModuleSet * visited,
DirectHandleVector< SourceTextModule > * result )
private

Definition at line 1393 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InnerModuleEvaluation()

MaybeDirectHandle< Object > v8::internal::SourceTextModule::InnerModuleEvaluation ( Isolate * isolate,
Handle< SourceTextModule > module,
ZoneForwardList< Handle< SourceTextModule > > * stack,
unsigned * dfs_index )
staticprivate

Definition at line 1158 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadVariable()

Handle< Object > v8::internal::SourceTextModule::LoadVariable ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
int cell_index )
static

Definition at line 168 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MaybeHandleEvaluationException()

bool v8::internal::SourceTextModule::MaybeHandleEvaluationException ( Isolate * isolate,
ZoneForwardList< Handle< SourceTextModule > > * stack )
private

Definition at line 803 of file source-text-module.cc.

◆ MaybeTransitionComponent()

bool v8::internal::SourceTextModule::MaybeTransitionComponent ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
ZoneForwardList< Handle< SourceTextModule > > * stack,
Status new_status )
staticprivate

Definition at line 465 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrepareInstantiate()

bool v8::internal::SourceTextModule::PrepareInstantiate ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
v8::Local< v8::Context > context,
v8::Module::ResolveModuleCallback module_callback,
v8::Module::ResolveSourceCallback source_callback )
staticprivate

Definition at line 346 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Reset()

void v8::internal::SourceTextModule::Reset ( Isolate * isolate,
DirectHandle< SourceTextModule > module )
staticprivate

Definition at line 1340 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResolveExport()

MaybeHandle< Cell > v8::internal::SourceTextModule::ResolveExport ( Isolate * isolate,
Handle< SourceTextModule > module,
DirectHandle< String > module_specifier,
Handle< String > export_name,
MessageLocation loc,
bool must_resolve,
ResolveSet * resolve_set )
staticprivate

Definition at line 182 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResolveExportUsingStarExports()

MaybeHandle< Cell > v8::internal::SourceTextModule::ResolveExportUsingStarExports ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
DirectHandle< String > module_specifier,
Handle< String > export_name,
MessageLocation loc,
bool must_resolve,
ResolveSet * resolve_set )
staticprivate

Definition at line 287 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResolveImport()

MaybeHandle< Cell > v8::internal::SourceTextModule::ResolveImport ( Isolate * isolate,
DirectHandle< SourceTextModule > module,
Handle< String > name,
int module_request_index,
MessageLocation loc,
bool must_resolve,
ResolveSet * resolve_set )
staticprivate

Definition at line 246 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunInitializationCode()

bool v8::internal::SourceTextModule::RunInitializationCode ( Isolate * isolate,
DirectHandle< SourceTextModule > module )
staticprivate

Definition at line 440 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreVariable()

void v8::internal::SourceTextModule::StoreVariable ( DirectHandle< SourceTextModule > module,
int cell_index,
DirectHandle< Object > value )
static

Definition at line 173 of file source-text-module.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ Factory

friend class Factory
friend

Definition at line 95 of file source-text-module.h.

◆ Module

friend class Module
friend

Definition at line 96 of file source-text-module.h.

Member Data Documentation

◆ kAsyncEvaluateDidFinish

unsigned v8::internal::SourceTextModule::kAsyncEvaluateDidFinish = 1
staticconstexprprivate

Definition at line 142 of file source-text-module.h.

◆ kFirstAsyncEvaluationOrdinal

unsigned v8::internal::SourceTextModule::kFirstAsyncEvaluationOrdinal = 2
staticconstexpr

Definition at line 82 of file source-text-module.h.

◆ kNotAsyncEvaluated

unsigned v8::internal::SourceTextModule::kNotAsyncEvaluated = 0
staticconstexprprivate

Definition at line 141 of file source-text-module.h.


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