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

Unified Diff: src/interpreter/control-flow-builders.cc

Issue 1613443002: [interpreter] Implement handling of try-finally constructs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased. 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 | « src/interpreter/control-flow-builders.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/control-flow-builders.cc
diff --git a/src/interpreter/control-flow-builders.cc b/src/interpreter/control-flow-builders.cc
index b50360c8e713265ef8edab44f6c8cb66c7c1ba8b..c30fc6d0f676f3cb4b48aa52e94c8bdb16a90101 100644
--- a/src/interpreter/control-flow-builders.cc
+++ b/src/interpreter/control-flow-builders.cc
@@ -159,13 +159,31 @@ void TryFinallyBuilder::BeginTry(Register context) {
}
+void TryFinallyBuilder::LeaveTry() {
+ finalization_sites_.push_back(BytecodeLabel());
+ builder()->Jump(&finalization_sites_.back());
+}
+
+
void TryFinallyBuilder::EndTry() {
builder()->MarkTryEnd(handler_id_);
+}
+
+
+void TryFinallyBuilder::BeginHandler() {
builder()->Bind(&handler_);
builder()->MarkHandler(handler_id_, false);
}
+void TryFinallyBuilder::BeginFinally() {
+ for (size_t i = 0; i < finalization_sites_.size(); i++) {
+ BytecodeLabel& site = finalization_sites_.at(i);
+ builder()->Bind(&site);
+ }
+}
+
+
void TryFinallyBuilder::EndFinally() {
// Nothing to be done here.
}
« no previous file with comments | « src/interpreter/control-flow-builders.h ('k') | test/cctest/interpreter/test-bytecode-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698