blob: 185443414ddc08c272c87852a1bbdcc7611fc187 [file] [log] [blame]
// Copyright 2019 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.
type SourceTextModuleInfo extends FixedArray;
bitfield struct SourceTextModuleFlags extends uint31 {
async: bool: 1 bit;
async_evaluating: bool: 1 bit;
}
@generateCppClass
extern class SourceTextModule extends Module {
// The code representing this module, or an abstraction thereof.
code: SharedFunctionInfo|JSFunction|JSGeneratorObject|SourceTextModuleInfo;
// Arrays of cells corresponding to regular exports and regular imports.
// A cell's position in the array is determined by the cell index of the
// associated module entry (which coincides with the variable index of the
// associated variable).
regular_exports: FixedArray;
regular_imports: FixedArray;
// Modules imported or re-exported by this module.
// Corresponds 1-to-1 to the module specifier strings in
// SourceTextModuleInfo::module_requests.
requested_modules: FixedArray;
// Script from which the module originates.
script: Script;
// The value of import.meta inside of this module.
// Lazily initialized on first access. It's the hole before first access and
// a JSObject afterwards.
import_meta: TheHole|JSObject;
async_parent_modules: ArrayList;
top_level_capability: JSPromise|Undefined;
// TODO(neis): Don't store those in the module object?
dfs_index: Smi;
dfs_ancestor_index: Smi;
// The number of currently evaluating async dependencies of this module.
pending_async_dependencies: Smi;
flags: SmiTagged<SourceTextModuleFlags>;
}
@generateCppClass
extern class SourceTextModuleInfoEntry extends Struct {
export_name: String|Undefined;
local_name: String|Undefined;
import_name: String|Undefined;
module_request: Smi;
cell_index: Smi;
beg_pos: Smi;
end_pos: Smi;
}