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

Side by Side Diff: test/cctest/heap/test-mark-compact.cc

Issue 2439063002: [heap] Refactor marking deque. (Closed)
Patch Set: Stop incremental marking if it is in sweeping state 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 | « src/heap/mark-compact.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "test/cctest/cctest.h" 44 #include "test/cctest/cctest.h"
45 #include "test/cctest/heap/heap-tester.h" 45 #include "test/cctest/heap/heap-tester.h"
46 #include "test/cctest/heap/heap-utils.h" 46 #include "test/cctest/heap/heap-utils.h"
47 47
48 using namespace v8::internal; 48 using namespace v8::internal;
49 using v8::Just; 49 using v8::Just;
50 50
51 51
52 TEST(MarkingDeque) { 52 TEST(MarkingDeque) {
53 CcTest::InitializeVM(); 53 CcTest::InitializeVM();
54 int mem_size = 20 * kPointerSize;
55 byte* mem = NewArray<byte>(20*kPointerSize);
56 Address low = reinterpret_cast<Address>(mem);
57 Address high = low + mem_size;
58 MarkingDeque s; 54 MarkingDeque s;
59 s.Initialize(low, high); 55 s.SetUp();
60 56 s.StartUsing();
61 Address original_address = reinterpret_cast<Address>(&s); 57 Address original_address = reinterpret_cast<Address>(&s);
62 Address current_address = original_address; 58 Address current_address = original_address;
63 while (!s.IsFull()) { 59 while (!s.IsFull()) {
64 s.Push(HeapObject::FromAddress(current_address)); 60 s.Push(HeapObject::FromAddress(current_address));
65 current_address += kPointerSize; 61 current_address += kPointerSize;
66 } 62 }
67 63
68 while (!s.IsEmpty()) { 64 while (!s.IsEmpty()) {
69 Address value = s.Pop()->address(); 65 Address value = s.Pop()->address();
70 current_address -= kPointerSize; 66 current_address -= kPointerSize;
71 CHECK_EQ(current_address, value); 67 CHECK_EQ(current_address, value);
72 } 68 }
73 69
74 CHECK_EQ(original_address, current_address); 70 CHECK_EQ(original_address, current_address);
75 DeleteArray(mem); 71 s.StopUsing();
72 s.TearDown();
76 } 73 }
77 74
78 TEST(Promotion) { 75 TEST(Promotion) {
79 CcTest::InitializeVM(); 76 CcTest::InitializeVM();
80 Isolate* isolate = CcTest::i_isolate(); 77 Isolate* isolate = CcTest::i_isolate();
81 { 78 {
82 v8::HandleScope sc(CcTest::isolate()); 79 v8::HandleScope sc(CcTest::isolate());
83 Heap* heap = isolate->heap(); 80 Heap* heap = isolate->heap();
84 81
85 heap::SealCurrentObjects(heap); 82 heap::SealCurrentObjects(heap);
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 476
480 477
481 TEST(RegressJoinThreadsOnIsolateDeinit) { 478 TEST(RegressJoinThreadsOnIsolateDeinit) {
482 intptr_t size_limit = ShortLivingIsolate() * 2; 479 intptr_t size_limit = ShortLivingIsolate() * 2;
483 for (int i = 0; i < 10; i++) { 480 for (int i = 0; i < 10; i++) {
484 CHECK_GT(size_limit, ShortLivingIsolate()); 481 CHECK_GT(size_limit, ShortLivingIsolate());
485 } 482 }
486 } 483 }
487 484
488 #endif // __linux__ and !USE_SIMULATOR 485 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698