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

Unified Diff: src/compiler/bytecode-graph-builder.cc

Issue 1481763002: [Interpreter] Adds support for throw to bytecode graph builder. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed review comments. Added TryCatch Scope instead of try-catch wrapper to test Throw. Created 5 years, 1 month 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
Index: src/compiler/bytecode-graph-builder.cc
diff --git a/src/compiler/bytecode-graph-builder.cc b/src/compiler/bytecode-graph-builder.cc
index 47a22df239854b4ef2568736d4c8bcaa87a2a32a..e599cfe8eea2324b182362e616628b94422d7d2b 100644
--- a/src/compiler/bytecode-graph-builder.cc
+++ b/src/compiler/bytecode-graph-builder.cc
@@ -816,7 +816,13 @@ void BytecodeGraphBuilder::VisitNew(
void BytecodeGraphBuilder::VisitThrow(
const interpreter::BytecodeArrayIterator& iterator) {
- UNIMPLEMENTED();
+ Node* value = environment()->LookupAccumulator();
+ // TODO(mythria): Change it Runtime::kThrow when we have deoptimization
+ // information.
+ NewNode(javascript()->CallRuntime(Runtime::kReThrow, 1), value);
+ Node* control = NewNode(common()->Throw(), value);
+ UpdateControlDependencyToLeaveFunction(control);
+ environment()->BindAccumulator(value);
}

Powered by Google App Engine
This is Rietveld 408576698