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

#include <scopes.h>

Inheritance diagram for v8::internal::ClassScope:
Collaboration diagram for v8::internal::ClassScope:

Classes

struct  HeritageParsingScope
 
struct  RareData
 

Public Member Functions

 ClassScope (Zone *zone, Scope *outer_scope, bool is_anonymous)
 
template<typename IsolateT >
 ClassScope (IsolateT *isolate, Zone *zone, AstValueFactory *ast_value_factory, Handle< ScopeInfo > scope_info)
 
Variable * DeclarePrivateName (const AstRawString *name, VariableMode mode, IsStaticFlag is_static_flag, bool *was_added)
 
Variable * RedeclareSyntheticContextVariable (const AstRawString *name)
 
V8_WARN_UNUSED_RESULT bool ResolvePrivateNames (ParseInfo *info)
 
VariableProxy * ResolvePrivateNamesPartially ()
 
UnresolvedList::Iterator GetUnresolvedPrivateNameTail ()
 
void ResetUnresolvedPrivateNameTail (UnresolvedList::Iterator tail)
 
void MigrateUnresolvedPrivateNameTail (AstNodeFactory *ast_node_factory, UnresolvedList::Iterator tail)
 
Variable * DeclareBrandVariable (AstValueFactory *ast_value_factory, IsStaticFlag is_static_flag, int class_token_pos)
 
Variable * DeclareClassVariable (AstValueFactory *ast_value_factory, const AstRawString *name, int class_token_pos)
 
Variable * brand ()
 
Variable * class_variable ()
 
V8_INLINE bool IsParsingHeritage ()
 
bool has_static_private_methods () const
 
bool should_save_class_variable_index () const
 
bool is_anonymous_class () const
 
void set_should_save_class_variable_index ()
 
- 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 Member Functions

Variable * LookupPrivateName (VariableProxy *proxy)
 
Variable * LookupLocalPrivateName (const AstRawString *name)
 
Variable * LookupPrivateNameInScopeInfo (const AstRawString *name)
 
V8_INLINE RareData * GetRareData ()
 
V8_INLINE RareData * EnsureRareData ()
 
V8_INLINE void SetIsParsingHeritage (bool v)
 

Private Attributes

base::PointerWithPayload< RareData, bool, 1 > rare_data_and_is_parsing_heritage_
 
Variable * class_variable_ = nullptr
 
bool has_static_private_methods_: 1 = false
 
bool has_explicit_static_private_methods_access_: 1 = false
 
bool is_anonymous_class_: 1 = false
 
bool should_save_class_variable_index_: 1 = false
 

Friends

class Scope
 
class PrivateNameScopeIterator
 

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::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 1389 of file scopes.h.

Constructor & Destructor Documentation

◆ ClassScope() [1/2]

v8::internal::ClassScope::ClassScope ( Zone * zone,
Scope * outer_scope,
bool is_anonymous )

Definition at line 183 of file scopes.cc.

Here is the call graph for this function:

◆ ClassScope() [2/2]

template<typename IsolateT >
v8::internal::ClassScope::ClassScope ( IsolateT * isolate,
Zone * zone,
AstValueFactory * ast_value_factory,
Handle< ScopeInfo > scope_info )

Definition at line 191 of file scopes.cc.

Here is the call graph for this function:

Member Function Documentation

◆ brand()

Variable * v8::internal::ClassScope::brand ( )
inline

Definition at line 1449 of file scopes.h.

Here is the caller graph for this function:

◆ class_variable()

Variable * v8::internal::ClassScope::class_variable ( )
inline

Definition at line 1453 of file scopes.h.

Here is the caller graph for this function:

◆ DeclareBrandVariable()

Variable * v8::internal::ClassScope::DeclareBrandVariable ( AstValueFactory * ast_value_factory,
IsStaticFlag is_static_flag,
int class_token_pos )

Definition at line 3175 of file scopes.cc.

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

◆ DeclareClassVariable()

Variable * v8::internal::ClassScope::DeclareClassVariable ( AstValueFactory * ast_value_factory,
const AstRawString * name,
int class_token_pos )

Definition at line 3193 of file scopes.cc.

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

◆ DeclarePrivateName()

Variable * v8::internal::ClassScope::DeclarePrivateName ( const AstRawString * name,
VariableMode mode,
IsStaticFlag is_static_flag,
bool * was_added )

Definition at line 2956 of file scopes.cc.

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

◆ EnsureRareData()

V8_INLINE RareData * v8::internal::ClassScope::EnsureRareData ( )
inlineprivate

