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

Side by Side Diff: src/debug/liveedit.cc

Issue 2275943005: [modules] Minor refactorings in scopes and scopeinfos. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@modules-serialize-entry
Patch Set: Created 4 years, 3 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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/liveedit.h" 5 #include "src/debug/liveedit.h"
6 6
7 #include "src/ast/scopes.h" 7 #include "src/ast/scopes.h"
8 #include "src/code-stubs.h" 8 #include "src/code-stubs.h"
9 #include "src/compilation-cache.h" 9 #include "src/compilation-cache.h"
10 #include "src/compiler.h" 10 #include "src/compiler.h"
(...skipping 1886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 // Saves some description of scope. It stores name and indexes of 1897 // Saves some description of scope. It stores name and indexes of
1898 // variables in the whole scope chain. Null-named slots delimit 1898 // variables in the whole scope chain. Null-named slots delimit
1899 // scopes of this chain. 1899 // scopes of this chain.
1900 Scope* current_scope = scope; 1900 Scope* current_scope = scope;
1901 while (current_scope != NULL) { 1901 while (current_scope != NULL) {
1902 HandleScope handle_scope(isolate_); 1902 HandleScope handle_scope(isolate_);
1903 ZoneList<Variable*> stack_list(current_scope->StackLocalCount(), zone_); 1903 ZoneList<Variable*> stack_list(current_scope->StackLocalCount(), zone_);
1904 ZoneList<Variable*> context_list(current_scope->ContextLocalCount(), zone_); 1904 ZoneList<Variable*> context_list(current_scope->ContextLocalCount(), zone_);
1905 ZoneList<Variable*> globals_list(current_scope->ContextGlobalCount(), 1905 ZoneList<Variable*> globals_list(current_scope->ContextGlobalCount(),
1906 zone_); 1906 zone_);
1907 current_scope->CollectStackAndContextLocals(&stack_list, &context_list, 1907 current_scope->CollectVariables(&stack_list, &context_list, &globals_list);
1908 &globals_list);
1909 context_list.Sort(&Variable::CompareIndex); 1908 context_list.Sort(&Variable::CompareIndex);
1910 1909
1911 for (int i = 0; i < context_list.length(); i++) { 1910 for (int i = 0; i < context_list.length(); i++) {
1912 SetElementSloppy(scope_info_list, scope_info_length, 1911 SetElementSloppy(scope_info_list, scope_info_length,
1913 context_list[i]->name()); 1912 context_list[i]->name());
1914 scope_info_length++; 1913 scope_info_length++;
1915 SetElementSloppy( 1914 SetElementSloppy(
1916 scope_info_list, scope_info_length, 1915 scope_info_list, scope_info_length,
1917 Handle<Smi>(Smi::FromInt(context_list[i]->index()), isolate_)); 1916 Handle<Smi>(Smi::FromInt(context_list[i]->index()), isolate_));
1918 scope_info_length++; 1917 scope_info_length++;
1919 } 1918 }
1920 SetElementSloppy(scope_info_list, scope_info_length, 1919 SetElementSloppy(scope_info_list, scope_info_length,
1921 Handle<Object>(isolate_->heap()->null_value(), isolate_)); 1920 Handle<Object>(isolate_->heap()->null_value(), isolate_));
1922 scope_info_length++; 1921 scope_info_length++;
1923 1922
1924 current_scope = current_scope->outer_scope(); 1923 current_scope = current_scope->outer_scope();
1925 } 1924 }
1926 1925
1927 return scope_info_list; 1926 return scope_info_list;
1928 } 1927 }
1929 1928
1930 } // namespace internal 1929 } // namespace internal
1931 } // namespace v8 1930 } // namespace v8
OLDNEW
« src/ast/scopes.cc ('K') | « src/crankshaft/typing.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698