Lines Matching refs:scope

33 Variable* VariableMap::Declare(Scope* scope, const AstRawString* name,
48 Variable(scope, name, mode, is_valid_lhs, kind, initialization_flag,
87 // The outermost scope must be a global scope.
165 // Inherit the strict mode from the parent scope.
189 // Reconstruct the outer scope chain from a closure's context chain.
262 Scope* scope = info->function()->scope();
263 Scope* top = scope;
265 // Traverse the scope tree up to the first unresolved scope or the global
266 // scope and start scope resolution and variable allocation from that scope.
283 scope->Print();
292 info->PrepareForCompilation(scope);
300 // Add this scope as a new inner scope of the outer scope.
309 // Declare and allocate receiver (even for the global scope, and even
311 // NOTE: When loading parameters in the global scope, we must take
353 // Remove this scope from outer scope.
384 // If we have a serialized scope info, we might find the variable there.
421 // If we are backed by a scope info, try to lookup the variable there.
441 for (Scope* scope = this;
442 scope != NULL;
443 scope = scope->outer_scope()) {
444 Variable* var = scope->LookupLocal(name);
552 // Iterate through all scopes until and including the declaration scope.
554 Scope* current = decl->scope();
638 // 1) Propagate scope information.
664 // A function scope has a trivial context if it always is the global
666 // there is anything that makes this scope non-trivial; otherwise we
668 for (const Scope* scope = this; scope != NULL; scope = scope->outer_scope_) {
669 if (scope->is_eval_scope()) return false;
670 if (scope->scope_inside_with_) return false;
671 if (scope->num_heap_slots_ > 0) return false;
681 // scope may be inside a 'with' statement in which case the outer context
682 // for this scope is not trivial.
690 // We have to prevent lazy compilation if this scope is inside a with scope
692 // declaration scopes may become invisible during scope info deserialization.
695 for (const Scope* scope = outer; scope != NULL; scope = scope->outer_scope_) {
696 if (scope->is_with_scope() && !found_non_trivial_declarations) return false;
697 if (scope->is_declaration_scope() && scope->num_heap_slots() > 0) {
715 int Scope::ContextChainLength(Scope* scope) {
717 for (Scope* s = this; s != scope; s = s->outer_scope_) {
718 DCHECK(s != NULL); // scope must be in the scope chain
729 Scope* scope = this;
730 while (!scope->is_global_scope()) {
731 scope = scope->outer_scope();
733 return scope;
738 Scope* scope = this;
739 while (!scope->is_declaration_scope()) {
740 scope = scope->outer_scope();
742 return scope;
760 Scope* scope = inner_scopes_[i];
761 int beg_pos = scope->start_position();
762 int end_pos = scope->end_position();
765 scope->GetNestedScopeChain(chain, position);
880 Indent(n1, "// scope has trivial outer context\n");
883 Indent(n1, "// strict mode scope\n");
885 if (scope_inside_with_) Indent(n1, "// scope inside 'with'\n");
886 if (scope_contains_with_) Indent(n1, "// scope contains 'with'\n");
887 if (scope_calls_eval_) Indent(n1, "// scope calls 'eval'\n");
889 Indent(n1, "// outer scope calls 'eval' in sloppy context\n");
891 if (inner_scope_calls_eval_) Indent(n1, "// inner scope calls 'eval'\n");
968 // Short-cut: if the scope is deserialized from a scope info, variable
974 // Try to find the variable in this scope.
978 // this scope which introduces the same variable again, the resulting
1003 // The current scope is a with scope, so the variable binding can not be
1005 // in the outer scope anyway, because if a binding exists in an outer scope,
1007 // from inside of an inner with scope (the property may not be in the 'with'
1013 // A variable binding may have been found in an outer scope, but the current
1014 // scope makes a sloppy 'eval' call, so the found variable may not be
1047 // scope which was not promoted to a context, this can happen if we use
1066 // No binding has been found. But some scope makes a sloppy 'eval' call.
1141 // Resolve unresolved variables for this scope.
1201 // If var is accessed from an inner scope, or if there is a possibility
1202 // that it might be accessed from the current or an inner scope (through
1206 // Exceptions: If the scope as a whole has forced context allocation, all
1276 DCHECK(var->scope() == this);
1300 DCHECK(var->scope() == this);
1339 // ScopeInfo::ScopeInfo(FunctionScope* scope) constructor).
1352 // If scope is already resolved, we still need to allocate
1359 // Allocate variables for this scope.
1364 // Force allocation of a context for this scope if necessary. For a 'with'
1365 // scope and for a function scope that makes an 'eval' call we need a context,
1366 // even if no local variables were statically allocated in the scope.