| Index: src/interpreter/bytecode-generator.cc
|
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc
|
| index 4ef0506a12388cf0f534058b33b98e21f3689169..c5b8bf43bdcd9439a4e90f0e88343d67b70b164c 100644
|
| --- a/src/interpreter/bytecode-generator.cc
|
| +++ b/src/interpreter/bytecode-generator.cc
|
| @@ -1107,6 +1107,7 @@ void BytecodeGenerator::VisitForOfStatement(ForOfStatement* stmt) {
|
|
|
| void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
|
| TryCatchBuilder try_control_builder(builder());
|
| + Register no_reg;
|
|
|
| // Preserve the context in a dedicated register, so that it can be restored
|
| // when the handler is entered by the stack-unwinding machinery.
|
| @@ -1122,11 +1123,15 @@ void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
|
| }
|
| try_control_builder.EndTry();
|
|
|
| - // Clear message object as we enter the catch block.
|
| - // TODO(mstarzinger): Implement this!
|
| -
|
| // Create a catch scope that binds the exception.
|
| VisitNewLocalCatchContext(stmt->variable());
|
| + builder()->StoreAccumulatorInRegister(context);
|
| +
|
| + // Clear message object as we enter the catch block.
|
| + builder()->CallRuntime(Runtime::kInterpreterClearPendingMessage, no_reg, 0);
|
| +
|
| + // Load the catch context into the accumulator.
|
| + builder()->LoadAccumulatorWithRegister(context);
|
|
|
| // Evaluate the catch-block.
|
| VisitInScope(stmt->catch_block(), stmt->scope());
|
| @@ -1136,6 +1141,7 @@ void BytecodeGenerator::VisitTryCatchStatement(TryCatchStatement* stmt) {
|
|
|
| void BytecodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
|
| TryFinallyBuilder try_control_builder(builder());
|
| + Register no_reg;
|
|
|
| // We keep a record of all paths that enter the finally-block to be able to
|
| // dispatch to the correct continuation point after the statements in the
|
| @@ -1179,7 +1185,7 @@ void BytecodeGenerator::VisitTryFinallyStatement(TryFinallyStatement* stmt) {
|
| try_control_builder.BeginFinally();
|
|
|
| // Clear message object as we enter the finally block.
|
| - // TODO(mstarzinger): Implement this!
|
| + builder()->CallRuntime(Runtime::kInterpreterClearPendingMessage, no_reg, 0);
|
|
|
| // Evaluate the finally-block.
|
| Visit(stmt->finally_block());
|
|
|