Lines Matching refs:var
323 Variable* var = in Initialize() local
330 var->AllocateTo(Variable::PARAMETER, -1); in Initialize()
331 receiver_ = var; in Initialize()
401 Variable* var = in LocalLookup() local
408 var->AllocateTo(Variable::CONTEXT, index); in LocalLookup()
409 return var; in LocalLookup()
416 return function_->var(); in LookupFunctionVar()
422 Variable* var = DeclareFunctionVar(name, mode, factory); in LookupFunctionVar() local
423 var->AllocateTo(Variable::CONTEXT, index); in LookupFunctionVar()
424 return var; in LookupFunctionVar()
435 Variable* var = scope->LocalLookup(name); in Lookup() local
436 if (var != NULL) return var; in Lookup()
445 Variable* var = variables_.Declare( in DeclareParameter() local
447 params_.Add(var); in DeclareParameter()
480 void Scope::RemoveUnresolved(VariableProxy* var) { in RemoveUnresolved() argument
484 if (unresolved_[i] == var) { in RemoveUnresolved()
494 Variable* var = new Variable(this, in NewTemporary() local
500 temps_.Add(var); in NewTemporary()
501 return var; in NewTemporary()
553 ASSERT(unresolved_[i]->var() != NULL); in CheckAssignmentToConst()
554 if (unresolved_[i]->var()->is_const_mode() && in CheckAssignmentToConst()
579 Variable* var = temps_[i]; in CollectStackAndContextLocals() local
580 if (var->is_used()) { in CollectStackAndContextLocals()
581 ASSERT(var->IsStackLocal()); in CollectStackAndContextLocals()
582 stack_locals->Add(var); in CollectStackAndContextLocals()
590 Variable* var = reinterpret_cast<Variable*>(p->value); in CollectStackAndContextLocals() local
591 if (var->is_used()) { in CollectStackAndContextLocals()
592 if (var->IsStackLocal()) { in CollectStackAndContextLocals()
593 stack_locals->Add(var); in CollectStackAndContextLocals()
594 } else if (var->IsContextSlot()) { in CollectStackAndContextLocals()
595 context_locals->Add(var); in CollectStackAndContextLocals()
744 static void PrintLocation(Variable* var) { in PrintLocation() argument
745 switch (var->location()) { in PrintLocation()
749 PrintF("parameter[%d]", var->index()); in PrintLocation()
752 PrintF("local[%d]", var->index()); in PrintLocation()
755 PrintF("context[%d]", var->index()); in PrintLocation()
764 static void PrintVar(int indent, Variable* var) { in PrintVar() argument
765 if (var->is_used() || !var->IsUnallocated()) { in PrintVar()
766 Indent(indent, Variable::Mode2String(var->mode())); in PrintVar()
768 PrintName(var->name()); in PrintVar()
770 PrintLocation(var); in PrintVar()
771 if (var->has_forced_context_allocation()) { in PrintVar()
772 if (!var->IsUnallocated()) PrintF(", "); in PrintVar()
782 Variable* var = reinterpret_cast<Variable*>(p->value); in PrintMap() local
783 PrintVar(indent, var); in PrintMap()
847 PrintVar(n1, function_->var()); in Print()
881 Variable* var = map->Lookup(name); in NonLocal() local
882 if (var == NULL) { in NonLocal()
886 var = map->Declare(NULL, in NonLocal()
893 var->AllocateTo(Variable::LOOKUP, -1); in NonLocal()
895 return var; in NonLocal()
904 Variable* var = LocalLookup(name); in LookupRecursive() local
909 if (var != NULL) { in LookupRecursive()
911 return var; in LookupRecursive()
918 var = LookupFunctionVar(name, factory); in LookupRecursive()
919 if (var != NULL) { in LookupRecursive()
922 var = outer_scope_->LookupRecursive(name, binding_kind, factory); in LookupRecursive()
924 var->ForceContextAllocation(); in LookupRecursive()
950 return var; in LookupRecursive()
961 if (proxy->var() != NULL) return true; in ResolveVariable()
965 Variable* var = LookupRecursive(proxy->name(), &binding_kind, factory); in ResolveVariable() local
974 if (var->is_global()) { in ResolveVariable()
975 var = NonLocal(proxy->name(), DYNAMIC_GLOBAL); in ResolveVariable()
977 Variable* invalidated = var; in ResolveVariable()
978 var = NonLocal(proxy->name(), DYNAMIC_LOCAL); in ResolveVariable()
979 var->set_local_if_not_shadowed(invalidated); in ResolveVariable()
985 var = info->global_scope()->DeclareGlobal(proxy->name()); in ResolveVariable()
991 var = NonLocal(proxy->name(), DYNAMIC_GLOBAL); in ResolveVariable()
996 var = NonLocal(proxy->name(), DYNAMIC); in ResolveVariable()
1000 ASSERT(var != NULL); in ResolveVariable()
1001 proxy->BindTo(var); in ResolveVariable()
1007 PrintF("# Resolve %s:\n", var->name()->ToAsciiArray()); in ResolveVariable()
1009 proxy->interface()->Unify(var->interface(), &ok); in ResolveVariable()
1017 var->interface()->Print(); in ResolveVariable()
1029 USE(JSObject::SetElement(array, 0, var->name(), NONE, kStrictMode)); in ResolveVariable()
1082 bool Scope::MustAllocate(Variable* var) { in MustAllocate() argument
1086 if ((var->is_this() || var->name()->length() > 0) && in MustAllocate()
1087 (var->has_forced_context_allocation() || in MustAllocate()
1093 var->set_is_used(true); in MustAllocate()
1096 return !var->is_global() && var->is_used(); in MustAllocate()
1100 bool Scope::MustAllocateInContext(Variable* var) { in MustAllocateInContext() argument
1108 if (var->mode() == TEMPORARY) return false; in MustAllocateInContext()
1110 return var->has_forced_context_allocation() || in MustAllocateInContext()
1114 var->is_global(); in MustAllocateInContext()
1129 void Scope::AllocateStackSlot(Variable* var) { in AllocateStackSlot() argument
1130 var->AllocateTo(Variable::LOCAL, num_stack_slots_++); in AllocateStackSlot()
1134 void Scope::AllocateHeapSlot(Variable* var) { in AllocateHeapSlot() argument
1135 var->AllocateTo(Variable::CONTEXT, num_heap_slots_++); in AllocateHeapSlot()
1171 Variable* var = params_[i]; in AllocateParameterLocals() local
1172 ASSERT(var->scope() == this); in AllocateParameterLocals()
1175 var->ForceContextAllocation(); in AllocateParameterLocals()
1178 if (MustAllocate(var)) { in AllocateParameterLocals()
1179 if (MustAllocateInContext(var)) { in AllocateParameterLocals()
1180 ASSERT(var->IsUnallocated() || var->IsContextSlot()); in AllocateParameterLocals()
1181 if (var->IsUnallocated()) { in AllocateParameterLocals()
1182 AllocateHeapSlot(var); in AllocateParameterLocals()
1185 ASSERT(var->IsUnallocated() || var->IsParameter()); in AllocateParameterLocals()
1186 if (var->IsUnallocated()) { in AllocateParameterLocals()
1187 var->AllocateTo(Variable::PARAMETER, i); in AllocateParameterLocals()
1195 void Scope::AllocateNonParameterLocal(Variable* var) { in AllocateNonParameterLocal() argument
1196 ASSERT(var->scope() == this); in AllocateNonParameterLocal()
1197 ASSERT(!var->IsVariable(isolate_->factory()->result_symbol()) || in AllocateNonParameterLocal()
1198 !var->IsStackLocal()); in AllocateNonParameterLocal()
1199 if (var->IsUnallocated() && MustAllocate(var)) { in AllocateNonParameterLocal()
1200 if (MustAllocateInContext(var)) { in AllocateNonParameterLocal()
1201 AllocateHeapSlot(var); in AllocateNonParameterLocal()
1203 AllocateStackSlot(var); in AllocateNonParameterLocal()
1218 Variable* var = reinterpret_cast<Variable*>(p->value); in AllocateNonParameterLocals() local
1219 AllocateNonParameterLocal(var); in AllocateNonParameterLocals()
1227 AllocateNonParameterLocal(function_->var()); in AllocateNonParameterLocals()
1269 (function_ != NULL && function_->var()->IsStackLocal() ? 1 : 0); in StackLocalCount()
1276 (function_ != NULL && function_->var()->IsContextSlot() ? 1 : 0); in ContextLocalCount()