Home | History | Annotate | Download | only in src

Lines Matching refs:Variable

22 //       When inserting a new variable via Declare(), we rely on the fact that
23 // the handle location remains alive for the duration of that variable
24 // use. Because a Variable holding a handle with the same location exists
42 Variable* VariableMap::Declare(
47 Variable::Kind kind,
53 // The variable has not been declared yet -> insert it.
55 p->value = new(zone()) Variable(scope,
63 return reinterpret_cast<Variable*>(p->value);
67 Variable* VariableMap::Lookup(Handle<String> name) {
73 return reinterpret_cast<Variable*>(p->value);
145 Variable* variable = variables_.Declare(this,
149 Variable::NORMAL,
151 AllocateHeapSlot(variable);
261 // scope and start scope resolution and variable allocation from that scope.
311 Variable* var =
316 Variable::THIS,
318 var->AllocateTo(Variable::PARAMETER, -1);
326 // Declare 'arguments' variable which exists in all functions.
328 // allocated during variable allocation.
333 Variable::ARGUMENTS,
369 Variable* Scope::LookupLocal(Handle<String> name) {
370 Variable* result = variables_.Lookup(name);
374 // If we have a serialized scope info, we might find the variable there.
380 Variable::Location location = Variable::CONTEXT;
389 location = Variable::LOOKUP;
393 Variable* var = variables_.Declare(this, name, mode, true, Variable::NORMAL,
400 Variable* Scope::LookupFunctionVar(Handle<String> name,
405 // If we are backed by a scope info, try to lookup the variable there.
409 Variable* var = new(zone()) Variable(
411 Variable::NORMAL, kCreatedInitialized);
416 var->AllocateTo(Variable::CONTEXT, index);
424 Variable* Scope::Lookup(Handle<String> name) {
428 Variable* var = scope->LookupLocal(name);
438 Variable* var = variables_.Declare(this, name, mode, true, Variable::NORMAL,
444 Variable* Scope::DeclareLocal(Handle<String> name,
450 // introduces during variable allocation, INTERNAL variables are allocated
455 this, name, mode, true, Variable::NORMAL, init_flag, interface);
459 Variable* Scope::DeclareDynamicGlobal(Handle<String> name) {
465 Variable::NORMAL,
471 // Most likely (always?) any variable we want to remove
482 Variable* Scope::NewInternal(Handle<String> name) {
484 Variable* var = new(zone()) Variable(this,
488 Variable::NORMAL,
495 Variable* Scope::NewTemporary(Handle<String> name) {
497 Variable* var = new(zone()) Variable(this,
501 Variable::NORMAL,
540 Variable* other_var = current->variables_.Lookup(name);
554 VarAndOrder(Variable* var, int order) : var_(var), order_(order) { }
555 Variable* var() const { return var_; }
562 Variable* var_;
567 void Scope::CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals,
568 ZoneList<Variable*>* context_locals) {
574 Variable* var = internals_[i];
584 Variable* var = temps_[i];
601 Variable* var = reinterpret_cast<Variable*>(p->value);
609 Variable* var = vars[i].var();
782 static void PrintLocation(Variable* var) {
784 case Variable::UNALLOCATED:
786 case Variable::PARAMETER:
789 case Variable::LOCAL:
792 case Variable::CONTEXT:
795 case Variable::LOOKUP:
802 static void PrintVar(int indent, Variable* var) {
804 Indent(indent, Variable::Mode2String(var->mode()));
820 Variable* var = reinterpret_cast<Variable*>(p->value);
920 Variable* Scope::NonLocal(Handle<String> name, VariableMode mode) {
923 Variable* var = map->Lookup(name);
932 Variable::NORMAL,
935 var->AllocateTo(Variable::LOOKUP, -1);
941 Variable* Scope::LookupRecursive(Handle<String> name,
946 // Short-cut: if the scope is deserialized from a scope info, variable
952 // Try to find the variable in this scope.
953 Variable* var = LookupLocal(name);
955 // We found a variable and we are done. (Even if there is an 'eval' in
956 // this scope which introduces the same variable again, the resulting
957 // variable remains the same.)
963 // We did not find a variable locally. Check against the function variable,
964 // if any. We can do this for all scopes, since the function variable is
981 // The current scope is a with scope, so the variable binding can not be
984 // the associated variable has to be marked as potentially being accessed
990 // A variable binding may have been found in an outer scope, but the current
991 // scope makes a sloppy 'eval' call, so the found variable may not be
1013 // Otherwise, try to resolve the variable.
1015 Variable* var = LookupRecursive(proxy->name(), &binding_kind, factory);
1018 // We found a variable binding.
1022 // We either found a variable binding that might be shadowed by eval or
1031 Variable* invalidated = var;
1038 // No binding has been found. Declare a variable on the global object.
1048 // The variable could not be resolved statically.
1149 bool Scope::MustAllocate(Variable* var) {
1151 // via an eval() call. This is only possible if the variable has a
1169 bool Scope::MustAllocateInContext(Variable* var) {
1202 void Scope::AllocateStackSlot(Variable* var) {
1203 var->AllocateTo(Variable::LOCAL, num_stack_slots_++);
1207 void Scope::AllocateHeapSlot(Variable* var) {
1208 var->AllocateTo(Variable::CONTEXT, num_heap_slots_++);
1214 Variable* arguments = LookupLocal(isolate_->factory()->arguments_string());
1244 Variable* var = params_[i];
1260 var->AllocateTo(Variable::PARAMETER, i);
1268 void Scope::AllocateNonParameterLocal(Variable* var) {
1296 Variable* var = reinterpret_cast<Variable*>(p->value);