35 }
36
37
38 class ShenandoahOldGenerationTest : public ::testing::Test {
39 protected:
40 static const size_t INITIAL_PLAB_SIZE;
41 static const size_t INITIAL_PLAB_PROMOTED;
42
43 ShenandoahOldGeneration* old;
44
45 ShenandoahOldGenerationTest()
46 : old(nullptr)
47 {
48 }
49
50 void SetUp() override {
51 SKIP_IF_NOT_SHENANDOAH();
52
53 ShenandoahHeap::heap()->lock()->lock(false);
54
55 old = new ShenandoahOldGeneration(8, 1024 * 1024, 1024);
56 old->set_promoted_reserve(512 * HeapWordSize);
57 old->expend_promoted(256 * HeapWordSize);
58 old->set_evacuation_reserve(512 * HeapWordSize);
59
60 Thread* thread = Thread::current();
61 ShenandoahThreadLocalData::reset_plab_promoted(thread);
62 ShenandoahThreadLocalData::disable_plab_promotions(thread);
63 ShenandoahThreadLocalData::set_plab_actual_size(thread, INITIAL_PLAB_SIZE);
64 ShenandoahThreadLocalData::add_to_plab_promoted(thread, INITIAL_PLAB_PROMOTED);
65 }
66
67 void TearDown() override {
68 if (UseShenandoahGC) {
69 ShenandoahHeap::heap()->lock()->unlock();
70 delete old;
71 }
72 }
73
74 static bool promotions_enabled() {
75 return ShenandoahThreadLocalData::allow_plab_promotions(Thread::current());
|
35 }
36
37
38 class ShenandoahOldGenerationTest : public ::testing::Test {
39 protected:
40 static const size_t INITIAL_PLAB_SIZE;
41 static const size_t INITIAL_PLAB_PROMOTED;
42
43 ShenandoahOldGeneration* old;
44
45 ShenandoahOldGenerationTest()
46 : old(nullptr)
47 {
48 }
49
50 void SetUp() override {
51 SKIP_IF_NOT_SHENANDOAH();
52
53 ShenandoahHeap::heap()->lock()->lock(false);
54
55 old = new ShenandoahOldGeneration(8, 1024 * 1024);
56 old->set_promoted_reserve(512 * HeapWordSize);
57 old->expend_promoted(256 * HeapWordSize);
58 old->set_evacuation_reserve(512 * HeapWordSize);
59
60 Thread* thread = Thread::current();
61 ShenandoahThreadLocalData::reset_plab_promoted(thread);
62 ShenandoahThreadLocalData::disable_plab_promotions(thread);
63 ShenandoahThreadLocalData::set_plab_actual_size(thread, INITIAL_PLAB_SIZE);
64 ShenandoahThreadLocalData::add_to_plab_promoted(thread, INITIAL_PLAB_PROMOTED);
65 }
66
67 void TearDown() override {
68 if (UseShenandoahGC) {
69 ShenandoahHeap::heap()->lock()->unlock();
70 delete old;
71 }
72 }
73
74 static bool promotions_enabled() {
75 return ShenandoahThreadLocalData::allow_plab_promotions(Thread::current());
|