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

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

Issue 1511883002: [turbofan] Add initial support for SOFT deopts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/compiler/common-operator.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator.cc
diff --git a/src/compiler/common-operator.cc b/src/compiler/common-operator.cc
index 2c7491751310c7c9d016b88540c1549f72cef0da..011bd2e683a9edcb777a6c8c1a88529f88984d9d 100644
--- a/src/compiler/common-operator.cc
+++ b/src/compiler/common-operator.cc
@@ -36,6 +36,27 @@ BranchHint BranchHintOf(const Operator* const op) {
}
+size_t hash_value(DeoptimizeKind kind) { return static_cast<size_t>(kind); }
+
+
+std::ostream& operator<<(std::ostream& os, DeoptimizeKind kind) {
+ switch (kind) {
+ case DeoptimizeKind::kEager:
+ return os << "Eager";
+ case DeoptimizeKind::kSoft:
+ return os << "Soft";
+ }
+ UNREACHABLE();
+ return os;
+}
+
+
+DeoptimizeKind DeoptimizeKindOf(const Operator* const op) {
+ DCHECK_EQ(IrOpcode::kDeoptimize, op->opcode());
+ return OpParameter<DeoptimizeKind>(op);
+}
+
+
size_t hash_value(IfExceptionHint hint) { return static_cast<size_t>(hint); }
@@ -122,7 +143,6 @@ std::ostream& operator<<(std::ostream& os, ParameterInfo const& i) {
V(IfSuccess, Operator::kKontrol, 0, 0, 1, 0, 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) \
V(Terminate, Operator::kKontrol, 0, 1, 1, 0, 0, 1) \
V(OsrNormalEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \
V(OsrLoopEntry, Operator::kFoldable, 0, 1, 1, 0, 1, 1) \
@@ -231,6 +251,18 @@ struct CommonOperatorGlobalCache final {
CACHED_OP_LIST(CACHED)
#undef CACHED
+ template <DeoptimizeKind kKind>
+ struct DeoptimizeOperator final : public Operator1<DeoptimizeKind> {
+ DeoptimizeOperator()
+ : Operator1<DeoptimizeKind>( // --
+ IrOpcode::kDeoptimize, Operator::kNoThrow, // opcode
+ "Deoptimize", // name
+ 1, 1, 1, 0, 0, 1, // counts
+ kKind) {} // parameter
+ };
+ DeoptimizeOperator<DeoptimizeKind::kEager> kDeoptimizeEagerOperator;
+ DeoptimizeOperator<DeoptimizeKind::kSoft> kDeoptimizeSoftOperator;
+
template <IfExceptionHint kCaughtLocally>
struct IfExceptionOperator final : public Operator1<IfExceptionHint> {
IfExceptionOperator()
@@ -448,6 +480,18 @@ const Operator* CommonOperatorBuilder::Branch(BranchHint hint) {
}
+const Operator* CommonOperatorBuilder::Deoptimize(DeoptimizeKind kind) {
+ switch (kind) {
+ case DeoptimizeKind::kEager:
+ return &cache_.kDeoptimizeEagerOperator;
+ case DeoptimizeKind::kSoft:
+ return &cache_.kDeoptimizeSoftOperator;
+ }
+ UNREACHABLE();
+ return nullptr;
+}
+
+
const Operator* CommonOperatorBuilder::IfException(IfExceptionHint hint) {
switch (hint) {
case IfExceptionHint::kLocallyCaught:
« no previous file with comments | « src/compiler/common-operator.h ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698