| 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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 if (scope_info_.is_null()) { | 652 if (scope_info_.is_null()) { |
| 653 scope_info_ = ScopeInfo::Create(this); | 653 scope_info_ = ScopeInfo::Create(this); |
| 654 } | 654 } |
| 655 return scope_info_; | 655 return scope_info_; |
| 656 } | 656 } |
| 657 | 657 |
| 658 | 658 |
| 659 void Scope::GetNestedScopeChain( | 659 void Scope::GetNestedScopeChain( |
| 660 List<Handle<ScopeInfo> >* chain, | 660 List<Handle<ScopeInfo> >* chain, |
| 661 int position) { | 661 int position) { |
| 662 chain->Add(Handle<ScopeInfo>(GetScopeInfo())); | 662 if (!is_eval_scope()) chain->Add(Handle<ScopeInfo>(GetScopeInfo())); |
| 663 | 663 |
| 664 for (int i = 0; i < inner_scopes_.length(); i++) { | 664 for (int i = 0; i < inner_scopes_.length(); i++) { |
| 665 Scope* scope = inner_scopes_[i]; | 665 Scope* scope = inner_scopes_[i]; |
| 666 int beg_pos = scope->start_position(); | 666 int beg_pos = scope->start_position(); |
| 667 int end_pos = scope->end_position(); | 667 int end_pos = scope->end_position(); |
| 668 ASSERT(beg_pos >= 0 && end_pos >= 0); | 668 ASSERT(beg_pos >= 0 && end_pos >= 0); |
| 669 if (beg_pos <= position && position <= end_pos) { | 669 if (beg_pos <= position && position < end_pos) { |
| 670 scope->GetNestedScopeChain(chain, position); | 670 scope->GetNestedScopeChain(chain, position); |
| 671 return; | 671 return; |
| 672 } | 672 } |
| 673 } | 673 } |
| 674 } | 674 } |
| 675 | 675 |
| 676 | 676 |
| 677 #ifdef DEBUG | 677 #ifdef DEBUG |
| 678 static const char* Header(ScopeType type) { | 678 static const char* Header(ScopeType type) { |
| 679 switch (type) { | 679 switch (type) { |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 } | 1178 } |
| 1179 | 1179 |
| 1180 | 1180 |
| 1181 int Scope::ContextLocalCount() const { | 1181 int Scope::ContextLocalCount() const { |
| 1182 if (num_heap_slots() == 0) return 0; | 1182 if (num_heap_slots() == 0) return 0; |
| 1183 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - | 1183 return num_heap_slots() - Context::MIN_CONTEXT_SLOTS - |
| 1184 (function_ != NULL && function_->var()->IsContextSlot() ? 1 : 0); | 1184 (function_ != NULL && function_->var()->IsContextSlot() ? 1 : 0); |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 } } // namespace v8::internal | 1187 } } // namespace v8::internal |
| OLD | NEW |