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

#include <debug-scopes.h>

Collaboration diagram for v8::internal::ScopeIterator:

Public Types

enum  ScopeType {
  ScopeTypeGlobal = 0 , ScopeTypeLocal , ScopeTypeWith , ScopeTypeClosure ,
  ScopeTypeCatch , ScopeTypeBlock , ScopeTypeScript , ScopeTypeEval ,
  ScopeTypeModule
}
 
enum class  ReparseStrategy { kFunctionLiteral , kScriptIfNeeded }
 
enum class  Mode { STACK , ALL }
 

Public Member Functions

 ScopeIterator (Isolate *isolate, FrameInspector *frame_inspector, ReparseStrategy strategy)
 
 ScopeIterator (Isolate *isolate, DirectHandle< JSFunction > function)
 
 ScopeIterator (Isolate *isolate, Handle< JSGeneratorObject > generator)
 
 ~ScopeIterator ()
 
DirectHandle< JSObjectMaterializeScopeDetails ()
 
bool Done () const
 
void Next ()
 
void Restart ()
 
ScopeType Type () const
 
Handle< JSObjectScopeObject (Mode mode)
 
bool DeclaresLocals (Mode mode) const
 
bool SetVariableValue (Handle< String > variable_name, DirectHandle< Object > new_value)
 
bool ClosureScopeHasThisReference () const
 
DirectHandle< StringSetGetLocals ()
 
DirectHandle< ObjectGetFunctionDebugName () const
 
DirectHandle< ScriptGetScript () const
 
bool HasPositionInfo ()
 
int start_position ()
 
int end_position ()
 
bool InInnerScope () const
 
bool HasContext () const
 
bool NeedsContext () const
 
Handle< ContextCurrentContext () const
 

Static Public Attributes

static const int kScopeDetailsTypeIndex = 0
 
static const int kScopeDetailsObjectIndex = 1
 
static const int kScopeDetailsNameIndex = 2
 
static const int kScopeDetailsStartPositionIndex = 3
 
static const int kScopeDetailsEndPositionIndex = 4
 
static const int kScopeDetailsFunctionIndex = 5
 
static const int kScopeDetailsSize = 6
 

Private Types

using Visitor
 

Private Member Functions

JavaScriptFrameGetFrame () const
 
bool AdvanceOneScope ()
 
void AdvanceOneContext ()
 
void AdvanceScope ()
 
void AdvanceContext ()
 
void CollectLocalsFromCurrentScope ()
 
void MaybeCollectAndStoreLocalBlocklists () const
 
int GetSourcePosition () const
 
void TryParseAndRetrieveScopes (ReparseStrategy strategy)
 
void UnwrapEvaluationContext ()
 
Handle< JSObjectWithContextExtension ()
 
bool SetLocalVariableValue (DirectHandle< String > variable_name, DirectHandle< Object > new_value)
 
bool SetContextVariableValue (DirectHandle< String > variable_name, DirectHandle< Object > new_value)
 
bool SetContextExtensionValue (DirectHandle< String > variable_name, DirectHandle< Object > new_value)
 
bool SetScriptVariableValue (DirectHandle< String > variable_name, DirectHandle< Object > new_value)
 
bool SetModuleVariableValue (DirectHandle< String > variable_name, DirectHandle< Object > new_value)
 
void VisitScope (const Visitor &visitor, Mode mode) const
 
void VisitLocalScope (const Visitor &visitor, Mode mode, ScopeType scope_type) const
 
void VisitScriptScope (const Visitor &visitor) const
 
void VisitModuleScope (const Visitor &visitor) const
 
bool VisitLocals (const Visitor &visitor, Mode mode, ScopeType scope_type) const
 
bool VisitContextLocals (const Visitor &visitor, DirectHandle< ScopeInfo > scope_info, DirectHandle< Context > context, ScopeType scope_type) const
 
 DISALLOW_IMPLICIT_CONSTRUCTORS (ScopeIterator)
 

Private Attributes

Isolateisolate_
 
std::unique_ptr< ReusableUnoptimizedCompileStatereusable_compile_state_
 
std::unique_ptr< ParseInfoinfo_
 
FrameInspector *const frame_inspector_ = nullptr
 
Handle< JSGeneratorObjectgenerator_
 
Handle< JSFunctionfunction_
 
Handle< Contextcontext_
 
Handle< Scriptscript_
 
Handle< StringSetlocals_
 
DeclarationScopeclosure_scope_ = nullptr
 
Scopestart_scope_ = nullptr
 
Scopecurrent_scope_ = nullptr
 
