Class JSModuleRecord
java.lang.Object
com.oracle.truffle.js.runtime.objects.ScriptOrModule
com.oracle.truffle.js.runtime.objects.AbstractModuleRecord
com.oracle.truffle.js.runtime.objects.CyclicModuleRecord
com.oracle.truffle.js.runtime.objects.JSModuleRecord
Source Text Module Record.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.js.runtime.objects.CyclicModuleRecord
CyclicModuleRecord.Status -
Field Summary
Fields inherited from class com.oracle.truffle.js.runtime.objects.ScriptOrModule
context, source -
Constructor Summary
ConstructorsConstructorDescriptionJSModuleRecord(JSModuleData parsedModule, JSModuleLoader moduleLoader) JSModuleRecord(JSModuleData parsedModule, JSModuleLoader moduleLoader, Object hostDefined) -
Method Summary
Modifier and TypeMethodDescriptionexecuteModule(JSRealm realm, PromiseCapabilityRecord capability) Evaluate the module's code within its execution context.Collection<com.oracle.truffle.api.strings.TruffleString> getExportedNames(Set<JSModuleRecord> exportStarSet) com.oracle.truffle.api.frame.FrameDescriptorgetImportMeta(CreateImportMetaNode createImportMeta) A list of all the ModuleSpecifier strings and import attributes used by the module represented by this record to request the importation of a module, in occurrence order.getURL()voidinitializeEnvironment(JSRealm realm) Initialize the Environment Record of the module, including resolving all imported bindings, and create the module's execution context.loadRequestedModules(JSRealm realm, Object hostDefinedArg) Prepares the module for linking by recursively loading all its dependencies.voidrememberImportedModuleSource(com.oracle.truffle.api.strings.TruffleString moduleSpecifier, com.oracle.truffle.api.source.Source moduleSource) Keep a link from the referencing module or script to the imported module'sSource, so that the latter is kept alive for the lifetime of the former.resolveExport(com.oracle.truffle.api.strings.TruffleString exportName, Set<Pair<? extends AbstractModuleRecord, com.oracle.truffle.api.strings.TruffleString>> resolveSet) ResolveExport attempts to resolve an imported binding to the actual defining module and local binding name.toString()Methods inherited from class com.oracle.truffle.js.runtime.objects.CyclicModuleRecord
addLoadedModule, appendAsyncParentModules, decPendingAsyncDependencies, evaluate, getAsyncEvaluatingOrder, getAsyncParentModules, getCycleRoot, getDFSAncestorIndex, getDFSIndex, getEvaluationError, getExecutionResult, getExecutionResultOrThrow, getImportedModule, getLoadedModule, getPendingAsyncDependencies, getStatus, getTopLevelCapability, hasBeenEvaluated, hasTLA, incPendingAsyncDependencies, initAsyncParentModules, isAsyncEvaluation, isLinked, isReadyForSyncExecution, link, setAsyncEvaluatingOrder, setAsyncEvaluation, setCycleRoot, setDFSAncestorIndex, setDFSIndex, setEvaluationError, setExecutionResult, setPendingAsyncDependencies, setStatus, setTopLevelCapability, setUnlinkedMethods inherited from class com.oracle.truffle.js.runtime.objects.AbstractModuleRecord
clearEnvironment, getEnvironment, getExportedNames, getHostDefined, getModuleNamespace, getModuleNamespaceOrNull, loadRequestedModulesSync, resolveExport, setEnvironmentMethods inherited from class com.oracle.truffle.js.runtime.objects.ScriptOrModule
getContext, getSource
-
Constructor Details
-
JSModuleRecord
-
JSModuleRecord
-
-
Method Details
-
getModule
-
getModuleLoader
-
getFunctionData
-
getFrameDescriptor
public com.oracle.truffle.api.frame.FrameDescriptor getFrameDescriptor()- Overrides:
getFrameDescriptorin classAbstractModuleRecord
-
getModuleData
-
getImportMetaOrNull
-
getImportMeta
-
getURL
-
getModuleSource
- Specified by:
getModuleSourcein classAbstractModuleRecord
-
getExportedNames
public Collection<com.oracle.truffle.api.strings.TruffleString> getExportedNames(Set<JSModuleRecord> exportStarSet) - Specified by:
getExportedNamesin classAbstractModuleRecord
-
resolveExport
public ExportResolution resolveExport(com.oracle.truffle.api.strings.TruffleString exportName, Set<Pair<? extends AbstractModuleRecord, com.oracle.truffle.api.strings.TruffleString>> resolveSet) ResolveExport attempts to resolve an imported binding to the actual defining module and local binding name. The defining module may be the module represented by the Module Record this method was invoked on or some other module that is imported by that module. The parameter resolveSet is use to detect unresolved circular import/export paths. If a pair consisting of specific Module Record and exportName is reached that is already in resolveSet, an import circularity has been encountered. Before recursively calling ResolveExport, a pair consisting of module and exportName is added to resolveSet. If a defining module is found a Record {[[module]], [[bindingName]]} is returned. This record identifies the resolved binding of the originally requested export. If no definition was found or the request is found to be circular, null is returned. If the request is found to be ambiguous, the string "ambiguous" is returned.- Specified by:
resolveExportin classAbstractModuleRecord
-
getRequestedModules
Description copied from class:CyclicModuleRecordA list of all the ModuleSpecifier strings and import attributes used by the module represented by this record to request the importation of a module, in occurrence order.- Specified by:
getRequestedModulesin classCyclicModuleRecord
-
loadRequestedModules
Description copied from class:AbstractModuleRecordPrepares the module for linking by recursively loading all its dependencies.- Specified by:
loadRequestedModulesin classAbstractModuleRecord
-
initializeEnvironment
Description copied from class:CyclicModuleRecordInitialize the Environment Record of the module, including resolving all imported bindings, and create the module's execution context.- Specified by:
initializeEnvironmentin classCyclicModuleRecord
-
executeModule
Description copied from class:CyclicModuleRecordEvaluate the module's code within its execution context. If this module has true in [[HasTLA]], then a PromiseCapability Record is passed as an argument, and the method is expected to resolve or reject the given capability. In this case, the method must not throw an exception, but instead reject the PromiseCapability Record if necessary.- Specified by:
executeModulein classCyclicModuleRecord
-
rememberImportedModuleSource
public void rememberImportedModuleSource(com.oracle.truffle.api.strings.TruffleString moduleSpecifier, com.oracle.truffle.api.source.Source moduleSource) Description copied from class:ScriptOrModuleKeep a link from the referencing module or script to the imported module'sSource, so that the latter is kept alive for the lifetime of the former.- Overrides:
rememberImportedModuleSourcein classScriptOrModule
-
toString
-