Index: src/compiler/node-cache.cc |
diff --git a/src/compiler/node-cache.cc b/src/compiler/node-cache.cc |
index c3ee58c5a236faac50dcd8b0e9443a0ead256890..0d79c76dfea11cc94b0232fbd624b67ee58e0aeb 100644 |
--- a/src/compiler/node-cache.cc |
+++ b/src/compiler/node-cache.cc |
@@ -4,6 +4,8 @@ |
#include "src/compiler/node-cache.h" |
+#include "src/zone.h" |
+ |
namespace v8 { |
namespace internal { |
namespace compiler { |
@@ -12,35 +14,21 @@ namespace compiler { |
#define LINEAR_PROBE 5 |
template <typename Key> |
-int32_t NodeCacheHash(Key key) { |
- UNIMPLEMENTED(); |
- return 0; |
-} |
+inline int NodeCacheHash(Key key); |
+ |
template <> |
-inline int32_t NodeCacheHash(int32_t key) { |
+inline int NodeCacheHash(int32_t key) { |
return ComputeIntegerHash(key, 0); |
} |
template <> |
-inline int32_t NodeCacheHash(int64_t key) { |
+inline int NodeCacheHash(int64_t key) { |
return ComputeLongHash(key); |
} |
-template <> |
-inline int32_t NodeCacheHash(double key) { |
- return ComputeLongHash(BitCast<int64_t>(key)); |
-} |
- |
- |
-template <> |
-inline int32_t NodeCacheHash(void* key) { |
- return ComputePointerHash(key); |
-} |
- |
- |
template <typename Key> |
bool NodeCache<Key>::Resize(Zone* zone) { |
if (size_ >= max_) return false; // Don't grow past the maximum size. |
@@ -76,7 +64,7 @@ bool NodeCache<Key>::Resize(Zone* zone) { |
template <typename Key> |
Node** NodeCache<Key>::Find(Zone* zone, Key key) { |
- int32_t hash = NodeCacheHash(key); |
+ int hash = NodeCacheHash(key); |
if (entries_ == NULL) { |
// Allocate the initial entries and insert the first entry. |
int num_entries = INITIAL_SIZE + LINEAR_PROBE; |
@@ -112,9 +100,9 @@ Node** NodeCache<Key>::Find(Zone* zone, Key key) { |
} |
-template class NodeCache<int64_t>; |
template class NodeCache<int32_t>; |
-template class NodeCache<void*>; |
-} |
-} |
-} // namespace v8::internal::compiler |
+template class NodeCache<int64_t>; |
+ |
+} // namespace compiler |
+} // namespace internal |
+} // namespace v8 |