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

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: Fixes nits and updates mjsunit.status and test262.status Created 4 years, 11 months 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 | test/mjsunit/mjsunit.status » ('j') | 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 f5df790e719cde0efe7fffef6f89e0328a9585c9..a716dd15a458664d4cf3435f5c17dd96fccc6f61 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());
return;
}
@@ -1521,6 +1521,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 from 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.
+ execution_result()->SetResultInAccumulator();
}
« no previous file with comments | « no previous file | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698