| Index: src/full-codegen.cc
|
| diff --git a/src/full-codegen.cc b/src/full-codegen.cc
|
| index 8c2f0d178fdfc1ee6c26a9bc462de02f7b4ffd67..bb9cffe54a1b8e3f94d34a8328438e7095398f82 100644
|
| --- a/src/full-codegen.cc
|
| +++ b/src/full-codegen.cc
|
| @@ -101,6 +101,11 @@ void BreakableStatementChecker::VisitExitContextStatement(
|
| }
|
|
|
|
|
| +void BreakableStatementChecker::VisitExitScopedBlockStatement(
|
| + ExitScopedBlockStatement* stmt) {
|
| +}
|
| +
|
| +
|
| void BreakableStatementChecker::VisitSwitchStatement(SwitchStatement* stmt) {
|
| // Switch statements breakable if the tag expression is.
|
| Visit(stmt->tag());
|
| @@ -975,6 +980,21 @@ void FullCodeGenerator::VisitExitContextStatement(ExitContextStatement* stmt) {
|
| }
|
|
|
|
|
| +void FullCodeGenerator::VisitExitScopedBlockStatement(
|
| + ExitScopedBlockStatement* stmt) {
|
| + Comment cmnt(masm_, "[ ExitScopedBlockStatement");
|
| + SetStatementPosition(stmt);
|
| +
|
| + if (scope()->num_heap_slots() > 0) {
|
| + // Pop context.
|
| + LoadContextField(context_register(), Context::PREVIOUS_INDEX);
|
| + // Update local stack frame context field.
|
| + StoreToFrameField(StandardFrameConstants::kContextOffset,
|
| + context_register());
|
| + }
|
| +}
|
| +
|
| +
|
| void FullCodeGenerator::VisitDoWhileStatement(DoWhileStatement* stmt) {
|
| Comment cmnt(masm_, "[ DoWhileStatement");
|
| SetStatementPosition(stmt);
|
| @@ -1106,14 +1126,18 @@ void FullCodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
|
| __ Call(&try_handler_setup);
|
| // Try handler code, exception in result register.
|
|
|
| - // Extend the context before executing the catch block.
|
| - { Comment cmnt(masm_, "[ Extend catch context");
|
| + if (stmt->scope()->num_heap_slots() > 0) {
|
| + // Extend the context before executing the catch block.
|
| + Comment cmnt(masm_, "[ Extend catch context");
|
| __ Push(stmt->variable()->name());
|
| __ push(result_register());
|
| PushFunctionArgumentForContextAllocation();
|
| __ CallRuntime(Runtime::kPushCatchContext, 3);
|
| StoreToFrameField(StandardFrameConstants::kContextOffset,
|
| context_register());
|
| + } else {
|
| + // Assign exception value to the stack allocated catch variable.
|
| + EmitVariableAssignment(stmt->variable(), Token::ASSIGN);
|
| }
|
|
|
| Scope* saved_scope = scope();
|
|
|