| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 return var; | 381 return var; |
| 382 } | 382 } |
| 383 | 383 |
| 384 | 384 |
| 385 void Scope::AddDeclaration(Declaration* declaration) { | 385 void Scope::AddDeclaration(Declaration* declaration) { |
| 386 decls_.Add(declaration); | 386 decls_.Add(declaration); |
| 387 } | 387 } |
| 388 | 388 |
| 389 | 389 |
| 390 void Scope::SetIllegalRedeclaration(Expression* expression) { | 390 void Scope::SetIllegalRedeclaration(Expression* expression) { |
| 391 // Only set the illegal redeclaration expression the | 391 // Record only the first illegal redeclaration. |
| 392 // first time the function is called. | |
| 393 if (!HasIllegalRedeclaration()) { | 392 if (!HasIllegalRedeclaration()) { |
| 394 illegal_redecl_ = expression; | 393 illegal_redecl_ = expression; |
| 395 } | 394 } |
| 396 ASSERT(HasIllegalRedeclaration()); | 395 ASSERT(HasIllegalRedeclaration()); |
| 397 } | 396 } |
| 398 | 397 |
| 399 | 398 |
| 400 void Scope::VisitIllegalRedeclaration(AstVisitor* visitor) { | 399 void Scope::VisitIllegalRedeclaration(AstVisitor* visitor) { |
| 401 ASSERT(HasIllegalRedeclaration()); | 400 ASSERT(HasIllegalRedeclaration()); |
| 402 illegal_redecl_->Accept(visitor); | 401 illegal_redecl_->Accept(visitor); |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && | 1059 if (num_heap_slots_ == Context::MIN_CONTEXT_SLOTS && |
| 1061 !must_have_local_context) { | 1060 !must_have_local_context) { |
| 1062 num_heap_slots_ = 0; | 1061 num_heap_slots_ = 0; |
| 1063 } | 1062 } |
| 1064 | 1063 |
| 1065 // Allocation done. | 1064 // Allocation done. |
| 1066 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); | 1065 ASSERT(num_heap_slots_ == 0 || num_heap_slots_ >= Context::MIN_CONTEXT_SLOTS); |
| 1067 } | 1066 } |
| 1068 | 1067 |
| 1069 } } // namespace v8::internal | 1068 } } // namespace v8::internal |
| OLD | NEW |