Chromium Code Reviews| Index: src/interpreter/bytecode-generator.cc |
| diff --git a/src/interpreter/bytecode-generator.cc b/src/interpreter/bytecode-generator.cc |
| index 96b513c8b065e14b13ab504e113d8fd6ab9387b0..ada82a7c0043f053b3fc4fa08e9a4bb4cd7a115e 100644 |
| --- a/src/interpreter/bytecode-generator.cc |
| +++ b/src/interpreter/bytecode-generator.cc |
| @@ -1539,6 +1539,14 @@ void BytecodeGenerator::VisitYield(Yield* expr) { UNIMPLEMENTED(); } |
| void BytecodeGenerator::VisitThrow(Throw* expr) { |
| VisitForAccumulatorValue(expr->exception()); |
| builder()->Throw(); |
| + // For script and eval scopes expression statements are converted to |
| + // assignment statements in Rewriter::ReWrite pass. An assignment statement |
| + // expects a value in the accumulator. This is a hack to avoid DCHECK fails |
| + // assert accumulator has been set. |
| + if (info()->literal()->scope()->is_script_scope() || |
|
Michael Starzinger
2016/01/18 21:23:03
I wouldn't even narrow this to script or eval scop
mythria
2016/01/19 10:48:04
Done.
|
| + info()->literal()->scope()->is_eval_scope()) { |
| + execution_result()->SetResultInAccumulator(); |
| + } |
| } |