Home | History | Annotate | Download | only in ast

Lines Matching refs:Variable

27 bool IsLexical(Variable* variable) {
28 if (variable == kDummyPreParserLexicalVariable) return true;
29 if (variable == kDummyPreParserVariable) return false;
30 return IsLexicalVariableMode(variable->mode());
39 // When inserting a new variable via Declare(), we rely on the fact that
40 // the handle location remains alive for the duration of that variable
41 // use. Because a Variable holding a handle with the same location exists
47 Variable* VariableMap::Declare(Zone* zone, Scope* scope,
61 // The variable has not been declared yet -> insert it.
63 p->value = new (zone) Variable(scope, name, mode, kind, initialization_flag,
66 return reinterpret_cast<Variable*>(p->value);
69 Variable* VariableMap::DeclareName(Zone* zone, const AstRawString* name,
75 // The variable has not been declared yet -> insert it.
80 return reinterpret_cast<Variable*>(p->value);
83 void VariableMap::Remove(Variable* var) {
88 void VariableMap::Add(Zone* zone, Variable* var) {
98 Variable* VariableMap::Lookup(const AstRawString* name) {
103 return reinterpret_cast<Variable*>(p->value);
170 // a regular dynamic global by predeclaring it with the right variable kind.
280 // Cache the catch variable, even though it's also available via the
282 // variable as first and only variable.
283 Variable* variable = Declare(zone, catch_variable_name, VAR);
284 AllocateHeapSlot(variable);
485 // For each variable which is used as a function declaration in a sloppy
491 // If the variable wouldn't conflict with a lexical declaration
512 Variable* created_variable = nullptr;
527 Variable* var = nullptr;
559 declaration, VAR, Variable::DefaultInitializationFlag(VAR), false,
651 Variable* var =
664 // Declare 'arguments' variable which exists in all non arrow functions.
666 // allocated during variable allocation.
669 // Check if there's lexically declared variable named arguments to avoid
690 Variable* DeclarationScope::DeclareFunctionVar(const AstRawString* name) {
697 new (zone()) Variable(this, name, CONST, kind, kCreatedInitialized);
706 Variable* DeclarationScope::DeclareGeneratorObjectVar(
711 Variable* result = EnsureRareData()->generator_object =
717 Variable* DeclarationScope::DeclarePromiseVar(const AstRawString* name) {
720 Variable* result = EnsureRareData()->promise = NewTemporary(name);
792 void DeclarationScope::AddLocal(Variable* var) {
799 Variable* Scope::Declare(Zone* zone, const AstRawString* name,
804 Variable* var =
851 for (Variable* local : new_parent->locals_) {
883 Variable* Scope::LookupInScopeInfo(const AstRawString* name) {
888 // If we have a serialized scope info, we might find the variable there.
917 Variable* var = AsDeclarationScope()->DeclareFunctionVar(name);
931 Variable* var = variables_.Declare(zone(), this, name, mode, kind, init_flag,
937 Variable* Scope::Lookup(const AstRawString* name) {
941 Variable* var = scope->LookupLocal(name);
947 Variable* DeclarationScope::DeclareParameter(
956 Variable* var;
973 Variable* DeclarationScope::DeclareParameterName(
985 Variable* var = Declare(zone(), name, VAR);
993 Variable* Scope::DeclareLocal(const AstRawString* name, VariableMode mode,
998 // introduced during variable allocation, and TEMPORARY variables are
1007 Variable* Scope::DeclareVariable(
1037 // function, which, for efficiency, we preparse without variable tracking.
1042 Variable* var = nullptr;
1046 // The proxy is bound to a lookup variable to force a dynamic declaration
1049 Variable(this, name, mode, NORMAL_VARIABLE, init, kMaybeAssigned);
1052 // Declare the variable in the declaration scope.
1115 // same variable if it is declared several times. This is not a
1123 Variable* Scope::DeclareVariableName(const AstRawString* name,
1142 // Declare the variable in the declaration scope.
1144 Variable* var = LookupLocal(name);
1181 Variable* DeclarationScope::DeclareDynamicGlobal(const AstRawString* name,
1185 // TODO(neis): Mark variable as maybe-assigned?
1208 Variable* Scope::NewTemporary(const AstRawString* name) {
1212 Variable* Scope::NewTemporary(const AstRawString* name,
1215 Variable* var = new (zone())
1216 Variable(scope, name, TEMPORARY, NORMAL_VARIABLE, kCreatedInitialized);
1237 Variable* other_var =
1253 Variable* var = LookupLocal(names.at(i));
1268 // Module variables must be allocated before variable resolution
1538 void PrintLocation(Variable* var) {
1560 void PrintVar(int indent, Variable* var) {
1583 Variable* function_var) {
1586 Variable* var = reinterpret_cast<Variable*>(p->value);
1634 Variable* function = nullptr;
1689 for (Variable* local : locals_) {
1742 Variable* Scope::NonLocal(const AstRawString* name, VariableMode mode) {
1745 Variable* var = variables_.Declare(zone(), nullptr, name, mode);
1751 Variable* Scope::LookupRecursive(VariableProxy* proxy, Scope* outer_scope_end) {
1762 // Try to find the variable in this scope.
1763 Variable* var = LookupLocal(proxy->raw_name());
1765 // We found a variable and we are done. (Even if there is an 'eval' in this
1766 // scope which introduces the same variable again, the resulting variable
1774 // No binding has been found. Declare a variable on the global object.
1783 // The variable could not be resolved statically.
1802 // The current scope is a with scope, so the variable binding can not be
1805 // scope, the associated variable has to be marked as potentially being
1818 // A variable binding may have been found in an outer scope, but the current
1819 // scope makes a sloppy 'eval' call, so the found variable may not be the
1823 // here (this excludes block and catch scopes), and variable lookups at
1831 Variable* invalidated = var;
1842 Variable* var = LookupRecursive(proxy, nullptr);
1848 bool AccessNeedsHoleCheck(Variable* var, VariableProxy* proxy, Scope* scope) {
1851 // VAR bindings, either from var or function declarations), but the variable
1853 // that no shadowing variable was dynamically introoduced.
1871 // binding, both the Variable and the VariableProxy have the same
1874 // the source physically located after the initializer of the variable,
1885 // The scope of the variable needs to be checked, in case the use is
1907 void Scope::ResolveTo(ParseInfo* info, VariableProxy* proxy, Variable* var) {
1915 // The following variable name may be minified. If so, disable
1918 V8_Fatal(__FILE__, __LINE__, "Unbound variable: '%s' in native script.",
1943 Variable* var = outer_scope()->LookupRecursive(proxy, nullptr);
1968 // Module variables must be allocated before variable resolution
1984 Variable* var =
2016 bool Scope::MustAllocate(Variable* var) {
2022 // via an eval() call. This is only possible if the variable has a
2035 bool Scope::MustAllocateInContext(Variable* var) {
2056 void Scope::AllocateStackSlot(Variable* var) {
2065 void Scope::AllocateHeapSlot(Variable* var) {
2103 Variable* var = params_[i];
2115 void DeclarationScope::AllocateParameter(Variable* var, int index) {
2138 void Scope::AllocateNonParameterLocal(Variable* var) {
2150 for (Variable* local : locals_) {
2176 [=](Variable* var) { return !MustAllocate(var); });
2181 Variable* var = LookupLocal(it.first);
2187 Variable* var = LookupLocal(it.first);
2275 for (Variable* local : locals_) {
2284 Variable* function =
2293 Variable* function =