| Index: src/compiler/common-operator.cc
|
| diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc
|
| index 874ad29cef7d9efa7129fcd92e55333755159a1a..bf6b49eea29147c3d0a8ce94eddb2a413905441e 100644
|
| --- a/src/compiler/common-operator.cc
|
| +++ b/src/compiler/common-operator.cc
|
| @@ -36,6 +36,21 @@ BranchHint BranchHintOf(const Operator* const op) {
|
| }
|
|
|
|
|
| +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";
|
| + }
|
| + UNREACHABLE();
|
| + return os;
|
| +}
|
| +
|
| +
|
| bool operator==(SelectParameters const& lhs, SelectParameters const& rhs) {
|
| return lhs.type() == rhs.type() && lhs.hint() == rhs.hint();
|
| }
|
| @@ -105,7 +120,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 +224,18 @@ struct CommonOperatorGlobalCache final {
|
| CACHED_OP_LIST(CACHED)
|
| #undef CACHED
|
|
|
| + template <IfExceptionHint kCaughtLocally>
|
| + struct IfExceptionOperator final : public Operator1<IfExceptionHint> {
|
| + IfExceptionOperator()
|
| + : Operator1<IfExceptionHint>( // --
|
| + IrOpcode::kIfException, Operator::kKontrol, // opcode
|
| + "IfException", // name
|
| + 0, 0, 1, 1, 0, 1, // counts
|
| + kCaughtLocally) {} // parameter
|
| + };
|
| + IfExceptionOperator<IfExceptionHint::kLocallyCaught> kIfExceptionCOperator;
|
| + IfExceptionOperator<IfExceptionHint::kLocallyUncaught> kIfExceptionUOperator;
|
| +
|
| template <size_t kInputCount>
|
| struct EndOperator final : public Operator {
|
| EndOperator()
|
| @@ -385,6 +411,18 @@ const Operator* CommonOperatorBuilder::Branch(BranchHint hint) {
|
| }
|
|
|
|
|
| +const Operator* CommonOperatorBuilder::IfException(IfExceptionHint hint) {
|
| + switch (hint) {
|
| + case IfExceptionHint::kLocallyCaught:
|
| + return &cache_.kIfExceptionCOperator;
|
| + case IfExceptionHint::kLocallyUncaught:
|
| + return &cache_.kIfExceptionUOperator;
|
| + }
|
| + 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( // --
|
|
|