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

Unified Diff: src/compiler/node-cache.cc

Issue 466673004: Use CommonNodeCache for heap constants in ChangeLowering. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Build fix Created 6 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/node-cache.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « src/compiler/node-cache.h ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698