Lines Matching refs:Variable
18 // A hash map to support fast variable declaration and lookup.
25 Variable* Declare(Scope* scope, const AstRawString* name, VariableMode mode,
26 Variable::Kind kind, InitializationFlag initialization_flag,
30 Variable* Lookup(const AstRawString* name);
79 // to a JavaScript variable (including global properties) is represented by a
80 // VariableProxy node. Immediately after AST construction and before variable
82 // corresponding variable (though some are bound during parse time). Variable
83 // allocation binds each unresolved VariableProxy to one Variable and assigns
85 // Script variable.
130 // Lookup a variable in this scope. Returns the variable or NULL if not found.
131 Variable* LookupLocal(const AstRawString* name);
137 Variable* LookupFunctionVar(const AstRawString* name,
140 // Lookup a variable in this scope or outer scopes.
141 // Returns the variable or NULL if not found.
142 Variable* Lookup(const AstRawString* name);
144 // Declare the function variable for a function literal. This variable
146 // outer scope. Only possible for function scopes; at most one variable.
158 Variable* DeclareParameter(
162 // Declare a local variable in this scope. If the variable has been
163 // declared before, the previously declared variable is returned.
164 Variable* DeclareLocal(const AstRawString* name, VariableMode mode,
165 InitializationFlag init_flag, Variable::Kind kind,
169 // Declare an implicit global variable in this scope which must be a
170 // script scope. The variable was introduced (possibly from an inner
171 // scope) by a reference to an unresolved variable with no intervening
173 Variable* DeclareDynamicGlobal(const AstRawString* name);
175 // Create a new unresolved variable.
178 Variable::Kind kind = Variable::NORMAL,
197 // Remove a unresolved variable. During parsing, an unresolved variable
198 // may have been added optimistically, but then only the variable name
199 // was used (typically for labels). If the variable was not declared, the
200 // addition introduced a new unresolved variable which may end up being
201 // allocated globally as a "ghost" variable. RemoveUnresolved removes
202 // such a variable again if it was added; otherwise this is a no-op.
205 // Creates a new temporary variable in this scope's TemporaryScope. The
206 // name is only used for printing and cannot be used to find the variable.
208 // Variable* around. The name should not clash with a legitimate variable
210 Variable* NewTemporary(const AstRawString* name);
212 // Remove a temporary variable. This is for adjusting the scope of
214 bool RemoveTemporary(Variable* var);
216 // Adds a temporary variable in this scope's TemporaryScope. This is for
219 void AddTemporary(Variable* var) { temps_.Add(var, zone()); }
276 // the three compilers will perform hole check elimination on a variable
397 // The variable corresponding to the 'this' value.
398 Variable* receiver() {
405 // "this" (and no other variable) on the native context. Script scopes then
411 // The variable
412 Variable* new_target_var() { return new_target_; }
414 // The variable holding the function literal for named function
423 Variable* parameter(int index) const {
433 // A function can have at most one rest parameter. Returns Variable* or NULL.
434 Variable* rest_parameter(int* index) const {
462 // The local variable 'arguments' if we need to allocate it; NULL otherwise.
463 Variable* arguments() const {
468 Variable* this_function_var() const {
499 // Variable allocation.
502 // that the function variable - if present - is not collected and should be
505 ZoneList<Variable*>* stack_locals, ZoneList<Variable*>* context_locals,
506 ZoneList<Variable*>* context_globals,
507 ZoneList<Variable*>* strong_mode_free_variables = nullptr);
512 // Result of variable allocation.
625 ZoneList<Variable*> temps_;
627 ZoneList<Variable*> params_;
634 // Convenience variable.
635 Variable* receiver_;
636 // Function variable, if any; function scopes only.
638 // new.target variable, function scopes only.
639 Variable* new_target_;
640 // Convenience variable; function scopes only.
641 Variable* arguments_;
642 // Convenience variable; Subclass constructor only
643 Variable* this_function_;
702 Variable* rest_parameter_;
709 // Create a non-local variable with a given name.
711 Variable* NonLocal(const AstRawString* name, VariableMode mode);
713 // Variable resolution.
714 // Possible results of a recursive variable lookup telling if and how a
715 // variable is bound. These are returned in the output parameter *binding_kind
718 // The variable reference could be statically resolved to a variable binding
724 // The variable reference could be statically resolved to a variable binding
728 // possibly introduce variable bindings shadowing the found one. Thus the
729 // found variable binding is just a guess.
732 // The variable reference could not be statically resolved to any binding
733 // and thus should be considered referencing a global variable. NULL is
734 // returned. The variable reference is not inside any 'with' statement and
739 // The variable reference could not be statically resolved to any binding
740 // NULL is returned. The variable reference is not inside any 'with'
743 // possibly introduce a variable binding. Thus the reference should be
744 // considered referencing a global variable unless it is shadowed by an
748 // The variable could not be statically resolved and needs to be looked up
750 // * A 'with' statement has been encountered and there is no variable
751 // binding for the name between the variable reference and the 'with'.
752 // The variable potentially references a property of the 'with' object.
754 // context chain contains either a variable binding for the name or it
759 // Lookup a variable reference given by name recursively starting with this
762 Variable* LookupRecursive(VariableProxy* proxy, BindingKind* binding_kind,
770 bool CheckStrongModeDeclaration(VariableProxy* proxy, Variable* var);
773 // class variable, otherwise nullptr.
781 bool MustAllocate(Variable* var);
782 bool MustAllocateInContext(Variable* var);
785 // Variable allocation.
786 void AllocateStackSlot(Variable* var);
787 void AllocateHeapSlot(Variable* var);
789 void AllocateNonParameterLocal(Isolate* isolate, Variable* var);
790 void AllocateDeclaredGlobal(Isolate* isolate, Variable* var);
793 void AllocateParameter(Variable* var, int index);