Index: src/unique.h |
diff --git a/src/unique.h b/src/unique.h |
index 619c3c9c36fc6ee1feab8cfabd8990dc0c33419a..9232f859708366d7a3d8a7a702eeb86deefb0d00 100644 |
--- a/src/unique.h |
+++ b/src/unique.h |
@@ -5,9 +5,11 @@ |
#ifndef V8_HYDROGEN_UNIQUE_H_ |
#define V8_HYDROGEN_UNIQUE_H_ |
+#include <ostream> // NOLINT(readability/streams) |
+ |
+#include "src/base/functional.h" |
#include "src/handles-inl.h" // TODO(everyone): Fix our inl.h crap |
#include "src/objects-inl.h" // TODO(everyone): Fix our inl.h crap |
-#include "src/string-stream.h" |
#include "src/utils.h" |
#include "src/zone.h" |
@@ -81,6 +83,11 @@ class Unique { |
return raw_address_ != other.raw_address_; |
} |
+ friend inline size_t hash_value(Unique<T> const& unique) { |
+ DCHECK(unique.IsInitialized()); |
+ return base::hash<void*>()(unique.raw_address_); |
+ } |
+ |
inline intptr_t Hashcode() const { |
DCHECK(IsInitialized()); |
return reinterpret_cast<intptr_t>(raw_address_); |
@@ -128,6 +135,11 @@ class Unique { |
friend class SideEffectsTracker; |
}; |
+template <typename T> |
+inline std::ostream& operator<<(std::ostream& os, Unique<T> uniq) { |
+ return os << Brief(*uniq.handle()); |
+} |
+ |
template <typename T> |
class UniqueSet FINAL : public ZoneObject { |