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

Unified Diff: src/parser.cc

Issue 7860045: Stack allocating block scoped variables. Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on tip of tree. Created 9 years, 1 month 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/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 02fa25b192372665f4211f43ed09a634353e01be..ffbf9d9f8c5cada1a546a09d350cf7037ef6c07f 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3011,7 +3011,18 @@ Expression* Parser::ParseLeftHandSideExpression(bool* ok) {
VariableProxy* callee = result->AsVariableProxy();
if (callee != NULL &&
callee->IsVariable(isolate()->factory()->eval_symbol())) {
- top_scope_->DeclarationScope()->RecordEvalCall();
+ if (FLAG_harmony_scoping) {
+ Scope* scope = top_scope_;
+ while (!scope->calls_eval() &&
+ !scope->is_declaration_scope()) {
+ scope->RecordEvalCall();
+ scope = scope->outer_scope();
+ }
+ // Make sure to record the eval call in the declaration scope.
+ scope->RecordEvalCall();
+ } else {
+ top_scope_->DeclarationScope()->RecordEvalCall();
+ }
}
result = NewCall(result, args, pos);
break;
« no previous file with comments | « src/objects.h ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698