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

Unified Diff: src/compiler/common-operator.cc

Issue 1158563008: [turbofan] Introduce prediction for exception handlers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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
Index: src/compiler/common-operator.cc
diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc
index 874ad29cef7d9efa7129fcd92e55333755159a1a..f716109c04bc5b9af5a212a8ad05f9d33b2ca5a7 100644
--- a/src/compiler/common-operator.cc
+++ b/src/compiler/common-operator.cc
@@ -105,7 +105,6 @@ std::ostream& operator<<(std::ostream& os, ParameterInfo const& i) {
V(IfTrue, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
V(IfFalse, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
V(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
- V(IfException, Operator::kKontrol, 0, 0, 1, 1, 0, 1) \
V(IfDefault, Operator::kKontrol, 0, 0, 1, 0, 0, 1) \
V(Throw, Operator::kKontrol, 1, 1, 1, 0, 0, 1) \
V(Deoptimize, Operator::kNoThrow, 1, 1, 1, 0, 0, 1) \
@@ -210,6 +209,18 @@ struct CommonOperatorGlobalCache final {
CACHED_OP_LIST(CACHED)
#undef CACHED
+ template <bool kCaughtLocally>
+ struct IfExceptionOperator final : public Operator1<bool> {
+ IfExceptionOperator()
+ : Operator1<bool>( // --
+ IrOpcode::kIfException, Operator::kKontrol, // opcode
+ "IfException", // name
+ 0, 0, 1, 1, 0, 1, // counts
+ kCaughtLocally) {} // parameter
+ };
+ IfExceptionOperator<false> kLocallyUncaugthIfExceptionOperator;
+ IfExceptionOperator<true> kLocallyCaugthIfExceptionOperator;
+
template <size_t kInputCount>
struct EndOperator final : public Operator {
EndOperator()
@@ -385,6 +396,17 @@ const Operator* CommonOperatorBuilder::Branch(BranchHint hint) {
}
+const Operator* CommonOperatorBuilder::IfException(bool locally_caught) {
+ if (locally_caught) {
+ return &cache_.kLocallyCaugthIfExceptionOperator;
+ } else {
+ return &cache_.kLocallyUncaugthIfExceptionOperator;
+ }
+ UNREACHABLE();
+ return nullptr;
+}
+
+
const Operator* CommonOperatorBuilder::Switch(size_t control_output_count) {
DCHECK_GE(control_output_count, 3u); // Disallow trivial switches.
return new (zone()) Operator( // --

Powered by Google App Engine
This is Rietveld 408576698