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

Unified Diff: src/handles.h

Issue 1314473007: [turbofan] Remove usage of Unique<T> from graph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebased and fixed. Created 5 years, 4 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/compiler/x87/instruction-selector-x87.cc ('k') | src/handles-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles.h
diff --git a/src/handles.h b/src/handles.h
index 2db18307dacad563b89a5ba3eea179eb43b9b85e..312b7506df0d0f01c51ec65214c036630b632380 100644
--- a/src/handles.h
+++ b/src/handles.h
@@ -6,6 +6,7 @@
#define V8_HANDLES_H_
#include "include/v8.h"
+#include "src/base/functional.h"
#include "src/base/macros.h"
#include "src/checks.h"
#include "src/globals.h"
@@ -118,6 +119,20 @@ class Handle final : public HandleBase {
// MaybeHandle to force validation before being used as handles.
static const Handle<T> null() { return Handle<T>(); }
+ // Provide function object for location equality comparison.
+ struct equal_to : public std::binary_function<Handle<T>, Handle<T>, bool> {
+ V8_INLINE bool operator()(Handle<T> lhs, Handle<T> rhs) const {
+ return lhs.location() == rhs.location();
+ }
+ };
+
+ // Provide function object for location hashing.
+ struct hash : public std::unary_function<Handle<T>, size_t> {
+ V8_INLINE size_t operator()(Handle<T> const& handle) const {
+ return base::hash<void*>()(handle.location());
+ }
+ };
+
private:
// Handles of different classes are allowed to access each other's location_.
template <typename>
@@ -128,6 +143,9 @@ class Handle final : public HandleBase {
};
template <typename T>
+inline std::ostream& operator<<(std::ostream& os, Handle<T> handle);
+
+template <typename T>
V8_INLINE Handle<T> handle(T* object, Isolate* isolate) {
return Handle<T>(object, isolate);
}
« no previous file with comments | « src/compiler/x87/instruction-selector-x87.cc ('k') | src/handles-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698