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

Unified Diff: src/compiler/type-hints.h

Issue 1494973002: [turbofan] Introduce ToBooleanHints on ToBoolean operators. (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/type-hint-analyzer.cc ('k') | src/compiler/type-hints.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/type-hints.h
diff --git a/src/compiler/type-hints.h b/src/compiler/type-hints.h
index be8f6f75829d2334188da5bac301662b233800a5..f1cc64036c16ccc63b5dca4952d5accdbc5df0ab 100644
--- a/src/compiler/type-hints.h
+++ b/src/compiler/type-hints.h
@@ -5,6 +5,7 @@
#ifndef V8_COMPILER_TYPE_HINTS_H_
#define V8_COMPILER_TYPE_HINTS_H_
+#include "src/base/flags.h"
#include "src/utils.h"
namespace v8 {
@@ -51,6 +52,31 @@ class BinaryOperationHints final {
std::ostream& operator<<(std::ostream&, BinaryOperationHints::Hint);
std::ostream& operator<<(std::ostream&, BinaryOperationHints);
+
+// Type hints for the ToBoolean type conversion.
+enum class ToBooleanHint : uint16_t {
+ kNone = 0u,
+ kUndefined = 1u << 0,
+ kBoolean = 1u << 1,
+ kNull = 1u << 2,
+ kSmallInteger = 1u << 3,
+ kReceiver = 1u << 4,
+ kString = 1u << 5,
+ kSymbol = 1u << 6,
+ kHeapNumber = 1u << 7,
+ kSimdValue = 1u << 8,
+ kAny = kUndefined | kBoolean | kNull | kSmallInteger | kReceiver | kString |
+ kSymbol | kHeapNumber | kSimdValue
+};
+
+std::ostream& operator<<(std::ostream&, ToBooleanHint);
+
+typedef base::Flags<ToBooleanHint, uint16_t> ToBooleanHints;
+
+std::ostream& operator<<(std::ostream&, ToBooleanHints);
+
+DEFINE_OPERATORS_FOR_FLAGS(ToBooleanHints)
+
} // namespace compiler
} // namespace internal
} // namespace v8
« no previous file with comments | « src/compiler/type-hint-analyzer.cc ('k') | src/compiler/type-hints.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698