V8 Project
|
#include <scopes.h>
Static Public Member Functions | |
static bool | Analyze (CompilationInfo *info) |
static Scope * | DeserializeScopeChain (Context *context, Scope *global_scope, Zone *zone) |
Protected Types | |
enum | BindingKind { BOUND , BOUND_EVAL_SHADOWED , UNBOUND , UNBOUND_EVAL_SHADOWED , DYNAMIC_LOOKUP } |
Protected Attributes | |
Isolate *const | isolate_ |
Scope * | outer_scope_ |
ZoneList< Scope * > | inner_scopes_ |
ScopeType | scope_type_ |
const AstRawString * | scope_name_ |
VariableMap | variables_ |
ZoneList< Variable * > | internals_ |
ZoneList< Variable * > | temps_ |
ZoneList< Variable * > | params_ |
DynamicScopePart * | dynamics_ |
ZoneList< VariableProxy * > | unresolved_ |
ZoneList< Declaration * > | decls_ |
Variable * | receiver_ |
VariableDeclaration * | function_ |
Variable * | arguments_ |
Interface * | interface_ |
Expression * | illegal_redecl_ |
bool | scope_inside_with_ |
bool | scope_contains_with_ |
bool | scope_calls_eval_ |
bool | asm_module_ |
bool | asm_function_ |
StrictMode | strict_mode_ |
int | start_position_ |
int | end_position_ |
bool | outer_scope_calls_sloppy_eval_ |
bool | inner_scope_calls_eval_ |
bool | force_eager_compilation_ |
bool | force_context_allocation_ |
bool | already_resolved_ |
int | num_var_or_const_ |
int | num_stack_slots_ |
int | num_heap_slots_ |
int | num_modules_ |
Variable * | module_var_ |
Handle< ScopeInfo > | scope_info_ |
Private Member Functions | |
Scope (Scope *inner_scope, ScopeType type, Handle< ScopeInfo > scope_info, AstValueFactory *value_factory, Zone *zone) | |
Scope (Scope *inner_scope, const AstRawString *catch_variable_name, AstValueFactory *value_factory, Zone *zone) | |
void | AddInnerScope (Scope *inner_scope) |
void | SetDefaults (ScopeType type, Scope *outer_scope, Handle< ScopeInfo > scope_info) |
Private Attributes | |
AstValueFactory * | ast_value_factory_ |
Zone * | zone_ |
Friends | |
class | ParserFactory |
|
protected |
v8::internal::Scope::Scope | ( | Scope * | outer_scope, |
ScopeType | scope_type, | ||
AstValueFactory * | value_factory, | ||
Zone * | zone | ||
) |
Definition at line 70 of file scopes.cc.
References DCHECK, v8::internal::GLOBAL_SCOPE, HasIllegalRedeclaration(), NULL, outer_scope(), scope_type(), and SetDefaults().
Referenced by DeserializeScopeChain().
|
private |
Definition at line 93 of file scopes.cc.
References AddInnerScope(), v8::internal::Handle< T >::is_null(), v8::internal::Max(), v8::internal::Context::MIN_CONTEXT_SLOTS, NULL, num_heap_slots_, scope_info_, scope_type(), and SetDefaults().
|
private |
Definition at line 121 of file scopes.cc.
References AddInnerScope(), AllocateHeapSlot(), v8::internal::CATCH_SCOPE, v8::internal::VariableMap::Declare(), v8::internal::kCreatedInitialized, v8::internal::Context::MIN_CONTEXT_SLOTS, v8::internal::Variable::NORMAL, NULL, num_heap_slots_, num_var_or_const_, SetDefaults(), v8::internal::VAR, and variables_.
void v8::internal::Scope::AddDeclaration | ( | Declaration * | declaration | ) |
|
inlineprivate |
Definition at line 612 of file scopes.h.
References inner_scopes_, NULL, outer_scope_, and zone_.
Referenced by DeserializeScopeChain(), FinalizeBlockScope(), and Scope().
|
protected |
Definition at line 1238 of file scopes.cc.
References v8::internal::Variable::AllocateTo(), v8::internal::Variable::CONTEXT, and num_heap_slots_.
Referenced by AllocateNonParameterLocal(), AllocateParameterLocals(), and Scope().
|
protected |
Definition at line 1382 of file scopes.cc.
References AllocateModulesRecursively(), already_resolved(), ast_value_factory_, DCHECK, inner_scopes_, interface_, is_module_scope(), v8::internal::Interface::IsFrozen(), module_var_, NewInternal(), NULL, and num_modules_.
Referenced by AllocateModulesRecursively(), and AllocateVariables().
|
protected |
Definition at line 1299 of file scopes.cc.
References AllocateHeapSlot(), AllocateStackSlot(), DCHECK, v8::internal::Isolate::factory(), isolate_, v8::internal::Variable::IsStackLocal(), v8::internal::Variable::IsUnallocated(), v8::internal::Variable::IsVariable(), MustAllocate(), MustAllocateInContext(), and v8::internal::Variable::scope().
Referenced by AllocateNonParameterLocals().
|
protected |
Definition at line 1313 of file scopes.cc.
References v8::internal::List< T, AllocationPolicy >::Add(), AllocateNonParameterLocal(), v8::internal::VarAndOrder::Compare(), function_, internals_, v8::internal::TemplateHashMapImpl< AllocationPolicy >::Next(), NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::List< T, AllocationPolicy >::Sort(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Start(), temps_, variables_, and zone().
Referenced by AllocateVariablesRecursively().
|
protected |
Definition at line 1243 of file scopes.cc.
References AllocateHeapSlot(), v8::internal::Variable::AllocateTo(), arguments(), arguments_, ast_value_factory_, DCHECK, v8::internal::Variable::ForceContextAllocation(), has_forced_context_allocation(), HasArgumentsParameter(), is_function_scope(), v8::internal::Variable::IsContextSlot(), v8::internal::Variable::IsParameter(), v8::internal::Variable::IsUnallocated(), LookupLocal(), MustAllocate(), MustAllocateInContext(), NULL, v8::internal::Variable::PARAMETER, params_, v8::internal::Variable::scope(), v8::internal::SLOPPY, and strict_mode().
Referenced by AllocateVariablesRecursively().
|
protected |
Definition at line 1233 of file scopes.cc.
References v8::internal::Variable::AllocateTo(), v8::internal::Variable::LOCAL, and num_stack_slots_.
Referenced by AllocateNonParameterLocal().
|
protected |
Definition at line 636 of file scopes.cc.
References AllocateModulesRecursively(), AllocateVariablesRecursively(), calls_sloppy_eval(), DCHECK, is_global_scope(), is_module_scope(), NULL, num_modules_, outer_scope_, outer_scope_calls_sloppy_eval(), PropagateScopeInfo(), and ResolveVariablesRecursively().
Referenced by Analyze().
|
protected |
Definition at line 1346 of file scopes.cc.
References AllocateNonParameterLocals(), AllocateParameterLocals(), already_resolved(), calls_eval(), DCHECK, inner_scopes_, is_function_scope(), is_module_scope(), is_with_scope(), v8::internal::Context::MIN_CONTEXT_SLOTS, num_heap_slots_, and num_stack_slots_.
Referenced by AllocateVariables().
bool v8::internal::Scope::AllowsLazyCompilation | ( | ) | const |
Definition at line 705 of file scopes.cc.
References force_eager_compilation_, and HasLazyCompilableOuterContext().
Referenced by v8::internal::CompilationInfo::ShouldSelfOptimize().
bool v8::internal::Scope::AllowsLazyCompilationWithoutContext | ( | ) | const |
Definition at line 710 of file scopes.cc.
References force_eager_compilation_, and HasTrivialOuterContext().
|
inlineprotected |
Definition at line 506 of file scopes.h.
References already_resolved_.
Referenced by AllocateModulesRecursively(), AllocateVariablesRecursively(), Analyze(), DeclareLocal(), DeclareParameter(), ForceContextAllocation(), Initialize(), LookupRecursive(), NewInternal(), NewTemporary(), and NewUnresolved().
|
static |
Definition at line 260 of file scopes.cc.
References AllocateVariables(), already_resolved(), v8::internal::CompilationInfo::ast_node_id_gen(), v8::internal::CompilationInfo::ast_value_factory(), v8::internal::Isolate::bootstrapper(), DCHECK, v8::internal::CompilationInfo::function(), interface(), is_global_scope(), v8::internal::CompilationInfo::isolate(), NULL, outer_scope(), v8::internal::CompilationInfo::PrepareForCompilation(), v8::internal::PrintF(), and v8::internal::CompilationInfo::zone().
Referenced by v8::internal::CompileOptimizedPrologue(), v8::internal::CompileUnoptimizedCode(), v8::internal::compiler::Parse(), v8::internal::ScopeIterator::ScopeIterator(), and v8::internal::HOptimizedGraphBuilder::TryInline().
|
inline |
Definition at line 324 of file scopes.h.
References arguments_.
Referenced by AllocateParameterLocals(), v8::internal::compiler::AstGraphBuilder::CreateGraph(), v8::internal::HOptimizedGraphBuilder::SetUpScope(), and v8::internal::compiler::JSInliner::TryInlineCall().
|
inline |
Definition at line 288 of file scopes.h.
References asm_function_.
Referenced by v8::internal::ScopeInfo::Create().
|
inline |
Definition at line 287 of file scopes.h.
References asm_module_.
Referenced by v8::internal::ScopeInfo::Create().
|
inline |
Definition at line 280 of file scopes.h.
References scope_calls_eval_.
Referenced by AllocateVariablesRecursively(), v8::internal::HOptimizedGraphBuilder::BuildGraph(), and v8::internal::ScopeInfo::Create().
|
inline |
Definition at line 281 of file scopes.h.
References scope_calls_eval_, v8::internal::SLOPPY, and strict_mode_.
Referenced by AllocateVariables(), LookupRecursive(), and PropagateScopeInfo().
Declaration * v8::internal::Scope::CheckConflictingVarDeclarations | ( | ) |
Definition at line 545 of file scopes.cc.
References decls_, is_declaration_scope(), v8::internal::VariableMap::Lookup(), v8::internal::Declaration::mode(), v8::internal::Variable::mode(), name, NULL, outer_scope_, v8::internal::Declaration::proxy(), v8::internal::Declaration::scope(), v8::internal::VAR, and variables_.
Referenced by v8::internal::Parser::CheckConflictingVarDeclarations().
void v8::internal::Scope::CollectStackAndContextLocals | ( | ZoneList< Variable * > * | stack_locals, |
ZoneList< Variable * > * | context_locals | ||
) |
Definition at line 584 of file scopes.cc.
References v8::internal::List< T, AllocationPolicy >::Add(), v8::internal::VarAndOrder::Compare(), DCHECK, has_forced_context_allocation(), internals_, v8::internal::Variable::is_used(), v8::internal::Variable::IsContextSlot(), v8::internal::Variable::IsStackLocal(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Next(), NULL, v8::internal::TemplateHashMapImpl< AllocationPolicy >::occupancy(), v8::internal::List< T, AllocationPolicy >::Sort(), v8::internal::TemplateHashMapImpl< AllocationPolicy >::Start(), temps_, variables_, and zone().
Referenced by v8::internal::ScopeInfo::Create(), v8::internal::AstTyper::ObserveTypesAtOsrEntry(), and v8::internal::FunctionInfoListener::SerializeFunctionScope().
|
inline |
Definition at line 293 of file scopes.h.
References scope_contains_with_.
Referenced by DeserializeScopeChain().
Definition at line 715 of file scopes.cc.
References DCHECK, NULL, and outer_scope_.
Referenced by v8::internal::HOptimizedGraphBuilder::BuildContextChainWalk(), v8::internal::compiler::AstGraphBuilder::BuildVariableAssignment(), and v8::internal::compiler::AstGraphBuilder::BuildVariableLoad().
int v8::internal::Scope::ContextLocalCount | ( | ) | const |
Definition at line 1405 of file scopes.cc.
References function_, v8::internal::Context::MIN_CONTEXT_SLOTS, NULL, and num_heap_slots().
Referenced by v8::internal::ScopeInfo::Create(), v8::internal::AstTyper::ObserveTypesAtOsrEntry(), and v8::internal::FunctionInfoListener::SerializeFunctionScope().
|
inline |
Definition at line 327 of file scopes.h.
References decls_.
Referenced by v8::internal::FullCodeGenerator::AllocateModules(), v8::internal::HOptimizedGraphBuilder::BuildGraph(), v8::internal::compiler::AstGraphBuilder::CreateGraph(), v8::internal::AstTyper::Run(), and v8::internal::HOptimizedGraphBuilder::TryInline().
Scope * v8::internal::Scope::DeclarationScope | ( | ) |
Definition at line 737 of file scopes.cc.
References is_declaration_scope(), and outer_scope().
Referenced by v8::internal::ParserTraits::CheckFunctionLiteralInsideTopLevelObjectLiteral(), v8::internal::ParserTraits::CheckPossibleEvalCall(), HasLazyCompilableOuterContext(), and v8::internal::Parser::ParseFunctionLiteral().
Variable * v8::internal::Scope::DeclareDynamicGlobal | ( | const AstRawString * | name | ) |
Definition at line 476 of file scopes.cc.
References DCHECK, v8::internal::VariableMap::Declare(), v8::internal::DYNAMIC_GLOBAL, is_global_scope(), v8::internal::kCreatedInitialized, name, v8::internal::Variable::NORMAL, and variables_.
Referenced by ResolveVariable().
|
inline |
Definition at line 120 of file scopes.h.
References DCHECK, function_, and is_function_scope().
Referenced by LookupFunctionVar().
Variable * v8::internal::Scope::DeclareLocal | ( | const AstRawString * | name, |
VariableMode | mode, | ||
InitializationFlag | init_flag, | ||
MaybeAssignedFlag | maybe_assigned_flag = kNotAssigned , |
||
Interface * | interface = Interface::NewValue() |
||
) |
Definition at line 461 of file scopes.cc.
References already_resolved(), DCHECK, v8::internal::VariableMap::Declare(), interface(), v8::internal::IsDeclaredVariableMode(), mode(), name, v8::internal::Variable::NORMAL, num_var_or_const_, and variables_.
Referenced by v8::internal::Parser::Declare(), and v8::internal::Parser::ParseTryStatement().
Variable * v8::internal::Scope::DeclareParameter | ( | const AstRawString * | name, |
VariableMode | mode | ||
) |
Definition at line 451 of file scopes.cc.
References already_resolved(), DCHECK, v8::internal::VariableMap::Declare(), is_function_scope(), v8::internal::kCreatedInitialized, mode(), name, v8::internal::Variable::NORMAL, params_, variables_, and zone().
Referenced by v8::internal::CheckAndDeclareArrowParameter().
|
static |
Definition at line 187 of file scopes.cc.
References AddInnerScope(), asm_function_, asm_module_, ast_value_factory_, v8::internal::BLOCK_SCOPE, v8::internal::Context::closure(), contains_with(), DCHECK, v8::internal::Context::extension(), v8::internal::FUNCTION_SCOPE, v8::internal::AstValueFactory::GetString(), v8::internal::GLOBAL_SCOPE, v8::internal::ScopeInfo::IsAsmFunction(), v8::internal::ScopeInfo::IsAsmModule(), v8::internal::Context::IsBlockContext(), v8::internal::Context::IsCatchContext(), v8::internal::Context::IsFunctionContext(), v8::internal::Context::IsGlobalContext(), v8::internal::Context::IsModuleContext(), v8::internal::Context::IsNativeContext(), v8::internal::Context::IsWithContext(), v8::internal::Context::module(), v8::internal::MODULE_SCOPE, name, NULL, v8::internal::Context::previous(), PropagateScopeInfo(), RecordWithStatement(), Scope(), v8::internal::WITH_SCOPE, and zone().
Referenced by v8::internal::Parser::DoParseProgram(), and v8::internal::Parser::ParseLazy().
|
inline |
Definition at line 246 of file scopes.h.
References end_position_.
Referenced by GetNestedScopeChain(), and v8::internal::Parser::ParseFunctionLiteral().
Scope * v8::internal::Scope::FinalizeBlockScope | ( | ) |
Definition at line 345 of file scopes.cc.
References v8::internal::List< T, AllocationPolicy >::Add(), AddInnerScope(), DCHECK, inner_scopes_, internals_, is_block_scope(), NULL, num_var_or_const(), outer_scope(), outer_scope_, params_, temps_, unresolved_, and zone().
Referenced by v8::internal::Parser::ParseForStatement(), and v8::internal::Parser::ParseScopedBlock().
|
inline |
Definition at line 252 of file scopes.h.
References already_resolved(), DCHECK, and force_context_allocation_.
|
inline |
Definition at line 364 of file scopes.h.
References force_eager_compilation_.
Referenced by v8::internal::Parser::ParseNativeDeclaration().
|
inline |
Definition at line 309 of file scopes.h.
References DCHECK, function_, and is_function_scope().
Referenced by v8::internal::HOptimizedGraphBuilder::BuildGraph(), v8::internal::ScopeInfo::Create(), v8::internal::compiler::AstGraphBuilder::CreateGraph(), and v8::internal::AstTyper::Run().
void v8::internal::Scope::GetNestedScopeChain | ( | List< Handle< ScopeInfo > > * | chain, |
int | statement_position | ||
) |
Definition at line 754 of file scopes.cc.
References DCHECK, end_position(), GetNestedScopeChain(), GetScopeInfo(), inner_scopes_, is_eval_scope(), and start_position().
Referenced by GetNestedScopeChain(), and v8::internal::ScopeIterator::RetrieveScopeChain().
Definition at line 746 of file scopes.cc.
References v8::internal::ScopeInfo::Create(), scope_info_, and zone().
Referenced by v8::internal::FullCodeGenerator::AllocateModules(), and GetNestedScopeChain().
Scope * v8::internal::Scope::GlobalScope | ( | ) |
Definition at line 728 of file scopes.cc.
References is_global_scope(), and outer_scope().
|
inline |
Definition at line 256 of file scopes.h.
References force_context_allocation_.
Referenced by AllocateParameterLocals(), CollectStackAndContextLocals(), MustAllocateInContext(), and SetDefaults().
|
protected |
Definition at line 1222 of file scopes.cc.
References v8::internal::Isolate::factory(), isolate_, name, and params_.
Referenced by AllocateParameterLocals().
|
inline |
Definition at line 198 of file scopes.h.
References illegal_redecl_, and NULL.
Referenced by v8::internal::HOptimizedGraphBuilder::BuildGraph(), v8::internal::OptimizedCompileJob::CreateGraph(), Scope(), SetIllegalRedeclaration(), and VisitIllegalRedeclaration().
bool v8::internal::Scope::HasLazyCompilableOuterContext | ( | ) | const |
Definition at line 687 of file scopes.cc.
References DeclarationScope(), NULL, and outer_scope_.
Referenced by AllowsLazyCompilation().
|
protected |
Definition at line 663 of file scopes.cc.
References NULL.
Referenced by HasTrivialOuterContext().
bool v8::internal::Scope::HasTrivialOuterContext | ( | ) | const |
Definition at line 677 of file scopes.cc.
References HasTrivialContext(), NULL, outer_scope_, and scope_inside_with_.
Referenced by AllowsLazyCompilationWithoutContext().
void v8::internal::Scope::Initialize | ( | ) |
Definition at line 297 of file scopes.cc.
References v8::internal::Variable::AllocateTo(), already_resolved(), v8::internal::Variable::ARGUMENTS, ast_value_factory_, DCHECK, v8::internal::VariableMap::Declare(), inner_scopes_, is_declaration_scope(), is_function_scope(), is_with_scope(), v8::internal::kCreatedInitialized, NULL, outer_scope(), outer_scope_, v8::internal::Variable::PARAMETER, receiver(), receiver_, scope_inside_with_, v8::internal::Variable::THIS, v8::internal::VAR, variables_, and zone().
Referenced by v8::internal::Parser::DesugarLetBindingsInForStatement(), and v8::internal::Parser::NewScope().
|
inline |
|
inline |
Definition at line 336 of file scopes.h.
References interface_.
Referenced by v8::internal::FullCodeGenerator::AllocateModules(), Analyze(), DeclareLocal(), NewUnresolved(), and v8::internal::Parser::ParseModuleUrl().
|
inline |
Definition at line 269 of file scopes.h.
References v8::internal::BLOCK_SCOPE, and scope_type_.
Referenced by v8::internal::Parser::Declare(), FinalizeBlockScope(), MustAllocate(), and MustAllocateInContext().
|
inline |
Definition at line 268 of file scopes.h.
References v8::internal::CATCH_SCOPE, and scope_type_.
Referenced by MustAllocate(), and MustAllocateInContext().
|
inline |
Definition at line 271 of file scopes.h.
References is_eval_scope(), is_function_scope(), is_global_scope(), and is_module_scope().
Referenced by CheckConflictingVarDeclarations(), DeclarationScope(), and Initialize().
|
inline |
Definition at line 264 of file scopes.h.
References v8::internal::EVAL_SCOPE, and scope_type_.
Referenced by v8::internal::Parser::Declare(), GetNestedScopeChain(), is_declaration_scope(), is_strict_eval_scope(), v8::internal::Parser::ParseReturnStatement(), and v8::internal::Rewriter::Rewrite().
|
inline |
Definition at line 265 of file scopes.h.
References v8::internal::FUNCTION_SCOPE, and scope_type_.
Referenced by AllocateParameterLocals(), AllocateVariablesRecursively(), v8::internal::HOptimizedGraphBuilder::BuildGraph(), v8::internal::ScopeInfo::Create(), v8::internal::compiler::AstGraphBuilder::CreateGraph(), v8::internal::Parser::Declare(), DeclareFunctionVar(), DeclareParameter(), function(), Initialize(), is_declaration_scope(), LookupRecursive(), parameter(), v8::internal::AstTyper::Run(), and SetDefaults().
|
inline |
Definition at line 267 of file scopes.h.
References v8::internal::GLOBAL_SCOPE, and scope_type_.
Referenced by v8::internal::FullCodeGenerator::AllocateModules(), AllocateVariables(), Analyze(), v8::internal::ParserTraits::CheckFunctionLiteralInsideTopLevelObjectLiteral(), v8::internal::Parser::Declare(), DeclareDynamicGlobal(), GlobalScope(), is_declaration_scope(), v8::internal::Variable::IsGlobalObjectProperty(), LookupRecursive(), MustAllocate(), MustAllocateInContext(), v8::internal::Parser::ParseReturnStatement(), v8::internal::Parser::ParseVariableDeclarations(), RecordEvalCall(), ResolveVariable(), ResolveVariablesRecursively(), v8::internal::Rewriter::Rewrite(), and v8::internal::FullCodeGenerator::VisitDeclarations().
|
inline |
Definition at line 266 of file scopes.h.
References v8::internal::MODULE_SCOPE, and scope_type_.
Referenced by AllocateModulesRecursively(), AllocateVariables(), AllocateVariablesRecursively(), v8::internal::Parser::Declare(), is_declaration_scope(), MustAllocate(), and MustAllocateInContext().
|
inline |
Definition at line 275 of file scopes.h.
References is_eval_scope(), v8::internal::STRICT, and strict_mode_.
Referenced by v8::internal::Parser::Declare().
|
inline |
Definition at line 270 of file scopes.h.
References scope_type_, and v8::internal::WITH_SCOPE.
Referenced by AllocateVariablesRecursively(), Initialize(), and LookupRecursive().
|
inline |
Definition at line 399 of file scopes.h.
References v8::internal::VariableMap::Lookup(), name, NULL, and variables_.
Referenced by v8::internal::CheckAndDeclareArrowParameter().
Variable * v8::internal::Scope::Lookup | ( | const AstRawString * | name | ) |
Definition at line 440 of file scopes.cc.
Referenced by v8::internal::Parser::Declare().
Variable * v8::internal::Scope::LookupFunctionVar | ( | const AstRawString * | name, |
AstNodeFactory< AstNullVisitor > * | factory | ||
) |
Definition at line 416 of file scopes.cc.
References v8::internal::Variable::AllocateTo(), v8::internal::Variable::CONTEXT, DeclareFunctionVar(), function_, v8::internal::kCreatedInitialized, v8::internal::RelocInfo::kNoPosition, mode(), name, v8::internal::Variable::NORMAL, NULL, scope_info_, and zone().
Referenced by LookupRecursive().
Variable * v8::internal::Scope::LookupLocal | ( | const AstRawString * | name | ) |
Definition at line 375 of file scopes.cc.
References v8::internal::Variable::AllocateTo(), v8::internal::Variable::CONTEXT, v8::internal::ScopeInfo::ContextSlotIndex(), DCHECK, v8::internal::VariableMap::Declare(), v8::internal::DYNAMIC, v8::internal::kCreatedInitialized, v8::internal::kMaybeAssigned, v8::internal::VariableMap::Lookup(), v8::internal::Variable::LOOKUP, mode(), name, v8::internal::Variable::NORMAL, NULL, scope_info_, and variables_.
Referenced by AllocateParameterLocals(), v8::internal::ModuleInfo::Create(), v8::internal::Parser::Declare(), LookupRecursive(), and v8::internal::Parser::ParseModuleLiteral().
|
protected |
Definition at line 963 of file scopes.cc.
References already_resolved(), BOUND, BOUND_EVAL_SHADOWED, calls_sloppy_eval(), DCHECK, DYNAMIC_LOOKUP, v8::internal::Variable::ForceContextAllocation(), is_function_scope(), is_global_scope(), is_with_scope(), LookupFunctionVar(), LookupLocal(), LookupRecursive(), NULL, outer_scope_, v8::internal::Variable::set_maybe_assigned(), UNBOUND, and UNBOUND_EVAL_SHADOWED.
Referenced by LookupRecursive(), and ResolveVariable().
|
inline |
Definition at line 361 of file scopes.h.
References module_var_.
Referenced by v8::internal::FullCodeGenerator::AllocateModules().
Definition at line 1179 of file scopes.cc.
References v8::internal::Variable::has_forced_context_allocation(), inner_scope_calls_eval_, is_block_scope(), is_catch_scope(), is_global_scope(), is_module_scope(), v8::internal::Variable::is_this(), v8::internal::Variable::is_used(), v8::internal::AstString::IsEmpty(), v8::internal::Variable::IsGlobalObjectProperty(), v8::internal::Variable::raw_name(), scope_calls_eval_, scope_contains_with_, v8::internal::Variable::set_is_used(), and v8::internal::Variable::set_maybe_assigned().
Referenced by AllocateNonParameterLocal(), and AllocateParameterLocals().
Definition at line 1200 of file scopes.cc.
References has_forced_context_allocation(), v8::internal::Variable::has_forced_context_allocation(), inner_scope_calls_eval_, v8::internal::INTERNAL, is_block_scope(), is_catch_scope(), is_global_scope(), is_module_scope(), v8::internal::IsLexicalVariableMode(), v8::internal::Variable::mode(), scope_calls_eval_, scope_contains_with_, and v8::internal::TEMPORARY.
Referenced by AllocateNonParameterLocal(), and AllocateParameterLocals().
Variable * v8::internal::Scope::NewInternal | ( | const AstRawString * | name | ) |
Definition at line 499 of file scopes.cc.
References already_resolved(), DCHECK, v8::internal::INTERNAL, internals_, v8::internal::kCreatedInitialized, name, v8::internal::Variable::NORMAL, and zone().
Referenced by AllocateModulesRecursively().
Variable * v8::internal::Scope::NewTemporary | ( | const AstRawString * | name | ) |
Definition at line 512 of file scopes.cc.
References already_resolved(), DCHECK, v8::internal::kCreatedInitialized, name, v8::internal::Variable::NORMAL, v8::internal::TEMPORARY, temps_, and zone().
Referenced by v8::internal::Rewriter::Rewrite().
|
inline |
Definition at line 145 of file scopes.h.
References v8::internal::List< T, AllocationPolicy >::Add(), already_resolved(), DCHECK, interface(), name, unresolved_, and zone_.
Referenced by v8::internal::ParserTraits::ExpressionFromIdentifier(), v8::internal::Parser::NewUnresolved(), and v8::internal::Parser::ParseVariableDeclarations().
|
protected |
Definition at line 942 of file scopes.cc.
References v8::internal::Variable::AllocateTo(), dynamics_, v8::internal::DynamicScopePart::GetMap(), v8::internal::kCreatedInitialized, v8::internal::kNeedsInitialization, v8::internal::Variable::LOOKUP, map, mode(), name, v8::internal::Variable::NORMAL, NULL, v8::internal::VAR, and zone().
Referenced by ResolveVariable().
|
inline |
Definition at line 352 of file scopes.h.
References num_heap_slots_.
Referenced by ContextLocalCount(), v8::internal::ScopeInfo::Create(), v8::internal::CompilationInfo::num_heap_slots(), and v8::internal::HOptimizedGraphBuilder::TryInline().
|
inline |
Definition at line 358 of file scopes.h.
References num_modules_.
Referenced by v8::internal::FullCodeGenerator::VisitDeclarations().
|
inline |
Definition at line 321 of file scopes.h.
References params_.
Referenced by v8::internal::compiler::AstGraphBuilder::BuildLocalFunctionContext(), v8::internal::ScopeInfo::Create(), v8::internal::OptimizedCompileJob::CreateGraph(), v8::internal::compiler::AstGraphBuilder::Environment::Environment(), v8::internal::LCodeGen::GeneratePrologue(), v8::internal::HOptimizedGraphBuilder::HandleCompoundAssignment(), v8::internal::CompilationInfo::num_parameters(), v8::internal::AstTyper::ObserveTypesAtOsrEntry(), and v8::internal::HOptimizedGraphBuilder::SetUpScope().
|
inline |
Definition at line 351 of file scopes.h.
References num_stack_slots_.
Referenced by v8::internal::ScopeInfo::Create(), v8::internal::OptimizedCompileJob::CreateGraph(), and StackLocalCount().
|
inline |
Definition at line 348 of file scopes.h.
References num_var_or_const_.
Referenced by FinalizeBlockScope().
|
inline |
Definition at line 333 of file scopes.h.
References outer_scope_.
Referenced by Analyze(), DeclarationScope(), FinalizeBlockScope(), GlobalScope(), Initialize(), Scope(), v8::internal::FunctionInfoListener::SerializeFunctionScope(), and SetDefaults().
|
inline |
Definition at line 284 of file scopes.h.
References outer_scope_calls_sloppy_eval_.
Referenced by AllocateVariables(), and PropagateScopeInfo().
Definition at line 316 of file scopes.h.
References DCHECK, is_function_scope(), and params_.
Referenced by v8::internal::compiler::AstGraphBuilder::BuildLocalFunctionContext(), v8::internal::ScopeInfo::Create(), v8::internal::LCodeGen::GeneratePrologue(), and v8::internal::AstTyper::ObserveTypesAtOsrEntry().
|
protected |
Definition at line 1156 of file scopes.cc.
References asm_function_, asm_module_, calls_sloppy_eval(), force_eager_compilation_, v8::internal::FUNCTION_SCOPE, inner_scope_calls_eval_, inner_scopes_, outer_scope_calls_sloppy_eval(), outer_scope_calls_sloppy_eval_, PropagateScopeInfo(), scope_calls_eval_, and scope_type().
Referenced by AllocateVariables(), DeserializeScopeChain(), and PropagateScopeInfo().
|
inline |
Definition at line 305 of file scopes.h.
References receiver_.
Referenced by Initialize(), v8::internal::AstTyper::ObserveTypesAtOsrEntry(), and v8::internal::ParserTraits::ThisExpression().
|
inline |
Definition at line 212 of file scopes.h.
References is_global_scope(), and scope_calls_eval_.
Referenced by v8::internal::ParserTraits::CheckPossibleEvalCall().
|
inline |
Definition at line 209 of file scopes.h.
References scope_contains_with_.
Referenced by DeserializeScopeChain().
void v8::internal::Scope::RemoveUnresolved | ( | VariableProxy * | var | ) |
Definition at line 487 of file scopes.cc.
References v8::internal::List< T, AllocationPolicy >::Remove(), and unresolved_.
|
protected |
Definition at line 1027 of file scopes.cc.
References BOUND, BOUND_EVAL_SHADOWED, DCHECK, DeclareDynamicGlobal(), v8::internal::DYNAMIC, v8::internal::DYNAMIC_GLOBAL, v8::internal::DYNAMIC_LOCAL, DYNAMIC_LOOKUP, v8::internal::Isolate::factory(), v8::internal::CompilationInfo::global_scope(), v8::internal::Variable::interface(), v8::internal::Variable::is_const_mode(), v8::internal::Variable::is_dynamic(), is_global_scope(), v8::internal::Variable::IsGlobalObjectProperty(), v8::internal::CompilationInfo::isolate(), v8::internal::AstRawString::length(), LookupRecursive(), v8::internal::Variable::name(), NONE, NonLocal(), NULL, v8::internal::PrintF(), v8::internal::AstRawString::raw_data(), v8::internal::Variable::raw_name(), v8::internal::CompilationInfo::script(), v8::internal::Variable::set_local_if_not_shadowed(), v8::internal::Variable::set_maybe_assigned(), v8::internal::JSObject::SetElement(), v8::internal::STRICT, strict_mode(), v8::internal::Isolate::Throw(), UNBOUND, UNBOUND_EVAL_SHADOWED, and zone().
Referenced by ResolveVariablesRecursively().
|
protected |
Definition at line 1136 of file scopes.cc.
References DCHECK, v8::internal::CompilationInfo::global_scope(), inner_scopes_, is_global_scope(), ResolveVariable(), and unresolved_.
Referenced by AllocateVariables().
|
inline |
Definition at line 299 of file scopes.h.
References scope_type_.
Referenced by v8::internal::ScopeInfo::Create(), PropagateScopeInfo(), Scope(), and SetDefaults().
|
inline |
Definition at line 247 of file scopes.h.
References end_position_.
Referenced by v8::internal::Parser::DesugarLetBindingsInForStatement(), v8::internal::Parser::ParseForStatement(), v8::internal::Parser::ParseModuleLiteral(), v8::internal::Parser::ParseOnBackground(), v8::internal::Parser::ParseProgram(), v8::internal::Parser::ParseScopedBlock(), v8::internal::Parser::ParseSourceElements(), v8::internal::Parser::ParseTryStatement(), and v8::internal::Parser::ParseWithStatement().
|
inline |
Definition at line 243 of file scopes.h.
References start_position_.
Referenced by v8::internal::Parser::ParseForStatement(), v8::internal::Parser::ParseFunctionLiteral(), v8::internal::Parser::ParseModuleLiteral(), v8::internal::Parser::ParseScopedBlock(), v8::internal::Parser::ParseSourceElements(), v8::internal::Parser::ParseTryStatement(), and v8::internal::Parser::ParseWithStatement().
|
inline |
|
private |
Definition at line 149 of file scopes.cc.
References arguments_, asm_function_, asm_module_, ast_value_factory_, dynamics_, end_position_, force_context_allocation_, force_eager_compilation_, function_, has_forced_context_allocation(), illegal_redecl_, inner_scope_calls_eval_, is_function_scope(), v8::internal::Handle< T >::is_null(), v8::internal::RelocInfo::kNoPosition, module_var_, NULL, num_heap_slots_, num_modules_, num_stack_slots_, num_var_or_const_, outer_scope(), outer_scope_, outer_scope_calls_sloppy_eval_, receiver_, scope_calls_eval_, scope_contains_with_, scope_info_, scope_inside_with_, scope_name_, scope_type(), scope_type_, v8::internal::SLOPPY, start_position_, and strict_mode_.
Referenced by Scope().
void v8::internal::Scope::SetIllegalRedeclaration | ( | Expression * | expression | ) |
Definition at line 530 of file scopes.cc.
References DCHECK, HasIllegalRedeclaration(), and illegal_redecl_.
Referenced by v8::internal::Parser::Declare().
|
inline |
Definition at line 87 of file scopes.h.
References scope_name_.
|
inline |
Definition at line 215 of file scopes.h.
References strict_mode(), and strict_mode_.
Referenced by v8::internal::Parser::ParseLazy(), and v8::internal::Parser::ParseModuleLiteral().
int v8::internal::Scope::StackLocalCount | ( | ) | const |
Definition at line 1399 of file scopes.cc.
References function_, NULL, and num_stack_slots().
Referenced by v8::internal::ScopeInfo::Create(), v8::internal::AstTyper::ObserveTypesAtOsrEntry(), and v8::internal::FunctionInfoListener::SerializeFunctionScope().
|
inline |
Definition at line 242 of file scopes.h.
References start_position_.
Referenced by GetNestedScopeChain(), and v8::internal::Parser::ParseFunctionLiteral().
|
inline |
Definition at line 302 of file scopes.h.
References strict_mode_.
Referenced by AllocateParameterLocals(), v8::internal::ScopeInfo::Create(), v8::internal::Parser::Declare(), v8::internal::Parser::ParseFunctionLiteral(), v8::internal::Parser::ParseLazy(), v8::internal::Parser::ParseVariableDeclarations(), ResolveVariable(), and SetStrictMode().
void v8::internal::Scope::VisitIllegalRedeclaration | ( | AstVisitor * | visitor | ) |
Definition at line 539 of file scopes.cc.
References v8::internal::AstNode::Accept(), DCHECK, HasIllegalRedeclaration(), and illegal_redecl_.
|
inline |
Definition at line 98 of file scopes.h.
References zone_.
Referenced by AddDeclaration(), AllocateNonParameterLocals(), CollectStackAndContextLocals(), DeclareParameter(), DeserializeScopeChain(), FinalizeBlockScope(), GetScopeInfo(), Initialize(), LookupFunctionVar(), NewInternal(), NewTemporary(), NonLocal(), and ResolveVariable().
|
protected |
Definition at line 489 of file scopes.h.
Referenced by already_resolved().
|
protected |
Definition at line 455 of file scopes.h.
Referenced by AllocateParameterLocals(), arguments(), and SetDefaults().
|
protected |
Definition at line 474 of file scopes.h.
Referenced by asm_function(), DeserializeScopeChain(), PropagateScopeInfo(), and SetDefaults().
|
protected |
Definition at line 472 of file scopes.h.
Referenced by asm_module(), DeserializeScopeChain(), PropagateScopeInfo(), SetAsmModule(), and SetDefaults().
|
private |
Definition at line 623 of file scopes.h.
Referenced by AllocateModulesRecursively(), AllocateParameterLocals(), DeserializeScopeChain(), Initialize(), and SetDefaults().
|
protected |
Definition at line 449 of file scopes.h.
Referenced by AddDeclaration(), CheckConflictingVarDeclarations(), and declarations().
|
protected |
Definition at line 445 of file scopes.h.
Referenced by NonLocal(), and SetDefaults().
|
protected |
Definition at line 479 of file scopes.h.
Referenced by end_position(), set_end_position(), and SetDefaults().
|
protected |
Definition at line 485 of file scopes.h.
Referenced by ForceContextAllocation(), has_forced_context_allocation(), and SetDefaults().
|
protected |
Definition at line 484 of file scopes.h.
Referenced by AllowsLazyCompilation(), AllowsLazyCompilationWithoutContext(), ForceEagerCompilation(), PropagateScopeInfo(), and SetDefaults().
|
protected |
Definition at line 453 of file scopes.h.
Referenced by AllocateNonParameterLocals(), ContextLocalCount(), DeclareFunctionVar(), function(), LookupFunctionVar(), SetDefaults(), and StackLocalCount().
|
protected |
Definition at line 460 of file scopes.h.
Referenced by HasIllegalRedeclaration(), SetDefaults(), SetIllegalRedeclaration(), and VisitIllegalRedeclaration().
|
protected |
Definition at line 483 of file scopes.h.
Referenced by MustAllocate(), MustAllocateInContext(), PropagateScopeInfo(), and SetDefaults().
Definition at line 424 of file scopes.h.
Referenced by AddInnerScope(), AllocateModulesRecursively(), AllocateVariablesRecursively(), FinalizeBlockScope(), GetNestedScopeChain(), Initialize(), inner_scopes(), PropagateScopeInfo(), and ResolveVariablesRecursively().
|
protected |
Definition at line 457 of file scopes.h.
Referenced by AllocateModulesRecursively(), and interface().
Definition at line 439 of file scopes.h.
Referenced by AllocateNonParameterLocals(), CollectStackAndContextLocals(), FinalizeBlockScope(), and NewInternal().
|
protected |
Definition at line 420 of file scopes.h.
Referenced by AllocateNonParameterLocal(), and HasArgumentsParameter().
|
protected |
Definition at line 502 of file scopes.h.
Referenced by AllocateModulesRecursively(), module_var(), and SetDefaults().
|
protected |
Definition at line 496 of file scopes.h.
Referenced by AllocateHeapSlot(), AllocateVariablesRecursively(), num_heap_slots(), Scope(), and SetDefaults().
|
protected |
Definition at line 499 of file scopes.h.
Referenced by AllocateModulesRecursively(), AllocateVariables(), num_modules(), and SetDefaults().
|
protected |
Definition at line 495 of file scopes.h.
Referenced by AllocateStackSlot(), AllocateVariablesRecursively(), num_stack_slots(), and SetDefaults().
|
protected |
Definition at line 492 of file scopes.h.
Referenced by DeclareLocal(), num_var_or_const(), Scope(), and SetDefaults().
|
protected |
Definition at line 423 of file scopes.h.
Referenced by AddInnerScope(), AllocateVariables(), CheckConflictingVarDeclarations(), ContextChainLength(), FinalizeBlockScope(), HasLazyCompilableOuterContext(), HasTrivialOuterContext(), Initialize(), LookupRecursive(), outer_scope(), and SetDefaults().
|
protected |
Definition at line 482 of file scopes.h.
Referenced by outer_scope_calls_sloppy_eval(), PropagateScopeInfo(), and SetDefaults().
Definition at line 443 of file scopes.h.
Referenced by AllocateParameterLocals(), DeclareParameter(), FinalizeBlockScope(), HasArgumentsParameter(), num_parameters(), and parameter().
|
protected |
Definition at line 451 of file scopes.h.
Referenced by Initialize(), receiver(), and SetDefaults().
|
protected |
Definition at line 470 of file scopes.h.
Referenced by calls_eval(), calls_sloppy_eval(), MustAllocate(), MustAllocateInContext(), PropagateScopeInfo(), RecordEvalCall(), and SetDefaults().
|
protected |
Definition at line 467 of file scopes.h.
Referenced by contains_with(), MustAllocate(), MustAllocateInContext(), RecordWithStatement(), and SetDefaults().
Definition at line 505 of file scopes.h.
Referenced by GetScopeInfo(), LookupFunctionVar(), LookupLocal(), Scope(), and SetDefaults().
|
protected |
Definition at line 465 of file scopes.h.
Referenced by HasTrivialOuterContext(), Initialize(), inside_with(), and SetDefaults().
|
protected |
Definition at line 430 of file scopes.h.
Referenced by SetDefaults(), and SetScopeName().
|
protected |
Definition at line 427 of file scopes.h.
Referenced by is_block_scope(), is_catch_scope(), is_eval_scope(), is_function_scope(), is_global_scope(), is_module_scope(), is_with_scope(), scope_type(), and SetDefaults().
|
protected |
Definition at line 478 of file scopes.h.
Referenced by set_start_position(), SetDefaults(), and start_position().
|
protected |
Definition at line 476 of file scopes.h.
Referenced by calls_sloppy_eval(), is_strict_eval_scope(), SetDefaults(), SetStrictMode(), and strict_mode().
Definition at line 441 of file scopes.h.
Referenced by AllocateNonParameterLocals(), CollectStackAndContextLocals(), FinalizeBlockScope(), and NewTemporary().
|
protected |
Definition at line 447 of file scopes.h.
Referenced by FinalizeBlockScope(), NewUnresolved(), RemoveUnresolved(), and ResolveVariablesRecursively().
|
protected |
Definition at line 437 of file scopes.h.
Referenced by AllocateNonParameterLocals(), CheckConflictingVarDeclarations(), CollectStackAndContextLocals(), DeclareDynamicGlobal(), DeclareLocal(), DeclareParameter(), Initialize(), IsDeclared(), LookupLocal(), and Scope().
|
private |
Definition at line 624 of file scopes.h.
Referenced by AddInnerScope(), NewUnresolved(), and zone().