| Index: src/handles.h
|
| diff --git a/src/handles.h b/src/handles.h
|
| index 2db18307dacad563b89a5ba3eea179eb43b9b85e..133dbb586fa60cd94d06297ab6ad5666a29c3c83 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>
|
|
|