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

Unified Diff: src/full-codegen.cc

Issue 7835027: Getting rid of ExitContextStatement for scoped blocks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | « no previous file | src/parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen.cc
diff --git a/src/full-codegen.cc b/src/full-codegen.cc
index 960b4b1aa15808c08fce252d4725c81f2768692e..4f1abbe6bece309bfa79e088856175c16f05890a 100644
--- a/src/full-codegen.cc
+++ b/src/full-codegen.cc
@@ -855,6 +855,7 @@ void FullCodeGenerator::VisitBlock(Block* stmt) {
SetStatementPosition(stmt);
Scope* saved_scope = scope();
+ // Push a block context when entering a block with block scoped variables.
if (stmt->block_scope() != NULL) {
{ Comment cmnt(masm_, "[ Extend block context");
scope_ = stmt->block_scope();
@@ -873,6 +874,14 @@ void FullCodeGenerator::VisitBlock(Block* stmt) {
scope_ = saved_scope;
__ bind(nested_block.break_label());
PrepareForBailoutForId(stmt->ExitId(), NO_REGISTERS);
+
+ // Pop block context if necessary.
+ if (stmt->block_scope() != NULL) {
+ LoadContextField(context_register(), Context::PREVIOUS_INDEX);
+ // Update local stack frame context field.
+ StoreToFrameField(StandardFrameConstants::kContextOffset,
+ context_register());
+ }
}
« no previous file with comments | « no previous file | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698