Lines Matching refs:scope
51 Variable* Declare(Scope* scope,
61 // The dynamic scope part holds hash maps for the variables that will
63 // are allocated on-demand from Scope::NonLocal to avoid wasting memory
87 class Scope: public ZoneObject {
93 EVAL_SCOPE, // the top-level scope for an 'eval' source
94 FUNCTION_SCOPE, // the top-level scope for a function
95 GLOBAL_SCOPE // the top-level scope for a program or a top-level eval
103 Scope(Scope* outer_scope, Type type);
105 virtual ~Scope() { }
107 // Compute top scope and allocate variables. For lazy compilation the top
108 // scope only contains the single lazily compiled function, so this
112 static Scope* DeserializeScopeChain(CompilationInfo* info,
113 Scope* innermost_scope);
115 // The scope name is only used for printing/debugging.
120 // Called just before leaving a scope.
128 // Lookup a variable in this scope. Returns the variable or NULL if not found.
131 // Lookup a variable in this scope or outer scopes.
136 // is in an intermediate scope between this function scope and the the
137 // outer scope. Only possible for function scopes; at most one variable.
140 // Declare a local variable in this scope. If the variable has been
146 // Declare an implicit global variable in this scope which must be a
147 // global scope. The variable was introduced (possibly from an inner
148 // scope) by a reference to an unresolved variable with no intervening
171 // Creates a new temporary variable in this scope. The name is only used
178 // this scope. The declarations are processed as part of entering
179 // the scope; see codegen.cc:ProcessDeclarations.
185 // Set an expression node that will be executed when the scope is
187 // scope - the first one - so if you try to set it multiple times
192 // scope doesn't have an illegal redeclaration node.
195 // Check if the scope has (at least) one illegal redeclaration.
200 // Scope-specific info.
202 // Inform the scope that the corresponding code contains a with statement.
205 // Inform the scope that the corresponding code contains an eval call.
208 // Enable strict mode for the scope (unless disabled by a global flag).
216 // Specific scope types.
226 // Is this scope inside a with statement.
228 // Does this scope contain a with statement.
231 // The scope immediately surrounding this scope, or NULL.
232 Scope* outer_scope() const { return outer_scope_; }
278 // Collect all used locals in this scope.
299 // Make sure this scope and all outer scopes are eagerly compiled.
302 // Determine if we can use lazy compilation for this scope.
305 // True if the outer context of this scope is always the global context.
308 // The number of contexts between this and scope; zero if this == scope.
309 int ContextChainLength(Scope* scope);
314 // During formal parameter list parsing the scope only contains
334 explicit Scope(Type type);
336 // Scope tree.
337 Scope* outer_scope_; // the immediately enclosing outer scope, or NULL
338 ZoneList<Scope*> inner_scopes_; // the immediately enclosed inner scopes
340 // The scope type.
346 // The variables declared in this scope:
350 // an inner scope) with no intervening with statements or eval calls.
358 // Unresolved variables referred to from this scope.
374 // Scope-specific information.
375 bool scope_inside_with_; // this scope is inside a 'with' of some outer scope
376 bool scope_contains_with_; // this scope contains a 'with' statement
377 bool scope_calls_eval_; // this scope contains an 'eval' call
378 bool strict_mode_; // this scope is a strict mode scope
405 void ResolveVariable(Scope* global_scope,
408 void ResolveVariablesRecursively(Scope* global_scope,
411 // Scope analysis.
430 Scope(Scope* inner_scope, Handle<SerializedScopeInfo> scope_info);
432 void AddInnerScope(Scope* inner_scope) {
440 Scope* outer_scope,
445 // Scope used during pre-parsing.
446 class DummyScope : public Scope {
449 : Scope(GLOBAL_SCOPE),
450 nesting_level_(1), // Allows us to Leave the initial scope.
489 // Number of surrounding scopes of the current scope.
491 // Nesting level of outermost scope that is contained in a with statement,
492 // or kNotInsideWith if there are no with's around the current scope.