Home | History | Annotate | Download | only in src

Lines Matching refs:Variable

46 //       When inserting a new variable via Declare(), we rely on the fact that
47 // the handle location remains alive for the duration of that variable
48 // use. Because a Variable holding a handle with the same location exists
64 Variable* VariableMap::Declare(
69 Variable::Kind kind,
74 // The variable has not been declared yet -> insert it.
76 p->value = new Variable(scope,
84 return reinterpret_cast<Variable*>(p->value);
88 Variable* VariableMap::Lookup(Handle<String> name) {
93 return reinterpret_cast<Variable*>(p->value);
160 Variable* variable = variables_.Declare(this,
164 Variable::NORMAL,
166 AllocateHeapSlot(variable);
256 // scope and start scope resolution and variable allocation from that scope.
323 Variable* var =
328 Variable::THIS,
330 var->AllocateTo(Variable::PARAMETER, -1);
338 // Declare 'arguments' variable which exists in all functions.
340 // allocated during variable allocation.
345 Variable::ARGUMENTS,
380 Variable* Scope::LocalLookup(Handle<String> name) {
381 Variable* result = variables_.Lookup(name);
385 // If we have a serialized scope info, we might find the variable there.
401 Variable* var =
406 Variable::NORMAL,
408 var->AllocateTo(Variable::CONTEXT, index);
413 Variable* Scope::LookupFunctionVar(Handle<String> name,
418 // If we are backed by a scope info, try to lookup the variable there.
422 Variable* var = DeclareFunctionVar(name, mode, factory);
423 var->AllocateTo(Variable::CONTEXT, index);
431 Variable* Scope::Lookup(Handle<String> name) {
435 Variable* var = scope->LocalLookup(name);
445 Variable* var = variables_.Declare(
446 this, name, mode, true, Variable::NORMAL, kCreatedInitialized);
451 Variable* Scope::DeclareLocal(Handle<String> name,
457 // introduces during variable allocation, INTERNAL variables are allocated
465 this, name, mode, true, Variable::NORMAL, init_flag, interface);
469 Variable* Scope::DeclareGlobal(Handle<String> name) {
475 Variable::NORMAL,
481 // Most likely (always?) any variable we want to remove
492 Variable
494 Variable* var = new Variable(this,
498 Variable::NORMAL,
537 Variable* other_var = current->variables_.Lookup(name);
572 void Scope::CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals,
573 ZoneList<Variable*>* context_locals) {
579 Variable* var = temps_[i];
590 Variable* var = reinterpret_cast<Variable*>(p->value);
744 static void PrintLocation(Variable* var) {
746 case Variable::UNALLOCATED:
748 case Variable::PARAMETER:
751 case Variable::LOCAL:
754 case Variable::CONTEXT:
757 case Variable::LOOKUP:
764 static void PrintVar(int indent, Variable* var) {
766 Indent(indent, Variable::Mode2String(var->mode()));
782 Variable* var = reinterpret_cast<Variable*>(p->value);
878 Variable* Scope::NonLocal(Handle<String> name, VariableMode mode) {
881 Variable* var = map->Lookup(name);
890 Variable::NORMAL,
893 var->AllocateTo(Variable::LOOKUP, -1);
899 Variable* Scope::LookupRecursive(Handle<String> name,
903 // Try to find the variable in this scope.
904 Variable* var = LocalLookup(name);
906 // We found a variable and we are done. (Even if there is an 'eval' in
907 // this scope which introduces the same variable again, the resulting
908 // variable remains the same.)
914 // We did not find a variable locally. Check against the function variable,
915 // if any. We can do this for all scopes, since the function variable is
931 // The current scope is a with scope, so the variable binding can not be
934 // the associated variable has to be marked as potentially being accessed
940 // A variable binding may have been found in an outer scope, but the current
941 // scope makes a non-strict 'eval' call, so the found variable may not be
963 // Otherwise, try to resolve the variable.
965 Variable* var = LookupRecursive(proxy->name(), &binding_kind, factory);
968 // We found a variable binding.
972 // We found a variable variable binding that might be shadowed
973 // by 'eval' introduced variable bindings.
977 Variable* invalidated = var;
984 // No binding has been found. Declare a variable in global scope.
995 // The variable could not be resolved statically.
1082 bool Scope::MustAllocate(Variable* var) {
1084 // via an eval() call. This is only possible if the variable has a
1100 bool Scope::MustAllocateInContext(Variable* var) {
1129 void Scope::AllocateStackSlot(Variable* var) {
1130 var->AllocateTo(Variable::LOCAL, num_stack_slots_++);
1134 void Scope::AllocateHeapSlot(Variable* var) {
1135 var->AllocateTo(Variable::CONTEXT, num_heap_slots_++);
1141 Variable* arguments = LocalLookup(isolate_->factory()->arguments_symbol());
1171 Variable* var = params_[i];
1187 var->AllocateTo(Variable::PARAMETER, i);
1195 void Scope::AllocateNonParameterLocal(Variable* var) {
1218 Variable* var = reinterpret_cast<Variable*>(p->value);