bool seen_script_scope_ = false
 
bool calculate_blocklists_ = false
 

Detailed Description

Definition at line 21 of file debug-scopes.h.

Member Typedef Documentation

◆ Visitor

Initial value:
std::function<bool(Handle<String> name, Handle<Object> value,
ScopeType scope_type)>

Definition at line 158 of file debug-scopes.h.

Member Enumeration Documentation

◆ Mode

Enumerator
STACK 
ALL 

Definition at line 74 of file debug-scopes.h.

◆ ReparseStrategy

Enumerator
kFunctionLiteral 
kScriptIfNeeded 

Definition at line 43 of file debug-scopes.h.

◆ ScopeType

Enumerator
ScopeTypeGlobal 
ScopeTypeLocal 
ScopeTypeWith 
ScopeTypeClosure 
ScopeTypeCatch 
ScopeTypeBlock 
ScopeTypeScript 
ScopeTypeEval 
ScopeTypeModule 

Definition at line 23 of file debug-scopes.h.

Constructor & Destructor Documentation

◆ ScopeIterator() [1/3]

v8::internal::ScopeIterator::ScopeIterator ( Isolate * isolate,
FrameInspector * frame_inspector,
ReparseStrategy strategy )

Definition at line 24 of file debug-scopes.cc.

Here is the call graph for this function:

◆ ScopeIterator() [2/3]

v8::internal::ScopeIterator::ScopeIterator ( Isolate * isolate,
DirectHandle< JSFunction > function )

Definition at line 60 of file debug-scopes.cc.

Here is the call graph for this function:

◆ ScopeIterator() [3/3]

v8::internal::ScopeIterator::ScopeIterator ( Isolate * isolate,
Handle< JSGeneratorObject > generator )

Definition at line 73 of file debug-scopes.cc.

Here is the call graph for this function:

◆ ~ScopeIterator()

v8::internal::ScopeIterator::~ScopeIterator ( )
default

Member Function Documentation

◆ AdvanceContext()

void v8::internal::ScopeIterator::AdvanceContext ( )
private

Definition at line 488 of file debug-scopes.cc.

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

◆ AdvanceOneContext()

void v8::internal::ScopeIterator::AdvanceOneContext ( )
private

Definition at line 464 of file debug-scopes.cc.

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

◆ AdvanceOneScope()

bool v8::internal::ScopeIterator::AdvanceOneScope ( )
private

Definition at line 456 of file debug-scopes.cc.

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

◆ AdvanceScope()

void v8::internal::ScopeIterator::AdvanceScope ( )
private

Definition at line 474 of file debug-scopes.cc.

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

◆ ClosureScopeHasThisReference()

bool v8::internal::ScopeIterator::ClosureScopeHasThisReference ( ) const

Definition at line 718 of file debug-scopes.cc.

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

◆ CollectLocalsFromCurrentScope()

void v8::internal::ScopeIterator::CollectLocalsFromCurrentScope ( )
private

Definition at line 725 of file debug-scopes.cc.

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

◆ CurrentContext()

Handle< Context > v8::internal::ScopeIterator::CurrentContext ( ) const
inline

Definition at line 109 of file debug-scopes.h.

Here is the caller graph for this function:

◆ DeclaresLocals()

bool v8::internal::ScopeIterator::DeclaresLocals ( Mode mode) const

Definition at line 417 of file debug-scopes.cc.

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

◆ DISALLOW_IMPLICIT_CONSTRUCTORS()

v8::internal::ScopeIterator::DISALLOW_IMPLICIT_CONSTRUCTORS ( ScopeIterator )
private

◆ Done()

bool v8::internal::ScopeIterator::Done ( ) const
inline

Definition at line 61 of file debug-scopes.h.

Here is the caller graph for this function:

◆ end_position()

int v8::internal::ScopeIterator::end_position ( )

Definition at line 411 of file debug-scopes.cc.

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

◆ GetFrame()

JavaScriptFrame * v8::internal::ScopeIterator::GetFrame ( ) const
inlineprivate

Definition at line 134 of file debug-scopes.h.

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

◆ GetFunctionDebugName()

DirectHandle< Object > v8::internal::ScopeIterator::GetFunctionDebugName ( ) const

Definition at line 47 of file debug-scopes.cc.

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

◆ GetLocals()

DirectHandle< StringSet > v8::internal::ScopeIterator::GetLocals ( )
inline

Definition at line 89 of file debug-scopes.h.

◆ GetScript()

DirectHandle< Script > v8::internal::ScopeIterator::GetScript ( ) const
inline

