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

Unified Diff: src/scopes.cc

Issue 19569003: Do not materialize context-allocated values for debug-evaluate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: improved test Created 7 years, 5 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/runtime.cc ('k') | test/mjsunit/debug-evaluate-closure.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scopes.cc
diff --git a/src/scopes.cc b/src/scopes.cc
index 6ae7cc0691ae2e36fc194856d535e27383d458ee..e631332d5c37ca84c9d57dad36de060b9ef047c3 100644
--- a/src/scopes.cc
+++ b/src/scopes.cc
@@ -970,6 +970,13 @@ Variable* Scope::LookupRecursive(Handle<String> name,
BindingKind* binding_kind,
AstNodeFactory<AstNullVisitor>* factory) {
ASSERT(binding_kind != NULL);
+ if (already_resolved() && is_with_scope()) {
+ // Short-cut: if the scope is deserialized from a scope info, variable
+ // allocation is already fixed. We can simply return with dynamic lookup.
+ *binding_kind = DYNAMIC_LOOKUP;
+ return NULL;
+ }
+
// Try to find the variable in this scope.
Variable* var = LocalLookup(name);
@@ -998,6 +1005,7 @@ Variable* Scope::LookupRecursive(Handle<String> name,
}
if (is_with_scope()) {
+ ASSERT(!already_resolved());
// The current scope is a with scope, so the variable binding can not be
// statically resolved. However, note that it was necessary to do a lookup
// in the outer scope anyway, because if a binding exists in an outer scope,
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/debug-evaluate-closure.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698