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

Side by Side Diff: src/compiler/node-cache.cc

Issue 656033003: Fix bug in NodeCache::GetCachedNodes (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/cctest/compiler/test-js-constant-cache.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/node-cache.h" 5 #include "src/compiler/node-cache.h"
6 6
7 #include <cstring> 7 #include <cstring>
8 8
9 #include "src/zone.h" 9 #include "src/zone.h"
10 #include "src/zone-containers.h" 10 #include "src/zone-containers.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 Entry* entry = &entries_[hash & (size_ - 1)]; 87 Entry* entry = &entries_[hash & (size_ - 1)];
88 entry->key_ = key; 88 entry->key_ = key;
89 entry->value_ = nullptr; 89 entry->value_ = nullptr;
90 return &entry->value_; 90 return &entry->value_;
91 } 91 }
92 92
93 93
94 template <typename Key, typename Hash, typename Pred> 94 template <typename Key, typename Hash, typename Pred>
95 void NodeCache<Key, Hash, Pred>::GetCachedNodes(NodeVector* nodes) { 95 void NodeCache<Key, Hash, Pred>::GetCachedNodes(NodeVector* nodes) {
96 if (entries_) { 96 if (entries_) {
97 for (size_t i = 0; i < size_; i++) { 97 for (size_t i = 0; i < size_ + kLinearProbe; i++) {
98 if (entries_[i].value_ != NULL) nodes->push_back(entries_[i].value_); 98 if (entries_[i].value_ != NULL) nodes->push_back(entries_[i].value_);
99 } 99 }
100 } 100 }
101 } 101 }
102 102
103 template class NodeCache<int64_t>; 103 template class NodeCache<int64_t>;
104 template class NodeCache<int32_t>; 104 template class NodeCache<int32_t>;
105 template class NodeCache<void*>; 105 template class NodeCache<void*>;
106 106
107 } // namespace compiler 107 } // namespace compiler
108 } // namespace internal 108 } // namespace internal
109 } // namespace v8 109 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/compiler/test-js-constant-cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698