Definition at line 1510 of file scopes.h.

Here is the caller graph for this function:

◆ GetRareData()

V8_INLINE RareData * v8::internal::ClassScope::GetRareData ( )
inlineprivate

Definition at line 1507 of file scopes.h.

◆ GetUnresolvedPrivateNameTail()

UnresolvedList::Iterator v8::internal::ClassScope::GetUnresolvedPrivateNameTail ( )

Definition at line 2986 of file scopes.cc.

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

◆ has_static_private_methods()

bool v8::internal::ClassScope::has_static_private_methods ( ) const
inline

Definition at line 1461 of file scopes.h.

◆ is_anonymous_class()

bool v8::internal::ClassScope::is_anonymous_class ( ) const
inline

Definition at line 1479 of file scopes.h.

Here is the caller graph for this function:

◆ IsParsingHeritage()

V8_INLINE bool v8::internal::ClassScope::IsParsingHeritage ( )
inline

Definition at line 1455 of file scopes.h.

Here is the caller graph for this function:

◆ LookupLocalPrivateName()

Variable * v8::internal::ClassScope::LookupLocalPrivateName ( const AstRawString * name)
private

Definition at line 2978 of file scopes.cc.

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

◆ LookupPrivateName()

Variable * v8::internal::ClassScope::LookupPrivateName ( VariableProxy * proxy)
private

Definition at line 3065 of file scopes.cc.

Here is the call graph for this function:

◆ LookupPrivateNameInScopeInfo()

Variable * v8::internal::ClassScope::LookupPrivateNameInScopeInfo ( const AstRawString * name)
private

Definition at line 3040 of file scopes.cc.

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

◆ MigrateUnresolvedPrivateNameTail()

void v8::internal::ClassScope::MigrateUnresolvedPrivateNameTail ( AstNodeFactory * ast_node_factory,
UnresolvedList::Iterator tail )

Definition at line 3010 of file scopes.cc.

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

◆ RedeclareSyntheticContextVariable()

Variable * v8::internal::ClassScope::RedeclareSyntheticContextVariable ( const AstRawString * name)

◆ ResetUnresolvedPrivateNameTail()

void v8::internal::ClassScope::ResetUnresolvedPrivateNameTail ( UnresolvedList::Iterator tail)

Definition at line 2994 of file scopes.cc.

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

◆ ResolvePrivateNames()

bool v8::internal::ClassScope::ResolvePrivateNames ( ParseInfo * info)

Definition at line 3084 of file scopes.cc.

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

◆ ResolvePrivateNamesPartially()

VariableProxy * v8::internal::ClassScope::ResolvePrivateNamesPartially ( )

Definition at line 3113 of file scopes.cc.

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

◆ set_should_save_class_variable_index()

void v8::internal::ClassScope::set_should_save_class_variable_index ( )
inline

Definition at line 1482 of file scopes.h.

Here is the caller graph for this function:

◆ SetIsParsingHeritage()

V8_INLINE void v8::internal::ClassScope::SetIsParsingHeritage ( bool v)
inlineprivate

Definition at line 1517 of file scopes.h.

◆ should_save_class_variable_index()

bool v8::internal::ClassScope::should_save_class_variable_index ( ) const
inline

Definition at line 1472 of file scopes.h.

Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ PrivateNameScopeIterator

friend class PrivateNameScopeIterator
friend

Definition at line 1488 of file scopes.h.

◆ Scope

friend class Scope
friend

Definition at line 1487 of file scopes.h.

Member Data Documentation

◆ class_variable_

Variable* v8::internal::ClassScope::class_variable_ = nullptr
private

Definition at line 1523 of file scopes.h.

◆ has_explicit_static_private_methods_access_

bool v8::internal::ClassScope::has_explicit_static_private_methods_access_
private

Definition at line 1527 of file scopes.h.

◆ has_static_private_methods_

bool v8::internal::ClassScope::has_static_private_methods_
private

Definition at line 1526 of file scopes.h.

◆ is_anonymous_class_

bool v8::internal::ClassScope::is_anonymous_class_
private

Definition at line 1528 of file scopes.h.

◆ rare_data_and_is_parsing_heritage_

base::PointerWithPayload<RareData, bool, 1> v8::internal::ClassScope::rare_data_and_is_parsing_heritage_
private

Definition at line 1522 of file scopes.h.

◆ should_save_class_variable_index_

bool v8::internal::ClassScope::should_save_class_variable_index_
private

Definition at line 1531 of file scopes.h.


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