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

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

Issue 2161263003: [debug] use catch prediction flag for promise rejections. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 f63c073c2c5c1aab55fa3fe903f82fdfa939cf99..0a1510ee4ef19dea0b11b3eef4b7f92db901da6e 100644
--- a/src/compiler/common-operator.cc
+++ b/src/compiler/common-operator.cc
@@ -75,15 +75,31 @@ DeoptimizeParameters const& DeoptimizeParametersOf(Operator const* const op) {
return OpParameter<DeoptimizeParameters>(op);
}
+IfExceptionHint ExceptionHintFromCatchPrediction(
+ HandlerTable::CatchPrediction prediction) {
+ switch (prediction) {
+ case HandlerTable::UNCAUGHT:
+ return IfExceptionHint::kLocallyUncaught;
+ case HandlerTable::CAUGHT:
+ return IfExceptionHint::kLocallyCaught;
+ case HandlerTable::PROMISE:
+ return IfExceptionHint::kLocallyCaughtForPromiseReject;
+ }
+ UNREACHABLE();
+ return IfExceptionHint::kLocallyUncaught;
+}
+
size_t hash_value(IfExceptionHint hint) { return static_cast<size_t>(hint); }
std::ostream& operator<<(std::ostream& os, IfExceptionHint hint) {
switch (hint) {
- case IfExceptionHint::kLocallyCaught:
- return os << "Caught";
case IfExceptionHint::kLocallyUncaught:
return os << "Uncaught";
+ case IfExceptionHint::kLocallyCaught:
+ return os << "Caught";
+ case IfExceptionHint::kLocallyCaughtForPromiseReject:
+ return os << "CaughtForPromiseReject";
}
UNREACHABLE();
return os;
@@ -345,8 +361,10 @@ struct CommonOperatorGlobalCache final {
0, 1, 1, 1, 1, 1, // counts
kCaughtLocally) {} // parameter
};
- IfExceptionOperator<IfExceptionHint::kLocallyCaught> kIfExceptionCOperator;
IfExceptionOperator<IfExceptionHint::kLocallyUncaught> kIfExceptionUOperator;
+ IfExceptionOperator<IfExceptionHint::kLocallyCaught> kIfExceptionCOperator;
+ IfExceptionOperator<IfExceptionHint::kLocallyCaughtForPromiseReject>
+ kIfExceptionPOperator;
template <size_t kInputCount>
struct EndOperator final : public Operator {
@@ -602,10 +620,12 @@ const Operator* CommonOperatorBuilder::DeoptimizeUnless(
const Operator* CommonOperatorBuilder::IfException(IfExceptionHint hint) {
switch (hint) {
- case IfExceptionHint::kLocallyCaught:
- return &cache_.kIfExceptionCOperator;
case IfExceptionHint::kLocallyUncaught:
return &cache_.kIfExceptionUOperator;
+ case IfExceptionHint::kLocallyCaught:
+ return &cache_.kIfExceptionCOperator;
+ case IfExceptionHint::kLocallyCaughtForPromiseReject:
+ return &cache_.kIfExceptionPOperator;
}
UNREACHABLE();
return nullptr;

Powered by Google App Engine
This is Rietveld 408576698