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

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
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 3e3779c3cfeba7ac16b0b93687ecb29c5a36e34a..bb75c5de402b7f49a9fd1e61786271fd243f9bcf 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -91,20 +91,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)
@@ -324,7 +318,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.

Powered by Google App Engine
This is Rietveld 408576698