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

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

Issue 1607433005: [interpreter] Implement exception handler table building. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added moar tests. 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/bytecode-generator.cc ('k') | src/interpreter/control-flow-builders.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/interpreter/control-flow-builders.h
diff --git a/src/interpreter/control-flow-builders.h b/src/interpreter/control-flow-builders.h
index 24a7dfe3e5bf35730c2dbd23a0d411f8ac14a84a..2de3887a64be0a8a45cab19fcea6f26bf1efff61 100644
--- a/src/interpreter/control-flow-builders.h
+++ b/src/interpreter/control-flow-builders.h
@@ -144,6 +144,39 @@ class SwitchBuilder final : public BreakableControlFlowBuilder {
ZoneVector<BytecodeLabel> case_sites_;
};
+
+// A class to help with co-ordinating control flow in try-catch statements.
+class TryCatchBuilder final : public ControlFlowBuilder {
+ public:
+ explicit TryCatchBuilder(BytecodeArrayBuilder* builder)
+ : ControlFlowBuilder(builder), handler_id_(builder->NewHandlerEntry()) {}
+
+ void BeginTry(Register context);
+ void EndTry();
+ void EndCatch();
+
+ private:
+ int handler_id_;
+ BytecodeLabel handler_;
+ BytecodeLabel exit_;
+};
+
+
+// A class to help with co-ordinating control flow in try-finally statements.
+class TryFinallyBuilder final : public ControlFlowBuilder {
+ public:
+ explicit TryFinallyBuilder(BytecodeArrayBuilder* builder)
+ : ControlFlowBuilder(builder), handler_id_(builder->NewHandlerEntry()) {}
+
+ void BeginTry(Register context);
+ void EndTry();
+ void EndFinally();
+
+ private:
+ int handler_id_;
+ BytecodeLabel handler_;
+};
+
} // namespace interpreter
} // namespace internal
} // namespace v8
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | src/interpreter/control-flow-builders.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698