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

Side by Side Diff: test/unittests/heap/slot-set-unittest.cc

Issue 2489933002: [heap] Fix -Wsign-compare warnings (Closed)
Patch Set: fix test Created 4 years, 1 month 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
« no previous file with comments | « test/unittests/heap/marking-unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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 <limits> 5 #include <limits>
6 #include <map> 6 #include <map>
7 7
8 #include "src/globals.h" 8 #include "src/globals.h"
9 #include "src/heap/slot-set.h" 9 #include "src/heap/slot-set.h"
10 #include "src/heap/spaces.h" 10 #include "src/heap/spaces.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 } 121 }
122 122
123 TEST(SlotSet, RemoveRange) { 123 TEST(SlotSet, RemoveRange) {
124 CheckRemoveRangeOn(0, Page::kPageSize); 124 CheckRemoveRangeOn(0, Page::kPageSize);
125 CheckRemoveRangeOn(1 * kPointerSize, 1023 * kPointerSize); 125 CheckRemoveRangeOn(1 * kPointerSize, 1023 * kPointerSize);
126 for (uint32_t start = 0; start <= 32; start++) { 126 for (uint32_t start = 0; start <= 32; start++) {
127 CheckRemoveRangeOn(start * kPointerSize, (start + 1) * kPointerSize); 127 CheckRemoveRangeOn(start * kPointerSize, (start + 1) * kPointerSize);
128 CheckRemoveRangeOn(start * kPointerSize, (start + 2) * kPointerSize); 128 CheckRemoveRangeOn(start * kPointerSize, (start + 2) * kPointerSize);
129 const uint32_t kEnds[] = {32, 64, 100, 128, 1024, 1500, 2048}; 129 const uint32_t kEnds[] = {32, 64, 100, 128, 1024, 1500, 2048};
130 for (int i = 0; i < sizeof(kEnds) / sizeof(uint32_t); i++) { 130 for (size_t i = 0; i < sizeof(kEnds) / sizeof(uint32_t); i++) {
131 for (int k = -3; k <= 3; k++) { 131 for (int k = -3; k <= 3; k++) {
132 uint32_t end = (kEnds[i] + k); 132 uint32_t end = (kEnds[i] + k);
133 if (start < end) { 133 if (start < end) {
134 CheckRemoveRangeOn(start * kPointerSize, end * kPointerSize); 134 CheckRemoveRangeOn(start * kPointerSize, end * kPointerSize);
135 } 135 }
136 } 136 }
137 } 137 }
138 } 138 }
139 SlotSet set; 139 SlotSet set;
140 set.SetPageStart(0); 140 set.SetPageStart(0);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 CHECK(reinterpret_cast<uintptr_t>(host_addr) < start || 212 CHECK(reinterpret_cast<uintptr_t>(host_addr) < start ||
213 reinterpret_cast<uintptr_t>(host_addr) >= end); 213 reinterpret_cast<uintptr_t>(host_addr) >= end);
214 return KEEP_SLOT; 214 return KEEP_SLOT;
215 }, 215 },
216 TypedSlotSet::KEEP_EMPTY_CHUNKS); 216 TypedSlotSet::KEEP_EMPTY_CHUNKS);
217 } 217 }
218 } 218 }
219 219
220 } // namespace internal 220 } // namespace internal
221 } // namespace v8 221 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/heap/marking-unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698