| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 } | 314 } |
| 315 | 315 |
| 316 | 316 |
| 317 void Scope::AddParameter(Variable* var) { | 317 void Scope::AddParameter(Variable* var) { |
| 318 ASSERT(is_function_scope()); | 318 ASSERT(is_function_scope()); |
| 319 ASSERT(LocalLookup(var->name()) == var); | 319 ASSERT(LocalLookup(var->name()) == var); |
| 320 params_.Add(var); | 320 params_.Add(var); |
| 321 } | 321 } |
| 322 | 322 |
| 323 | 323 |
| 324 VariableProxy* Scope::NewUnresolved(Handle<String> name, | 324 VariableProxy* Scope::NewUnresolved(Handle<String> name, bool inside_with) { |
| 325 bool inside_with, | |
| 326 int position) { | |
| 327 // Note that we must not share the unresolved variables with | 325 // Note that we must not share the unresolved variables with |
| 328 // the same name because they may be removed selectively via | 326 // the same name because they may be removed selectively via |
| 329 // RemoveUnresolved(). | 327 // RemoveUnresolved(). |
| 330 ASSERT(!resolved()); | 328 ASSERT(!resolved()); |
| 331 VariableProxy* proxy = new VariableProxy(name, false, inside_with, position); | 329 VariableProxy* proxy = new VariableProxy(name, false, inside_with); |
| 332 unresolved_.Add(proxy); | 330 unresolved_.Add(proxy); |
| 333 return proxy; | 331 return proxy; |
| 334 } | 332 } |
| 335 | 333 |
| 336 | 334 |
| 337 void Scope::RemoveUnresolved(VariableProxy* var) { | 335 void Scope::RemoveUnresolved(VariableProxy* var) { |
| 338 // Most likely (always?) any variable we want to remove | 336 // Most likely (always?) any variable we want to remove |
| 339 // was just added before, so we search backwards. | 337 // was just added before, so we search backwards. |
| 340 for (int i = unresolved_.length(); i-- > 0;) { | 338 for (int i = unresolved_.length(); i-- > 0;) { |
| 341 if (unresolved_[i] == var) { | 339 if (unresolved_[i] == var) { |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && | 980 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && |
| 983 !must_have_local_context) { | 981 !must_have_local_context) { |
| 984 num_heap_slots_ = 0; | 982 num_heap_slots_ = 0; |
| 985 } | 983 } |
| 986 | 984 |
| 987 // Allocation done. | 985 // Allocation done. |
| 988 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); | 986 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
| 989 } | 987 } |
| 990 | 988 |
| 991 } } // namespace v8::internal | 989 } } // namespace v8::internal |
| OLD | NEW |