Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(206)

Side by Side Diff: src/debug/debug-scopes.cc

Issue 2162143005: Turn ZoneList inner_scopes into a linked list (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/debug/debug-scopes.h" 5 #include "src/debug/debug-scopes.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/compiler.h" 8 #include "src/compiler.h"
9 #include "src/debug/debug.h" 9 #include "src/debug/debug.h"
10 #include "src/frames-inl.h" 10 #include "src/frames-inl.h"
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 int position) { 792 int position) {
793 if (scope->is_hidden()) { 793 if (scope->is_hidden()) {
794 // We need to add this chain element in case the scope has a context 794 // We need to add this chain element in case the scope has a context
795 // associated. We need to keep the scope chain and context chain in sync. 795 // associated. We need to keep the scope chain and context chain in sync.
796 nested_scope_chain_.Add(ExtendedScopeInfo(scope->GetScopeInfo(isolate))); 796 nested_scope_chain_.Add(ExtendedScopeInfo(scope->GetScopeInfo(isolate)));
797 } else { 797 } else {
798 nested_scope_chain_.Add(ExtendedScopeInfo(scope->GetScopeInfo(isolate), 798 nested_scope_chain_.Add(ExtendedScopeInfo(scope->GetScopeInfo(isolate),
799 scope->start_position(), 799 scope->start_position(),
800 scope->end_position())); 800 scope->end_position()));
801 } 801 }
802 for (int i = 0; i < scope->inner_scopes()->length(); i++) { 802 for (Scope* inner_scope = scope->inner_scope(); inner_scope != nullptr;
803 Scope* inner_scope = scope->inner_scopes()->at(i); 803 inner_scope = inner_scope->sibling()) {
804 int beg_pos = inner_scope->start_position(); 804 int beg_pos = inner_scope->start_position();
805 int end_pos = inner_scope->end_position(); 805 int end_pos = inner_scope->end_position();
806 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden()); 806 DCHECK((beg_pos >= 0 && end_pos >= 0) || inner_scope->is_hidden());
807 if (beg_pos <= position && position < end_pos) { 807 if (beg_pos <= position && position < end_pos) {
808 GetNestedScopeChain(isolate, inner_scope, position); 808 GetNestedScopeChain(isolate, inner_scope, position);
809 return; 809 return;
810 } 810 }
811 } 811 }
812 } 812 }
813 813
814 } // namespace internal 814 } // namespace internal
815 } // namespace v8 815 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast/scopes.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698