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

Unified Diff: test/cctest/heap/test-mark-compact.cc

Issue 2810893002: [heap] Implement simple concurrent marking deque. (Closed)
Patch Set: revert flags Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« src/heap/mark-compact.cc ('K') | « test/cctest/heap/test-concurrent-marking.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-mark-compact.cc
diff --git a/test/cctest/heap/test-mark-compact.cc b/test/cctest/heap/test-mark-compact.cc
index f77586e87870fcf225a2798ec0f218b4ff17ccdf..8e8a7485ef9405af8e66d9b7624f5ea3b8253d6c 100644
--- a/test/cctest/heap/test-mark-compact.cc
+++ b/test/cctest/heap/test-mark-compact.cc
@@ -41,8 +41,10 @@
#include "src/full-codegen/full-codegen.h"
#include "src/global-handles.h"
+#include "src/heap/concurrent-marking-deque.h"
#include "src/heap/mark-compact-inl.h"
#include "src/heap/mark-compact.h"
+#include "src/heap/sequential-marking-deque.h"
#include "src/objects-inl.h"
#include "test/cctest/cctest.h"
#include "test/cctest/heap/heap-tester.h"
@@ -51,10 +53,29 @@
using namespace v8::internal;
using v8::Just;
+TEST(ConcurrentMarkingDeque) {
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ ConcurrentMarkingDeque marking_deque(isolate->heap());
+ v8::HandleScope sc(CcTest::isolate());
+ Handle<FixedArray> object = isolate->factory()->NewFixedArray(10);
+ marking_deque.Push(*object);
+ CHECK(!marking_deque.IsEmpty());
+ CHECK_EQ(1, marking_deque.Size());
+ CHECK_EQ(*object, marking_deque.Pop(MarkingThread::kConcurrent));
+ CHECK(marking_deque.IsEmpty());
+ marking_deque.Push(*object, MarkingThread::kConcurrent,
+ TargetDeque::kBailout);
+ CHECK(!marking_deque.IsEmpty());
+ CHECK_EQ(1, marking_deque.Size());
+ CHECK(nullptr == marking_deque.Pop(MarkingThread::kConcurrent));
+ CHECK_EQ(*object, marking_deque.Pop());
+ CHECK(nullptr == marking_deque.Pop());
+}
-TEST(MarkingDeque) {
+TEST(SequentialMarkingDeque) {
CcTest::InitializeVM();
- MarkingDeque s(CcTest::i_isolate()->heap());
+ SequentialMarkingDeque s(CcTest::i_isolate()->heap());
s.SetUp();
s.StartUsing();
Address original_address = reinterpret_cast<Address>(&s);
« src/heap/mark-compact.cc ('K') | « test/cctest/heap/test-concurrent-marking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698