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

#include <scopes.h>

Inheritance diagram for v8::internal::ModuleScope:
Collaboration diagram for v8::internal::ModuleScope:

Public Member Functions

 ModuleScope (DeclarationScope *script_scope, AstValueFactory *avfactory)
 
 ModuleScope (Handle< ScopeInfo > scope_info, AstValueFactory *avfactory)
 
SourceTextModuleDescriptor * module () const
 
void AllocateModuleVariables ()
 
- Public Member Functions inherited from v8::internal::DeclarationScope
 DeclarationScope (Zone *zone, Scope *outer_scope, ScopeType scope_type, FunctionKind function_kind=FunctionKind::kNormalFunction)
 
 DeclarationScope (Zone *zone, ScopeType scope_type, AstValueFactory *ast_value_factory, Handle< ScopeInfo > scope_info)
 
 DeclarationScope (Zone *zone, AstValueFactory *ast_value_factory, REPLMode repl_mode=REPLMode::kNo)
 
FunctionKind function_kind () const
 
void RecordSuperPropertyUsage ()
 
bool uses_super_property () const
 
void TakeUnresolvedReferencesFromParent ()
 
bool is_arrow_scope () const
 
void RecordDeclarationScopeEvalCall ()
 
bool sloppy_eval_can_extend_vars () const
 
bool was_lazily_parsed () const
 
Variable * LookupInModule (const AstRawString *name)
 
void DeserializeReceiver (AstValueFactory *ast_value_factory)
 
void set_zone (Zone *zone)
 
Declaration * CheckConflictingVarDeclarations (bool *allowed_catch_binding_var_redeclaration)
 
void set_has_checked_syntax (bool has_checked_syntax)
 
bool has_checked_syntax () const
 
bool ShouldEagerCompile () const
 
void set_should_eager_compile ()
 
void SetScriptScopeInfo (Handle< ScopeInfo > scope_info)
 
bool should_ban_arguments () const
 
void set_module_has_toplevel_await ()
 
void DeclareThis (AstValueFactory *ast_value_factory)
 
void DeclareArguments (AstValueFactory *ast_value_factory)
 
void DeclareDefaultFunctionVariables (AstValueFactory *ast_value_factory)
 
Variable * DeclareFunctionVar (const AstRawString *name, Scope *cache=nullptr)
 
Variable * DeclareGeneratorObjectVar (const AstRawString *name)
 
Variable * DeclareParameter (const AstRawString *name, VariableMode mode, bool is_optional, bool is_rest, AstValueFactory *ast_value_factory, int position)
 
void RecordParameter (bool is_rest)
 
Variable * DeclareDynamicGlobal (const AstRawString *name, VariableKind variable_kind, Scope *cache)
 
Variable * receiver ()
 
bool has_this_declaration () const
 
Variable * new_target_var ()
 
Variable * function_var () const
 
Variable * generator_object_var () const
 
Variable * parameter (int index) const
 
int num_parameters () const
 
Variable * rest_parameter () const
 
bool has_simple_parameters () const
 
void SetHasNonSimpleParameters ()
 
void MakeParametersNonSimple ()
 
CreateArgumentsType GetArgumentsType () const
 
Variable * arguments () const
 
Variable * this_function_var () const
 
void AddLocal (Variable *var)
 
void DeclareSloppyBlockFunction (SloppyBlockFunctionStatement *sloppy_block_function)
 
void HoistSloppyBlockFunctions (AstNodeFactory *factory)
 
void AnalyzePartially (Parser *parser, AstNodeFactory *ast_node_factory, bool maybe_in_arrowhead)
 
bool AllowsLazyCompilation () const
 
void ForceEagerCompilation ()
 
V8_INLINE void AllocateLocals ()
 
V8_INLINE void AllocateParameterLocals ()
 
V8_INLINE void AllocateReceiver ()
 
void ResetAfterPreparsing (AstValueFactory *ast_value_factory, bool aborted)
 
bool is_skipped_function () const
 
void set_is_skipped_function (bool is_skipped_function)
 
bool has_inferred_function_name () const
 
void set_has_inferred_function_name (bool value)
 
void SavePreparseDataForDeclarationScope (Parser *parser)
 
void set_preparse_data_builder (PreparseDataBuilder *preparse_data_builder)
 
PreparseDataBuilder * preparse_data_builder () const
 
void set_has_this_reference ()
 
bool has_this_reference () const
 
