Home | History | Annotate | Download | only in src

Lines Matching refs:Variable

17 // A hash map to support fast variable declaration and lookup.
24 Variable* Declare(Scope* scope,
28 Variable::Kind kind,
32 Variable* Lookup(Handle<String> name);
64 // to a JavaScript variable (including global properties) is represented by a
65 // VariableProxy node. Immediately after AST construction and before variable
67 // corresponding variable (though some are bound during parse time). Variable
68 // allocation binds each unresolved VariableProxy to one Variable and assigns
70 // Script variable.
102 // Lookup a variable in this scope. Returns the variable or NULL if not found.
103 Variable* LookupLocal(Handle<String> name);
109 Variable* LookupFunctionVar(Handle<String> name,
112 // Lookup a variable in this scope or outer scopes.
113 // Returns the variable or NULL if not found.
114 Variable* Lookup(Handle<String> name);
116 // Declare the function variable for a function literal. This variable
118 // outer scope. Only possible for function scopes; at most one variable.
129 // Declare a local variable in this scope. If the variable has been
130 // declared before, the previously declared variable is returned.
131 Variable* DeclareLocal(Handle<String> name,
136 // Declare an implicit global variable in this scope which must be a
137 // global scope. The variable was introduced (possibly from an inner
138 // scope) by a reference to an unresolved variable with no intervening
140 Variable* DeclareDynamicGlobal(Handle<String> name);
142 // Create a new unresolved variable.
158 // Remove a unresolved variable. During parsing, an unresolved variable
159 // may have been added optimistically, but then only the variable name
160 // was used (typically for labels). If the variable was not declared, the
161 // addition introduced a new unresolved variable which may end up being
162 // allocated globally as a "ghost" variable. RemoveUnresolved removes
163 // such a variable again if it was added; otherwise this is a no-op.
166 // Creates a new internal variable in this scope. The name is only used
167 // for printing and cannot be used to find the variable. In particular,
168 // the only way to get hold of the temporary is by keeping the Variable*
170 Variable* NewInternal(Handle<String> name);
172 // Creates a new temporary variable in this scope. The name is only used
173 // for printing and cannot be used to find the variable. In particular,
174 // the only way to get hold of the temporary is by keeping the Variable*
175 // around. The name should not clash with a legitimate variable names.
176 Variable* NewTemporary(Handle<String> name);
298 // The variable corresponding the 'this' value.
299 Variable* receiver() { return receiver_; }
301 // The variable holding the function literal for named function
310 Variable* parameter(int index) const {
317 // The local variable 'arguments' if we need to allocate it; NULL otherwise.
318 Variable* arguments() const { return arguments_; }
333 // Variable allocation.
336 // that the function variable - if present - is not collected and should be
338 void CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals,
339 ZoneList<Variable*>* context_locals);
344 // Result of variable allocation.
354 // For module scopes, the host scope's internal variable binding this module.
355 Variable* module_var() const { return module_var_; }
433 ZoneList<Variable*> internals_;
435 ZoneList<Variable*> temps_;
437 ZoneList<Variable*> params_;
444 // Convenience variable.
445 Variable* receiver_;
446 // Function variable, if any; function scopes only.
448 // Convenience variable; function scopes only.
449 Variable* arguments_;
491 // For module scopes, the host scope's internal variable binding this module.
492 Variable* module_var_;
498 // Create a non-local variable with a given name.
500 Variable* NonLocal(Handle<String> name, VariableMode mode);
502 // Variable resolution.
503 // Possible results of a recursive variable lookup telling if and how a
504 // variable is bound. These are returned in the output parameter *binding_kind
507 // The variable reference could be statically resolved to a variable binding
513 // The variable reference could be statically resolved to a variable binding
517 // possibly introduce variable bindings shadowing the found one. Thus the
518 // found variable binding is just a guess.
521 // The variable reference could not be statically resolved to any binding
522 // and thus should be considered referencing a global variable. NULL is
523 // returned. The variable reference is not inside any 'with' statement and
528 // The variable reference could not be statically resolved to any binding
529 // NULL is returned. The variable reference is not inside any 'with'
532 // possibly introduce a variable binding. Thus the reference should be
533 // considered referencing a global variable unless it is shadowed by an
537 // The variable could not be statically resolved and needs to be looked up
539 // * A 'with' statement has been encountered and there is no variable
540 // binding for the name between the variable reference and the 'with'.
541 // The variable potentially references a property of the 'with' object.
543 // context chain contains either a variable binding for the name or it
548 // Lookup a variable reference given by name recursively starting with this
551 Variable* LookupRecursive(Handle<String> name,
567 bool MustAllocate(Variable* var);
568 bool MustAllocateInContext(Variable* var);
571 // Variable allocation.
572 void AllocateStackSlot(Variable* var);
573 void AllocateHeapSlot(Variable* var);
575 void AllocateNonParameterLocal(Variable* var);