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

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

Issue 1690973002: [interpreter] Correctly thread through catch prediction. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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 d273c2509d5cdf35c4f65c6f1e112e03832b41bb..e4d376b9b21e90bdd1121589bcc28d6cc8de4924 100644
--- a/src/interpreter/control-flow-builders.h
+++ b/src/interpreter/control-flow-builders.h
@@ -165,10 +165,11 @@ class TryCatchBuilder final : public ControlFlowBuilder {
// A class to help with co-ordinating control flow in try-finally statements.
class TryFinallyBuilder final : public ControlFlowBuilder {
public:
- explicit TryFinallyBuilder(BytecodeArrayBuilder* builder)
+ explicit TryFinallyBuilder(BytecodeArrayBuilder* builder, bool will_catch)
: ControlFlowBuilder(builder),
handler_id_(builder->NewHandlerEntry()),
- finalization_sites_(builder->zone()) {}
+ finalization_sites_(builder->zone()),
+ will_catch_(will_catch) {}
void BeginTry(Register context);
void LeaveTry();
@@ -183,6 +184,11 @@ class TryFinallyBuilder final : public ControlFlowBuilder {
// Unbound labels that identify jumps to the finally block in the code.
ZoneVector<BytecodeLabel> finalization_sites_;
+
+ // Conservative prediction of whether exceptions thrown into the handler for
+ // this finally block will be caught. Note that such a prediction depends on
+ // whether this try-finally is nested inside a surrounding try-catch.
+ bool will_catch_;
};
} // namespace interpreter
« 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