void UsesThis ()
 
bool needs_private_name_context_chain_recalc () const
 
void RecordNeedsPrivateNameContextChainRecalc ()
 
void set_class_scope_has_private_brand (bool value)
 
bool class_scope_has_private_brand () const
 
template<typename IsolateT >
void AllocateScopeInfos (ParseInfo *parse_info, DirectHandle< Script > script, IsolateT *isolate)
 
- Public Member Functions inherited from v8::internal::Scope
 Scope (Zone *zone, Scope *outer_scope, ScopeType scope_type)
 
int UniqueIdInScript () const
 
DeclarationScope * AsDeclarationScope ()
 
const DeclarationScope * AsDeclarationScope () const
 
ModuleScope * AsModuleScope ()
 
const ModuleScope * AsModuleScope () const
 
ClassScope * AsClassScope ()
 
const ClassScope * AsClassScope () const
 
bool is_reparsed () const
 
void RewriteReplGlobalVariables ()
 
Scope * FinalizeBlockScope ()
 
Zone * zone () const
 
void SetMustUsePreparseData ()
 
bool must_use_preparsed_scope_data () const
 
Variable * LookupLocal (const AstRawString *name)
 
Variable * LookupInScopeInfo (const AstRawString *name, Scope *cache)
 
Variable * DeclareLocal (const AstRawString *name, VariableMode mode, VariableKind kind, bool *was_added, InitializationFlag init_flag=kCreatedInitialized)
 
Variable * DeclareVariable (Declaration *declaration, const AstRawString *name, int pos, VariableMode mode, VariableKind kind, InitializationFlag init, bool *was_added, bool *sloppy_mode_block_scope_function_redefinition, bool *ok)
 
Variable * DeclareVariableName (const AstRawString *name, VariableMode mode, bool *was_added, VariableKind kind=NORMAL_VARIABLE)
 
Variable * DeclareCatchVariableName (const AstRawString *name)
 
Variable * DeclareHomeObjectVariable (AstValueFactory *ast_value_factory)
 
Variable * DeclareStaticHomeObjectVariable (AstValueFactory *ast_value_factory)
 
base::ThreadedList< Declaration > * declarations ()
 
base::ThreadedList< Variable > * locals ()
 
VariableProxy * NewUnresolved (AstNodeFactory *factory, const AstRawString *name, int start_pos, VariableKind kind=NORMAL_VARIABLE)
 
void AddUnresolved (VariableProxy *proxy)
 
void DeleteUnresolved (VariableProxy *var)
 
Variable * NewTemporary (const AstRawString *name)
 
const AstRawString * FindVariableDeclaredIn (Scope *scope, VariableMode mode_limit)
 
void RecordEvalCall ()
 
void RecordInnerScopeEvalCall ()
 
void SetLanguageMode (LanguageMode language_mode)
 
void SetNonlinear ()
 
int start_position () const
 
void set_start_position (int statement_pos)
 
int end_position () const
 
void set_end_position (int statement_pos)
 
bool is_hidden () const
 
void set_is_hidden ()
 
void ForceContextAllocationForParameters ()
 
bool has_forced_context_allocation_for_parameters () const
 
bool is_eval_scope () const
 
bool is_function_scope () const
 
bool is_module_scope () const
 
bool is_script_scope () const
 
bool is_catch_scope () const
 
bool is_block_scope () const
 
bool is_with_scope () const
 
bool is_declaration_scope () const
 
bool is_class_scope () const
 
bool is_home_object_scope () const
 
bool is_block_scope_for_object_literal () const
 
void set_is_block_scope_for_object_literal ()
 
bool inner_scope_calls_eval () const
 
bool private_name_lookup_skips_outer_class () const
 
bool has_using_declaration () const
 
bool has_await_using_declaration () const
 
bool is_wrapped_function () const
 
void set_is_wrapped_function ()
 
bool is_nonlinear () const
 
bool ForceContextForLanguageMode () const
 
bool NeedsContext () const
 
template<typename FunctionType >
V8_INLINE void ForEach (FunctionType callback)
 
bool IsConstructorScope () const
 
bool IsOuterScopeOf (Scope *other) const
 
ScopeType scope_type () const
 
LanguageMode language_mode () const
 
Scope * inner_scope () const
 
Scope * sibling () const
 
Scope * outer_scope () const
 
Variable * catch_variable () const
 
bool ShouldBanArguments ()
 
