OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // DYNAMIC variables are introduces during variable allocation, | 229 // DYNAMIC variables are introduces during variable allocation, |
230 // INTERNAL variables are allocated explicitly, and TEMPORARY | 230 // INTERNAL variables are allocated explicitly, and TEMPORARY |
231 // variables are allocated via NewTemporary(). | 231 // variables are allocated via NewTemporary(). |
232 ASSERT(mode == Variable::VAR || mode == Variable::CONST); | 232 ASSERT(mode == Variable::VAR || mode == Variable::CONST); |
233 return variables_.Declare(this, name, mode, true, Variable::NORMAL); | 233 return variables_.Declare(this, name, mode, true, Variable::NORMAL); |
234 } | 234 } |
235 | 235 |
236 | 236 |
237 Variable* Scope::DeclareGlobal(Handle<String> name) { | 237 Variable* Scope::DeclareGlobal(Handle<String> name) { |
238 ASSERT(is_global_scope()); | 238 ASSERT(is_global_scope()); |
239 return variables_.Declare(this, name, Variable::DYNAMIC, true, | 239 return variables_.Declare(this, name, Variable::DYNAMIC_GLOBAL, true, |
240 Variable::NORMAL); | 240 Variable::NORMAL); |
241 } | 241 } |
242 | 242 |
243 | 243 |
244 void Scope::AddParameter(Variable* var) { | 244 void Scope::AddParameter(Variable* var) { |
245 ASSERT(is_function_scope()); | 245 ASSERT(is_function_scope()); |
246 ASSERT(LocalLookup(var->name()) == var); | 246 ASSERT(LocalLookup(var->name()) == var); |
247 params_.Add(var); | 247 params_.Add(var); |
248 } | 248 } |
249 | 249 |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && | 954 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && |
955 !must_have_local_context) { | 955 !must_have_local_context) { |
956 num_heap_slots_ = 0; | 956 num_heap_slots_ = 0; |
957 } | 957 } |
958 | 958 |
959 // Allocation done. | 959 // Allocation done. |
960 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); | 960 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
961 } | 961 } |
962 | 962 |
963 } } // namespace v8::internal | 963 } } // namespace v8::internal |
OLD | NEW |