OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |