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

Unified Diff: src/ast/scopes.h

Issue 2294193003: Unify DeclarationScope::Analyze (Closed)
Patch Set: Created 4 years, 4 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 | src/ast/scopes.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.h
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 51b3e41f9e0606c395d8ba3f44db9ffb8af5f170..619c5ec48985174cf72009f80310cc757d74e30d 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -40,6 +40,7 @@ class SloppyBlockFunctionMap : public ZoneHashMap {
SloppyBlockFunctionStatement* statement);
};
+enum class AnalyzeMode { kRegular, kDebugger };
// Global invariants after AST construction: Each reference (i.e. identifier)
// to a JavaScript variable (including global properties) is represented by a
@@ -545,7 +546,7 @@ class Scope: public ZoneObject {
void AllocateNonParameterLocalsAndDeclaredGlobals();
void AllocateVariablesRecursively();
- void AllocateScopeInfosRecursively(Isolate* isolate, bool for_debugger);
+ void AllocateScopeInfosRecursively(Isolate* isolate, AnalyzeMode mode);
// Construct a scope based on the scope info.
Scope(Zone* zone, ScopeType type, Handle<ScopeInfo> scope_info);
@@ -752,10 +753,7 @@ class DeclarationScope : public Scope {
// Compute top scope and allocate variables. For lazy compilation the top
// scope only contains the single lazily compiled function, so this
// doesn't re-allocate variables repeatedly.
- static void Analyze(ParseInfo* info);
-
- // Version used by the debugger that creates extra ScopeInfos.
- static void AnalyzeForDebugger(ParseInfo* info);
+ static void Analyze(ParseInfo* info, AnalyzeMode mode);
// To be called during parsing. Do just enough scope analysis that we can
// discard the Scope for lazily compiled functions. In particular, this
@@ -802,7 +800,7 @@ class DeclarationScope : public Scope {
// In the case of code compiled and run using 'eval', the context
// parameter is the context in which eval was called. In all other
// cases the context parameter is an empty handle.
- void AllocateVariables(ParseInfo* info, bool for_debugger);
+ void AllocateVariables(ParseInfo* info, AnalyzeMode mode);
void SetDefaults();
« no previous file with comments | « no previous file | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698