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

Unified Diff: src/unique.h

Issue 636893002: [turbofan] Drop broken StaticParameterTraits. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix typo... Created 6 years, 2 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/runtime/runtime.cc ('k') | src/utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 {
« no previous file with comments | « src/runtime/runtime.cc ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698