Definition at line 95 of file debug-scopes.h.

Here is the caller graph for this function:

◆ GetSourcePosition()

int v8::internal::ScopeIterator::GetSourcePosition ( ) const
private

Definition at line 792 of file debug-scopes.cc.

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

◆ HasContext()

bool v8::internal::ScopeIterator::HasContext ( ) const

Definition at line 433 of file debug-scopes.cc.

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

◆ HasPositionInfo()

bool v8::internal::ScopeIterator::HasPositionInfo ( )

Definition at line 401 of file debug-scopes.cc.

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

◆ InInnerScope()

bool v8::internal::ScopeIterator::InInnerScope ( ) const
inline

Definition at line 106 of file debug-scopes.h.

Here is the caller graph for this function:

◆ MaterializeScopeDetails()

DirectHandle< JSObject > v8::internal::ScopeIterator::MaterializeScopeDetails ( )

Definition at line 378 of file debug-scopes.cc.

Here is the call graph for this function:

◆ MaybeCollectAndStoreLocalBlocklists()

void v8::internal::ScopeIterator::MaybeCollectAndStoreLocalBlocklists ( ) const
private

Definition at line 1381 of file debug-scopes.cc.

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

◆ NeedsContext()

bool v8::internal::ScopeIterator::NeedsContext ( ) const

Definition at line 437 of file debug-scopes.cc.

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

◆ Next()

void v8::internal::ScopeIterator::Next ( )

Definition at line 499 of file debug-scopes.cc.

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

◆ Restart()

void v8::internal::ScopeIterator::Restart ( )

Definition at line 85 of file debug-scopes.cc.

Here is the call graph for this function:

◆ ScopeObject()

Handle< JSObject > v8::internal::ScopeIterator::ScopeObject ( Mode mode)

Definition at line 607 of file debug-scopes.cc.

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

◆ SetContextExtensionValue()

bool v8::internal::ScopeIterator::SetContextExtensionValue ( DirectHandle< String > variable_name,
DirectHandle< Object > new_value )
private

Definition at line 1159 of file debug-scopes.cc.

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

◆ SetContextVariableValue()

bool v8::internal::ScopeIterator::SetContextVariableValue ( DirectHandle< String > variable_name,
DirectHandle< Object > new_value )
private

Definition at line 1174 of file debug-scopes.cc.

Here is the caller graph for this function:

◆ SetLocalVariableValue()

bool v8::internal::ScopeIterator::SetLocalVariableValue ( DirectHandle< String > variable_name,
DirectHandle< Object > new_value )
private

Definition at line 1067 of file debug-scopes.cc.

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

◆ SetModuleVariableValue()

bool v8::internal::ScopeIterator::SetModuleVariableValue ( DirectHandle< String > variable_name,
DirectHandle< Object > new_value )
private

Definition at line 1182 of file debug-scopes.cc.

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

◆ SetScriptVariableValue()

bool v8::internal::ScopeIterator::SetScriptVariableValue ( DirectHandle< String > variable_name,
DirectHandle< Object > new_value )
private

Definition at line 1203 of file debug-scopes.cc.

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

◆ SetVariableValue()

bool v8::internal::ScopeIterator::SetVariableValue ( Handle< String > variable_name,
DirectHandle< Object > new_value )

Definition at line 677 of file debug-scopes.cc.

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

◆ start_position()

int v8::internal::ScopeIterator::start_position ( )

Definition at line 405 of file debug-scopes.cc.

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

◆ TryParseAndRetrieveScopes()

void v8::internal::ScopeIterator::TryParseAndRetrieveScopes ( ReparseStrategy strategy)
private

Definition at line 221 of file debug-scopes.cc.

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

◆ Type()

ScopeIterator::ScopeType v8::internal::ScopeIterator::Type ( ) const

Definition at line 545 of file debug-scopes.cc.

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

◆ UnwrapEvaluationContext()

void v8::internal::ScopeIterator::UnwrapEvaluationContext ( )
private

Definition at line 363 of file debug-scopes.cc.

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

◆ VisitContextLocals()

bool v8::internal::ScopeIterator::VisitContextLocals ( const Visitor & visitor,
DirectHandle< ScopeInfo > scope_info,
DirectHandle< Context > context,
ScopeType scope_type ) const
private

Definition at line 845 of file debug-scopes.cc.

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

◆ VisitLocals()

bool v8::internal::ScopeIterator::VisitLocals ( const Visitor & visitor,
Mode mode,
ScopeType scope_type ) const
private

