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

Unified Diff: src/ast/scopes.cc

Issue 2666053003: [scopes]: With --print-scopes, print preparsed scopes before destroying them. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index ad1c137753e475963467df4a934f414f9d649161..febca863076ba9c794b67b632a1325ee96ef8314 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -627,6 +627,7 @@ void DeclarationScope::Analyze(ParseInfo* info, AnalyzeMode mode) {
#ifdef DEBUG
if (info->script_is_native() ? FLAG_print_builtin_scopes
: FLAG_print_scopes) {
+ PrintF("Global scope:\n");
scope->Print();
}
scope->CheckScopePositions();
@@ -1424,6 +1425,12 @@ void DeclarationScope::AnalyzePartially(
CollectVariableData(preparsed_scope_data);
}
}
+#ifdef DEBUG
+ if (FLAG_print_scopes) {
+ PrintF("Inner function scope:\n");
+ Print();
+ }
+#endif
ResetAfterPreparsing(ast_node_factory->ast_value_factory(), false);
@@ -1509,6 +1516,10 @@ void PrintMap(int indent, const char* label, VariableMap* map, bool locals,
for (VariableMap::Entry* p = map->Start(); p != nullptr; p = map->Next(p)) {
Variable* var = reinterpret_cast<Variable*>(p->value);
if (var == function_var) continue;
+ if (var == kDummyPreParserVariable ||
+ var == kDummyPreParserLexicalVariable) {
+ continue;
+ }
bool local = !IsDynamicVariableMode(var->mode());
if ((locals ? local : !local) &&
(var->is_used() || !var->IsUnallocated())) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698