int num_stack_slots () const
 
int num_heap_slots () const
 
bool HasContextExtensionSlot () const
 
int ContextHeaderLength () const
 
int ContextLocalCount () const
 
bool AllowsLazyParsingWithoutUnresolvedVariables (const Scope *outer) const
 
int ContextChainLength (Scope *scope) const
 
int ContextChainLengthUntilOutermostSloppyEval () const
 
DeclarationScope * GetDeclarationScope ()
 
DeclarationScope * GetNonEvalDeclarationScope ()
 
DeclarationScope * GetClosureScope ()
 
const DeclarationScope * GetClosureScope () const
 
DeclarationScope * GetReceiverScope ()
 
DeclarationScope * GetConstructorScope ()
 
Scope * GetHomeObjectScope ()
 
DeclarationScope * GetScriptScope ()
 
Scope * GetOuterScopeWithContext ()
 
bool HasReceiverToDeserialize () const
 
bool HasThisReference () const
 
Handle< ScopeInfo > scope_info () const
 
int num_var () const
 
bool HasSimpleParameters ()
 
void set_is_debug_evaluate_scope ()
 
bool is_debug_evaluate_scope () const
 
bool IsSkippableFunctionScope ()
 
bool is_repl_mode_scope () const
 
bool needs_home_object () const
 
void set_needs_home_object ()
 
bool RemoveInnerScope (Scope *inner_scope)
 
Variable * LookupInScopeOrScopeInfo (const AstRawString *name, Scope *cache)
 
Variable * LookupForTesting (const AstRawString *name)
 
void ForceDynamicLookup (VariableProxy *proxy)
 
template<typename FunctionType >
void ForEach (FunctionType callback)
 
template<typename IsolateT >
void AllocateScopeInfosRecursively (IsolateT *isolate, MaybeHandle< ScopeInfo > outer_scope, std::unordered_map< int, Handle< ScopeInfo > > &scope_infos_to_reuse)
 

Private Attributes

SourceTextModuleDescriptor *const module_descriptor_
 

Additional Inherited Members

- Public Types inherited from v8::internal::Scope
enum class  DeserializationMode { kIncludingVariables , kScopesOnly }
 
enum  Iteration { kContinue , kDescend }
 
- Static Public Member Functions inherited from v8::internal::DeclarationScope
static V8_WARN_UNUSED_RESULT bool Analyze (ParseInfo *info)
 
template<typename IsolateT >
static V8_EXPORT_PRIVATE void AllocateScopeInfos (ParseInfo *info, DirectHandle< Script > script, IsolateT *isolate)
 
- Static Public Member Functions inherited from v8::internal::Scope
template<typename IsolateT >
static Scope * DeserializeScopeChain (IsolateT *isolate, Zone *zone, Tagged< ScopeInfo > scope_info, DeclarationScope *script_scope, AstValueFactory *ast_value_factory, DeserializationMode deserialization_mode, ParseInfo *info=nullptr)
 
template<typename IsolateT >
static void SetScriptScopeInfo (IsolateT *isolate, DeclarationScope *script_scope)
 
- Protected Member Functions inherited from v8::internal::Scope
 Scope (Zone *zone, ScopeType scope_type)
 
void set_language_mode (LanguageMode language_mode)
 

Detailed Description

Definition at line 1371 of file scopes.h.

Constructor & Destructor Documentation

◆ ModuleScope() [1/2]

v8::internal::ModuleScope::ModuleScope ( DeclarationScope * script_scope,
AstValueFactory * avfactory )

Definition at line 164 of file scopes.cc.

Here is the call graph for this function:

◆ ModuleScope() [2/2]

v8::internal::ModuleScope::ModuleScope ( Handle< ScopeInfo > scope_info,
AstValueFactory * avfactory )

Definition at line 175 of file scopes.cc.

Here is the call graph for this function:

Member Function Documentation

◆ AllocateModuleVariables()

void v8::internal::ModuleScope::AllocateModuleVariables ( )

Definition at line 2562 of file scopes.cc.

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

◆ module()

SourceTextModuleDescriptor * v8::internal::ModuleScope::module ( ) const
inline

Definition at line 1379 of file scopes.h.

Here is the caller graph for this function:

Member Data Documentation

◆ module_descriptor_

SourceTextModuleDescriptor* const v8::internal::ModuleScope::module_descriptor_
private

Definition at line 1386 of file scopes.h.


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