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

Unified Diff: src/base/flags.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 | « no previous file | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/flags.h
diff --git a/src/base/flags.h b/src/base/flags.h
index 467ecf67c953dbb810ee69f03109a0279dc939ea..4d9e14e5f913fc8a8b8c9bb6fb88ca55b5150896 100644
--- a/src/base/flags.h
+++ b/src/base/flags.h
@@ -5,6 +5,8 @@
#ifndef V8_BASE_FLAGS_H_
#define V8_BASE_FLAGS_H_
+#include <cstddef>
+
#include "src/base/compiler-specific.h"
namespace v8 {
@@ -30,6 +32,13 @@ class Flags final {
: mask_(static_cast<S>(flag)) {}
explicit Flags(mask_type mask) : mask_(static_cast<S>(mask)) {}
+ bool operator==(flag_type flag) const {
+ return mask_ == static_cast<S>(flag);
+ }
+ bool operator!=(flag_type flag) const {
+ return mask_ != static_cast<S>(flag);
+ }
+
Flags& operator&=(const Flags& flags) {
mask_ &= flags.mask_;
return *this;
@@ -60,6 +69,8 @@ class Flags final {
operator mask_type() const { return mask_; }
bool operator!() const { return !mask_; }
+ friend size_t hash_value(const Flags& flags) { return flags.mask_; }
+
private:
mask_type mask_;
};
« no previous file with comments | « no previous file | src/compiler/ast-graph-builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698