Definition at line 866 of file debug-scopes.cc.

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

◆ VisitLocalScope()

void v8::internal::ScopeIterator::VisitLocalScope ( const Visitor & visitor,
Mode mode,
ScopeType scope_type ) const
private

Definition at line 1006 of file debug-scopes.cc.

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

◆ VisitModuleScope()

void v8::internal::ScopeIterator::VisitModuleScope ( const Visitor & visitor) const
private

Definition at line 817 of file debug-scopes.cc.

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

◆ VisitScope()

void v8::internal::ScopeIterator::VisitScope ( const Visitor & visitor,
Mode mode ) const
private

Definition at line 654 of file debug-scopes.cc.

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

◆ VisitScriptScope()

void v8::internal::ScopeIterator::VisitScriptScope ( const Visitor & visitor) const
private

Definition at line 803 of file debug-scopes.cc.

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

◆ WithContextExtension()

Handle< JSObject > v8::internal::ScopeIterator::WithContextExtension ( )
private

Definition at line 994 of file debug-scopes.cc.

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

Member Data Documentation

◆ calculate_blocklists_

bool v8::internal::ScopeIterator::calculate_blocklists_ = false
private

Definition at line 132 of file debug-scopes.h.

◆ closure_scope_

DeclarationScope* v8::internal::ScopeIterator::closure_scope_ = nullptr
private

Definition at line 128 of file debug-scopes.h.

◆ context_

Handle<Context> v8::internal::ScopeIterator::context_
private

Definition at line 125 of file debug-scopes.h.

◆ current_scope_

Scope* v8::internal::ScopeIterator::current_scope_ = nullptr
private

Definition at line 130 of file debug-scopes.h.

◆ frame_inspector_

FrameInspector* const v8::internal::ScopeIterator::frame_inspector_ = nullptr
private

Definition at line 118 of file debug-scopes.h.

◆ function_

Handle<JSFunction> v8::internal::ScopeIterator::function_
private

Definition at line 123 of file debug-scopes.h.

◆ generator_

Handle<JSGeneratorObject> v8::internal::ScopeIterator::generator_
private

Definition at line 119 of file debug-scopes.h.

◆ info_

std::unique_ptr<ParseInfo> v8::internal::ScopeIterator::info_
private

Definition at line 117 of file debug-scopes.h.

◆ isolate_

Isolate* v8::internal::ScopeIterator::isolate_
private

Definition at line 115 of file debug-scopes.h.

◆ kScopeDetailsEndPositionIndex

const int v8::internal::ScopeIterator::kScopeDetailsEndPositionIndex = 4
static

Definition at line 39 of file debug-scopes.h.

◆ kScopeDetailsFunctionIndex

const int v8::internal::ScopeIterator::kScopeDetailsFunctionIndex = 5
static

Definition at line 40 of file debug-scopes.h.

◆ kScopeDetailsNameIndex

const int v8::internal::ScopeIterator::kScopeDetailsNameIndex = 2
static

Definition at line 37 of file debug-scopes.h.

◆ kScopeDetailsObjectIndex

const int v8::internal::ScopeIterator::kScopeDetailsObjectIndex = 1
static

Definition at line 36 of file debug-scopes.h.

◆ kScopeDetailsSize

const int v8::internal::ScopeIterator::kScopeDetailsSize = 6
static

Definition at line 41 of file debug-scopes.h.

◆ kScopeDetailsStartPositionIndex

const int v8::internal::ScopeIterator::kScopeDetailsStartPositionIndex = 3
static

Definition at line 38 of file debug-scopes.h.

◆ kScopeDetailsTypeIndex

const int v8::internal::ScopeIterator::kScopeDetailsTypeIndex = 0
static

Definition at line 35 of file debug-scopes.h.

◆ locals_

Handle<StringSet> v8::internal::ScopeIterator::locals_
private

Definition at line 127 of file debug-scopes.h.

◆ reusable_compile_state_

std::unique_ptr<ReusableUnoptimizedCompileState> v8::internal::ScopeIterator::reusable_compile_state_
private

Definition at line 116 of file debug-scopes.h.

◆ script_

Handle<Script> v8::internal::ScopeIterator::script_
private

Definition at line 126 of file debug-scopes.h.

◆ seen_script_scope_

bool v8::internal::ScopeIterator::seen_script_scope_ = false
private

Definition at line 131 of file debug-scopes.h.

◆ start_scope_

Scope* v8::internal::ScopeIterator::start_scope_ = nullptr
private

Definition at line 129 of file debug-scopes.h.


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