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

Unified Diff: src/ast/scopes.cc

Issue 2314483002: Store the ScopeInfo in WithContexts (Closed)
Patch Set: updates 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/scopes.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | 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 e3d2afa2a31cdd0928a7a99dc73d353ff78249eb..292916d6a6fb9bdfd69495731a78d8132a66654a 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -92,20 +92,14 @@ void SloppyBlockFunctionMap::Declare(Zone* zone, const AstRawString* name,
// ----------------------------------------------------------------------------
// Implementation of Scope
-Scope::Scope(Zone* zone, ScopeType scope_type)
+Scope::Scope(Zone* zone)
: zone_(zone),
outer_scope_(nullptr),
variables_(zone),
locals_(4, zone),
decls_(4, zone),
- scope_type_(scope_type) {
- DCHECK(scope_type == SCRIPT_SCOPE || scope_type == WITH_SCOPE);
+ scope_type_(SCRIPT_SCOPE) {
SetDefaults();
-#ifdef DEBUG
- if (scope_type == WITH_SCOPE) {
- already_resolved_ = true;
- }
-#endif
}
Scope::Scope(Zone* zone, Scope* outer_scope, ScopeType scope_type)
@@ -325,7 +319,8 @@ Scope* Scope::DeserializeScopeChain(Isolate* isolate, Zone* zone,
while (!context->IsNativeContext()) {
if (context->IsWithContext() || context->IsDebugEvaluateContext()) {
// For scope analysis, debug-evaluate is equivalent to a with scope.
- outer_scope = new (zone) Scope(zone, WITH_SCOPE);
+ outer_scope = new (zone)
+ Scope(zone, WITH_SCOPE, Handle<ScopeInfo>(context->scope_info()));
// TODO(yangguo): Remove once debug-evaluate properly keeps track of the
// function scope in which we are evaluating.
« no previous file with comments | « src/ast/scopes.h ('k') | src/compiler/ast-graph-builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698