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

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

Issue 1735523002: Reland "Replace slots buffer with remembered set. (patchset #14 id:250001 of https://codereview.chr… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: one more int->size_t Created 4 years, 10 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
« no previous file with comments | « test/cctest/test-unboxed-doubles.cc ('k') | test/unittests/heap/slot-set-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include <limits>
6
7 #include <set>
8
9 #include "src/globals.h"
10 #include "src/heap/remembered-set.h"
11 #include "src/heap/spaces.h"
12 #include "testing/gtest/include/gtest/gtest.h"
13
14 namespace v8 {
15 namespace internal {
16
17 TEST(LocalSlotsBuffer, InsertAndIterate) {
18 LocalSlotsBuffer buffer;
19 std::set<Address> untyped;
20 std::set<std::pair<SlotType, Address> > typed;
21
22 for (int k = 1000; k < 10000; k += NUMBER_OF_SLOT_TYPES) {
23 untyped.insert(reinterpret_cast<Address>(k));
24 buffer.Record(reinterpret_cast<Address>(k));
25 for (int i = 0; i < NUMBER_OF_SLOT_TYPES; i++) {
26 typed.insert(std::make_pair(static_cast<SlotType>(i),
27 reinterpret_cast<Address>(k + i)));
28 buffer.Record(static_cast<SlotType>(i), reinterpret_cast<Address>(k + i));
29 }
30 }
31 buffer.Iterate(
32 [&untyped](Address addr) {
33 EXPECT_NE(untyped.count(addr), 0);
34 untyped.erase(addr);
35 },
36 [&typed](SlotType type, Address addr) {
37 EXPECT_NE(typed.count(std::make_pair(type, addr)), 0);
38 typed.erase(std::make_pair(type, addr));
39 });
40 EXPECT_EQ(untyped.size(), 0);
41 EXPECT_EQ(typed.size(), 0);
42 }
43
44 } // namespace internal
45 } // namespace v8
OLDNEW
« no previous file with comments | « test/cctest/test-unboxed-doubles.cc ('k') | test/unittests/heap/slot-set-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698