Chromium Code Reviews| Index: src/interpreter/bytecode-generator.cc |
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
| index 9698773dda5693dc1b7c36b50d0388e15a05373e..820db85111f001ef10ad4ebd9f3f8164c37bcc2b 100644 |
| --- a/src/interpreter/bytecode-generator.cc |
| +++ b/src/interpreter/bytecode-generator.cc |
| @@ -409,7 +409,7 @@ void BytecodeGenerator::MakeBytecodeBody() { |
| // Visit illegal re-declaration and bail out if it exists. |
| if (scope()->HasIllegalRedeclaration()) { |
| - Visit(scope()->GetIllegalRedeclaration()); |
| + VisitForEffect(scope()->GetIllegalRedeclaration()); |
|
mythria
2016/01/19 10:48:04
GetIllegalRedeclaration is an expression, so I add
rmcilroy
2016/01/19 11:45:55
SGTM
Michael Starzinger
2016/01/19 11:45:59
Acknowledged.
|
| return; |
| } |
| @@ -1480,6 +1480,11 @@ void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } |
| void BytecodeGenerator::VisitThrow(Throw* expr) { |
| VisitForAccumulatorValue(expr->exception()); |
| builder()->Throw(); |
| + // Throw statments are modeled as expression instead of statments. These are |
| + // converted to assignment statements in Rewriter::ReWrite pass. An |
|
Michael Starzinger
2016/01/19 11:45:59
nit: s/to/from/
mythria
2016/01/20 13:45:10
Done.
|
| + // assignment statement expects a value in the accumulator. This is a hack to |
| + // avoid DCHECK fails assert accumulator has been set. |
| + execution_result()->SetResultInAccumulator(); |
| } |