Commit 75e67911 authored by ulan's avatar ulan Committed by Commit bot

[heap] Add --stress-incremental-marking flag.

BUG=

Review-Url: https://codereview.chromium.org/2900603004
Cr-Commit-Position: refs/heads/master@{#45553}
parent 0a1cad37
......@@ -739,6 +739,8 @@ DEFINE_BOOL(force_marking_deque_overflows, false,
DEFINE_BOOL(stress_compaction, false,
"stress the GC compactor to flush out bugs (implies "
"--force_marking_deque_overflows)")
DEFINE_BOOL(stress_incremental_marking, V8_CONCURRENT_MARKING_BOOL,
"force incremental marking for small heaps and run it more often")
DEFINE_BOOL(manual_evacuation_candidates_selection, false,
"Test mode only flag. It allows an unit test to select evacuation "
"candidates pages (requires --stress_compaction).")
......
......@@ -5564,9 +5564,15 @@ bool Heap::ShouldExpandOldGenerationOnSlowAllocation() {
Heap::IncrementalMarkingLimit Heap::IncrementalMarkingLimitReached() {
// Code using an AlwaysAllocateScope assumes that the GC state does not
// change; that implies that no marking steps must be performed.
if (!incremental_marking()->CanBeActivated() || always_allocate() ||
PromotedSpaceSizeOfObjects() <=
IncrementalMarking::kActivationThreshold) {
if (!incremental_marking()->CanBeActivated() || always_allocate()) {
// Incremental marking is disabled or it is too early to start.
return IncrementalMarkingLimit::kNoLimit;
}
if (FLAG_stress_incremental_marking) {
return IncrementalMarkingLimit::kHardLimit;
}
if (PromotedSpaceSizeOfObjects() <=
IncrementalMarking::kActivationThreshold) {
// Incremental marking is disabled or it is too early to start.
return IncrementalMarkingLimit::kNoLimit;
}
......
......@@ -114,6 +114,7 @@ TEST(ArrayBuffer_ScavengeAndMC) {
}
TEST(ArrayBuffer_Compaction) {
FLAG_stress_incremental_marking = false;
FLAG_manual_evacuation_candidates_selection = true;
CcTest::InitializeVM();
LocalContext env;
......
......@@ -47,6 +47,7 @@ HEAP_TEST(CompactionFullAbortedPage) {
// Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
// we can reach the state of a half aborted page.
FLAG_concurrent_sweeping = false;
FLAG_stress_incremental_marking = false;
FLAG_manual_evacuation_candidates_selection = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
......@@ -89,6 +90,7 @@ HEAP_TEST(CompactionPartiallyAbortedPage) {
// Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
// we can reach the state of a half aborted page.
FLAG_concurrent_sweeping = false;
FLAG_stress_incremental_marking = false;
FLAG_manual_evacuation_candidates_selection = true;
const int objects_per_page = 10;
......@@ -163,6 +165,7 @@ HEAP_TEST(CompactionPartiallyAbortedPageIntraAbortedPointers) {
// Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
// we can reach the state of a half aborted page.
FLAG_concurrent_sweeping = false;
FLAG_stress_incremental_marking = false;
FLAG_manual_evacuation_candidates_selection = true;
const int objects_per_page = 10;
......@@ -250,6 +253,7 @@ HEAP_TEST(CompactionPartiallyAbortedPageWithStoreBufferEntries) {
// Disable concurrent sweeping to ensure memory is in an expected state, i.e.,
// we can reach the state of a half aborted page.
FLAG_concurrent_sweeping = false;
FLAG_stress_incremental_marking = false;
FLAG_manual_evacuation_candidates_selection = true;
const int objects_per_page = 10;
......
This diff is collapsed.
......@@ -101,6 +101,7 @@ class MockPlatform : public v8::Platform {
TEST(IncrementalMarkingUsingTasks) {
if (!i::FLAG_incremental_marking) return;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
v8::Platform* old_platform = i::V8::GetCurrentPlatform();
MockPlatform platform(old_platform);
......
......@@ -659,6 +659,7 @@ UNINITIALIZED_TEST(InlineAllocationObserverCadence) {
}
TEST(ShrinkPageToHighWaterMarkFreeSpaceEnd) {
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
......
......@@ -7533,6 +7533,7 @@ static void SetFlag(const v8::WeakCallbackInfo<FlagAndPersistent>& data) {
static void IndependentWeakHandle(bool global_gc, bool interlinked) {
i::FLAG_stress_incremental_marking = false;
v8::Isolate* iso = CcTest::isolate();
v8::HandleScope scope(iso);
v8::Local<Context> context = Context::New(iso);
......@@ -14558,6 +14559,7 @@ static void event_handler(const v8::JitCodeEvent* event) {
UNINITIALIZED_TEST(SetJitCodeEventHandler) {
i::FLAG_stress_compaction = true;
// FLAG_stress_incremental_marking = false;
i::FLAG_incremental_marking = false;
if (i::FLAG_never_compact) return;
const char* script =
......
......@@ -2030,12 +2030,15 @@ TEST(WeakGlobalHandle) {
CHECK(!HasWeakGlobalHandle());
v8::Persistent<v8::Object> handle(env->GetIsolate(),
v8::Object::New(env->GetIsolate()));
v8::Persistent<v8::Object> handle;
handle.Reset(env->GetIsolate(), v8::Object::New(env->GetIsolate()));
handle.SetWeak(&handle, PersistentHandleCallback,
v8::WeakCallbackType::kParameter);
CHECK(HasWeakGlobalHandle());
CcTest::CollectAllGarbage();
EmptyMessageQueues(env->GetIsolate());
}
......
......@@ -1127,6 +1127,7 @@ TEST(CodeSerializerLargeCodeObject) {
}
TEST(CodeSerializerLargeCodeObjectWithIncrementalMarking) {
FLAG_stress_incremental_marking = false;
FLAG_serialize_toplevel = true;
FLAG_always_opt = false;
// This test relies on (full-codegen) code objects going to large object
......
......@@ -1192,6 +1192,7 @@ TEST(InternalizeExternal) {
// TODO(mlippautz): Remove once we add support for forwarding ThinStrings in
// minor MC.
if (FLAG_minor_mc) return;
FLAG_stress_incremental_marking = false;
FLAG_thin_strings = true;
CcTest::InitializeVM();
i::Isolate* isolate = CcTest::i_isolate();
......
......@@ -1109,6 +1109,7 @@ TEST(DoScavenge) {
TEST(DoScavengeWithIncrementalWriteBarrier) {
if (FLAG_never_compact || !FLAG_incremental_marking) return;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
Isolate* isolate = CcTest::i_isolate();
......@@ -1457,6 +1458,7 @@ static void TestIncrementalWriteBarrier(Handle<Map> map, Handle<Map> new_map,
int double_descriptor,
bool check_tagged_value = true) {
if (FLAG_never_compact || !FLAG_incremental_marking) return;
FLAG_stress_incremental_marking = false;
FLAG_manual_evacuation_candidates_selection = true;
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
......@@ -1539,6 +1541,7 @@ enum OldToWriteBarrierKind {
};
static void TestWriteBarrierObjectShiftFieldsRight(
OldToWriteBarrierKind write_barrier_kind) {
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::HandleScope scope(CcTest::isolate());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment