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

Unified Diff: src/deoptimize-reason.cc

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/deoptimize-reason.h ('k') | src/deoptimizer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/deoptimize-reason.cc
diff --git a/src/deoptimize-reason.cc b/src/deoptimize-reason.cc
new file mode 100644
index 0000000000000000000000000000000000000000..87c8905ff8f1d6e22a6eca23ca98d73de1030b63
--- /dev/null
+++ b/src/deoptimize-reason.cc
@@ -0,0 +1,38 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "src/deoptimize-reason.h"
+
+namespace v8 {
+namespace internal {
+
+std::ostream& operator<<(std::ostream& os, DeoptimizeReason reason) {
+ switch (reason) {
+#define DEOPTIMIZE_REASON(Name, message) \
+ case DeoptimizeReason::k##Name: \
+ return os << #Name;
+ DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
+#undef DEOPTIMIZE_REASON
+ }
+ UNREACHABLE();
+ return os;
+}
+
+size_t hash_value(DeoptimizeReason reason) {
+ return static_cast<uint8_t>(reason);
+}
+
+char const* const DeoptimizeReasonToString(DeoptimizeReason reason) {
+ static char const* kDeoptimizeReasonStrings[] = {
+#define DEOPTIMIZE_REASON(Name, message) message,
+ DEOPTIMIZE_REASON_LIST(DEOPTIMIZE_REASON)
+#undef DEOPTIMIZE_REASON
+ };
+ size_t const index = static_cast<size_t>(reason);
+ DCHECK_LT(index, arraysize(kDeoptimizeReasonStrings));
+ return kDeoptimizeReasonStrings[index];
+}
+
+} // namespace internal
+} // namespace v8
« no previous file with comments | « src/deoptimize-reason.h ('k') | src/deoptimizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698