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

Unified Diff: src/interpreter/bytecode-generator.cc

Issue 1523423003: [Interpreter] Marks that 'throw' has returned a value. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698