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

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

Issue 2161543002: [turbofan] Add support for eager/soft deoptimization reasons. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Do the ports properly 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
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/common-operator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator.h
diff --git a/src/compiler/common-operator.h b/src/compiler/common-operator.h
index 0357de60da00da2d1724a1200bee0d0766abd2fa..620ca57f90bfb8ab39907a63fdd72eb27edca60c 100644
--- a/src/compiler/common-operator.h
+++ b/src/compiler/common-operator.h
@@ -7,6 +7,7 @@
#include "src/assembler.h"
#include "src/compiler/frame-states.h"
+#include "src/deoptimize-reason.h"
#include "src/machine-type.h"
#include "src/zone-containers.h"
@@ -42,6 +43,8 @@ std::ostream& operator<<(std::ostream&, BranchHint);
BranchHint BranchHintOf(const Operator* const);
+// Deoptimize reason for Deoptimize, DeoptimizeIf and DeoptimizeUnless.
+DeoptimizeReason DeoptimizeReasonOf(Operator const* const);
// Deoptimize bailout kind.
enum class DeoptimizeKind : uint8_t { kEager, kSoft };
@@ -50,8 +53,28 @@ size_t hash_value(DeoptimizeKind kind);
std::ostream& operator<<(std::ostream&, DeoptimizeKind);
-DeoptimizeKind DeoptimizeKindOf(const Operator* const);
+// Parameters for the {Deoptimize} operator.
+class DeoptimizeParameters final {
+ public:
+ DeoptimizeParameters(DeoptimizeKind kind, DeoptimizeReason reason)
+ : kind_(kind), reason_(reason) {}
+
+ DeoptimizeKind kind() const { return kind_; }
+ DeoptimizeReason reason() const { return reason_; }
+
+ private:
+ DeoptimizeKind const kind_;
+ DeoptimizeReason const reason_;
+};
+
+bool operator==(DeoptimizeParameters, DeoptimizeParameters);
+bool operator!=(DeoptimizeParameters, DeoptimizeParameters);
+
+size_t hast_value(DeoptimizeParameters p);
+
+std::ostream& operator<<(std::ostream&, DeoptimizeParameters p);
+DeoptimizeParameters const& DeoptimizeParametersOf(Operator const* const);
// Prediction whether throw-site is surrounded by any local catch-scope.
enum class IfExceptionHint { kLocallyUncaught, kLocallyCaught };
@@ -170,9 +193,9 @@ class CommonOperatorBuilder final : public ZoneObject {
const Operator* IfValue(int32_t value);
const Operator* IfDefault();
const Operator* Throw();
- const Operator* Deoptimize(DeoptimizeKind kind);
- const Operator* DeoptimizeIf();
- const Operator* DeoptimizeUnless();
+ const Operator* Deoptimize(DeoptimizeKind kind, DeoptimizeReason reason);
+ const Operator* DeoptimizeIf(DeoptimizeReason reason);
+ const Operator* DeoptimizeUnless(DeoptimizeReason reason);
const Operator* Return(int value_input_count = 1);
const Operator* Terminate();
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/common-operator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698