#include "src/debug/debug-scopes.h"
#include <memory>
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
#include "src/common/globals.h"
#include "src/debug/debug.h"
#include "src/execution/frames-inl.h"
#include "src/objects/js-generator-inl.h"
#include "src/objects/source-text-module.h"
#include "src/objects/string-set.h"
#include "src/parsing/parse-info.h"
#include "src/parsing/parsing.h"
#include "src/utils/ostreams.h"
namespace v8 {
namespace internal {
ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector,
ReparseStrategy strategy)
: … { … }
ScopeIterator::~ScopeIterator() = default;
Handle<Object> ScopeIterator::GetFunctionDebugName() const { … }
ScopeIterator::ScopeIterator(Isolate* isolate,
DirectHandle<JSFunction> function)
: … { … }
ScopeIterator::ScopeIterator(Isolate* isolate,
Handle<JSGeneratorObject> generator)
: … { … }
void ScopeIterator::Restart() { … }
namespace {
class ScopeChainRetriever { … };
MaybeHandle<ScopeInfo> FindEvalScope(Isolate* isolate,
Tagged<ScopeInfo> start_scope) { … }
}
void ScopeIterator::TryParseAndRetrieveScopes(ReparseStrategy strategy) { … }
void ScopeIterator::UnwrapEvaluationContext() { … }
Handle<JSObject> ScopeIterator::MaterializeScopeDetails() { … }
bool ScopeIterator::HasPositionInfo() { … }
int ScopeIterator::start_position() { … }
int ScopeIterator::end_position() { … }
bool ScopeIterator::DeclaresLocals(Mode mode) const { … }
bool ScopeIterator::HasContext() const { … }
bool ScopeIterator::NeedsContext() const { … }
bool ScopeIterator::AdvanceOneScope() { … }
void ScopeIterator::AdvanceOneContext() { … }
void ScopeIterator::AdvanceScope() { … }
void ScopeIterator::AdvanceContext() { … }
void ScopeIterator::Next() { … }
ScopeIterator::ScopeType ScopeIterator::Type() const { … }
Handle<JSObject> ScopeIterator::ScopeObject(Mode mode) { … }
void ScopeIterator::VisitScope(const Visitor& visitor, Mode mode) const { … }
bool ScopeIterator::SetVariableValue(Handle<String> name,
Handle<Object> value) { … }
bool ScopeIterator::ClosureScopeHasThisReference() const { … }
void ScopeIterator::CollectLocalsFromCurrentScope() { … }
#ifdef DEBUG
void ScopeIterator::DebugPrint() { … }
#endif
int ScopeIterator::GetSourcePosition() const { … }
void ScopeIterator::VisitScriptScope(const Visitor& visitor) const { … }
void ScopeIterator::VisitModuleScope(const Visitor& visitor) const { … }
bool ScopeIterator::VisitContextLocals(const Visitor& visitor,
Handle<ScopeInfo> scope_info,
DirectHandle<Context> context,
ScopeType scope_type) const { … }
bool ScopeIterator::VisitLocals(const Visitor& visitor, Mode mode,
ScopeType scope_type) const { … }
Handle<JSObject> ScopeIterator::WithContextExtension() { … }
void ScopeIterator::VisitLocalScope(const Visitor& visitor, Mode mode,
ScopeType scope_type) const { … }
bool ScopeIterator::SetLocalVariableValue(Handle<String> variable_name,
DirectHandle<Object> new_value) { … }
bool ScopeIterator::SetContextExtensionValue(Handle<String> variable_name,
Handle<Object> new_value) { … }
bool ScopeIterator::SetContextVariableValue(Handle<String> variable_name,
DirectHandle<Object> new_value) { … }
bool ScopeIterator::SetModuleVariableValue(DirectHandle<String> variable_name,
DirectHandle<Object> new_value) { … }
bool ScopeIterator::SetScriptVariableValue(Handle<String> variable_name,
DirectHandle<Object> new_value) { … }
namespace {
class LocalBlocklistsCollector { … };
LocalBlocklistsCollector::LocalBlocklistsCollector(
Isolate* isolate, Handle<Script> script, Handle<Context> context,
DeclarationScope* closure_scope)
: … { … }
void LocalBlocklistsCollector::InitializeWithClosureScope() { … }
void LocalBlocklistsCollector::AdvanceToNextNonHiddenScope() { … }
void LocalBlocklistsCollector::CollectCurrentLocalsIntoBlocklists() { … }
Handle<ScopeInfo> LocalBlocklistsCollector::FindScopeInfoForScope(
Scope* scope) const { … }
void LocalBlocklistsCollector::StoreFunctionBlocklists(
Handle<ScopeInfo> outer_scope_info) { … }
void LocalBlocklistsCollector::CollectAndStore() { … }
}
void ScopeIterator::MaybeCollectAndStoreLocalBlocklists() const { … }
}
}