Lines Matching defs:variable
47 // When inserting a new variable via Declare(), we rely on the fact that
48 // the handle location remains alive for the duration of that variable
49 // use. Because a Variable holding a handle with the same location exists
67 Variable* VariableMap::Declare(
72 Variable::Kind kind,
78 // The variable has not been declared yet -> insert it.
80 p->value = new(zone()) Variable(scope,
88 return reinterpret_cast<Variable*>(p->value);
92 Variable* VariableMap::Lookup(Handle<String> name) {
98 return reinterpret_cast<Variable*>(p->value);
170 Variable* variable = variables_.Declare(this,
174 Variable::NORMAL,
176 AllocateHeapSlot(variable);
287 // scope and start scope resolution and variable allocation from that scope.
338 Variable* var =
343 Variable::THIS,
345 var->AllocateTo(Variable::PARAMETER, -1);
353 // Declare 'arguments' variable which exists in all functions.
355 // allocated during variable allocation.
360 Variable::ARGUMENTS,
396 Variable* Scope::LocalLookup(Handle<String> name) {
397 Variable* result = variables_.Lookup(name);
401 // If we have a serialized scope info, we might find the variable there.
407 Variable::Location location = Variable::CONTEXT;
416 location = Variable::LOOKUP;
420 Variable* var = variables_.Declare(this, name, mode, true, Variable::NORMAL,
427 Variable* Scope::LookupFunctionVar(Handle<String> name,
432 // If we are backed by a scope info, try to lookup the variable there.
436 Variable* var = new(zone()) Variable(
438 Variable::NORMAL, kCreatedInitialized);
443 var->AllocateTo(Variable::CONTEXT, index);
451 Variable* Scope::Lookup(Handle<String> name) {
455 Variable* var = scope->LocalLookup(name);
465 Variable* var = variables_.Declare(this, name, mode, true, Variable::NORMAL,
471 Variable* Scope::DeclareLocal(Handle<String> name,
477 // introduces during variable allocation, INTERNAL variables are allocated
482 this, name, mode, true, Variable::NORMAL, init_flag, interface);
486 Variable* Scope::DeclareDynamicGlobal(Handle<String> name) {
492 Variable::NORMAL,
498 // Most likely (always?) any variable we want to remove
509 Variable* Scope::NewInternal(Handle<String> name) {
511 Variable* var = new(zone()) Variable(this,
515 Variable::NORMAL,
522 Variable* Scope::NewTemporary(Handle<String> name) {
524 Variable* var = new(zone()) Variable(this,
528 Variable::NORMAL,
567 Variable* other_var = current->variables_.Lookup(name);
581 VarAndOrder(Variable* var, int order) : var_(var), order_(order) { }
582 Variable* var() const { return var_; }
589 Variable* var_;
594 void Scope::CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals,
595 ZoneList<Variable*>* context_locals) {
601 Variable* var = internals_[i];
611 Variable* var = temps_[i];
628 Variable* var = reinterpret_cast<Variable*>(p->value);
636 Variable* var = vars[i].var();
809 static void PrintLocation(Variable* var) {
811 case Variable::UNALLOCATED:
813 case Variable::PARAMETER:
816 case Variable::LOCAL:
819 case Variable::CONTEXT:
822 case Variable::LOOKUP:
829 static void PrintVar(int indent, Variable* var) {
831 Indent(indent, Variable::Mode2String(var->mode()));
847 Variable* var = reinterpret_cast<Variable*>(p->value);
948 Variable* Scope::NonLocal(Handle<String> name, VariableMode mode) {
951 Variable* var = map->Lookup(name);
960 Variable::NORMAL,
963 var->AllocateTo(Variable::LOOKUP, -1);
969 Variable* Scope::LookupRecursive(Handle<String> name,
974 // Short-cut: if the scope is deserialized from a scope info, variable
980 // Try to find the variable in this scope.
981 Variable* var = LocalLookup(name);
983 // We found a variable and we are done. (Even if there is an 'eval' in
984 // this scope which introduces the same variable again, the resulting
985 // variable remains the same.)
991 // We did not find a variable locally. Check against the function variable,
992 // if any. We can do this for all scopes, since the function variable is
1009 // The current scope is a with scope, so the variable binding can not be
1012 // the associated variable has to be marked as potentially being accessed
1018 // A variable
1019 // scope makes a non-strict 'eval' call, so the found variable may not be
1041 // Otherwise, try to resolve the variable.
1043 Variable* var = LookupRecursive(proxy->name(), &binding_kind, factory);
1046 // We found a variable binding.
1050 // We either found a variable binding that might be shadowed by eval or
1059 Variable* invalidated = var;
1066 // No binding has been found. Declare a variable on the global object.
1077 // The variable could not be resolved statically.
1178 bool Scope::MustAllocate(Variable* var) {
1180 // via an eval() call. This is only possible if the variable has a
1198 bool Scope::MustAllocateInContext(Variable* var) {
1231 void Scope::AllocateStackSlot(Variable* var) {
1232 var->AllocateTo(Variable::LOCAL, num_stack_slots_++);
1236 void Scope::AllocateHeapSlot(Variable* var) {
1237 var->AllocateTo(Variable::CONTEXT, num_heap_slots_++);
1243 Variable* arguments = LocalLookup(isolate_->factory()->arguments_string());
1273 Variable* var = params_[i];
1289 var->AllocateTo(Variable::PARAMETER, i);
1297 void Scope::AllocateNonParameterLocal(Variable* var) {
1325 Variable* var = reinterpret_cast<Variable*>(p->value);