Commit ad80a80a authored by titzer@chromium.org's avatar titzer@chromium.org

Fix bug in NodeCache::GetCachedNodes

TBR=dcarney@chromium.org
BUG=

Review URL: https://codereview.chromium.org/656033003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 21f7300a
...@@ -94,7 +94,7 @@ Node** NodeCache<Key, Hash, Pred>::Find(Zone* zone, Key key) { ...@@ -94,7 +94,7 @@ Node** NodeCache<Key, Hash, Pred>::Find(Zone* zone, Key key) {
template <typename Key, typename Hash, typename Pred> template <typename Key, typename Hash, typename Pred>
void NodeCache<Key, Hash, Pred>::GetCachedNodes(NodeVector* nodes) { void NodeCache<Key, Hash, Pred>::GetCachedNodes(NodeVector* nodes) {
if (entries_) { if (entries_) {
for (size_t i = 0; i < size_; i++) { for (size_t i = 0; i < size_ + kLinearProbe; i++) {
if (entries_[i].value_ != NULL) nodes->push_back(entries_[i].value_); if (entries_[i].value_ != NULL) nodes->push_back(entries_[i].value_);
} }
} }
......
...@@ -329,8 +329,10 @@ TEST(JSGraph_GetCachedNodes1) { ...@@ -329,8 +329,10 @@ TEST(JSGraph_GetCachedNodes1) {
TEST(JSGraph_GetCachedNodes_int32) { TEST(JSGraph_GetCachedNodes_int32) {
JSConstantCacheTester T; JSConstantCacheTester T;
int32_t constants[] = {0, 11, 12, 13, 14, 55, -55, -44, -33, -22, -11, int32_t constants[] = {0, 1, 1, 1, 1, 2, 3, 4, 11, 12, 13,
0, 11, 11, 12, 12, 11, 11, -33, -33, -22, -11}; 14, 55, -55, -44, -33, -22, -11, 16, 16, 17, 17,
18, 18, 19, 19, 20, 20, 21, 21, 22, 23, 24,
25, 15, 30, 31, 45, 46, 47, 48};
for (size_t i = 0; i < arraysize(constants); i++) { for (size_t i = 0; i < arraysize(constants); i++) {
int count_before = T.graph()->NodeCount(); int count_before = T.graph()->NodeCount();
...@@ -372,8 +374,9 @@ TEST(JSGraph_GetCachedNodes_float64) { ...@@ -372,8 +374,9 @@ TEST(JSGraph_GetCachedNodes_float64) {
TEST(JSGraph_GetCachedNodes_int64) { TEST(JSGraph_GetCachedNodes_int64) {
JSConstantCacheTester T; JSConstantCacheTester T;
int32_t constants[] = {0, 11, 12, 13, 14, 55, -55, -44, -33, -22, -11, int32_t constants[] = {0, 11, 12, 13, 14, 55, -55, -44, -33,
0, 11, 11, 12, 12, 11, 11, -33, -33, -22, -11}; -22, -11, 16, 16, 17, 17, 18, 18, 19,
19, 20, 20, 21, 21, 22, 23, 24, 25};
for (size_t i = 0; i < arraysize(constants); i++) { for (size_t i = 0; i < arraysize(constants); i++) {
int count_before = T.graph()->NodeCount(); int count_before = T.graph()->NodeCount();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment