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;
......
......@@ -489,7 +489,8 @@ static void TestWeakGlobalHandleCallback(
TEST(WeakGlobalHandlesScavenge) {
i::FLAG_stress_compaction = false;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
......@@ -654,6 +655,7 @@ TEST(WeakGlobalApiHandleWithElementsScavenge) {
}
TEST(WeakGlobalHandlesMark) {
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
......@@ -700,7 +702,8 @@ TEST(WeakGlobalHandlesMark) {
TEST(DeleteWeakGlobalHandle) {
i::FLAG_stress_compaction = false;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
......@@ -739,7 +742,8 @@ TEST(BytecodeArray) {
static const int kFrameSize = 32;
static const int kParameterCount = 2;
i::FLAG_manual_evacuation_candidates_selection = true;
FLAG_manual_evacuation_candidates_selection = true;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
......@@ -1209,11 +1213,11 @@ TEST(Iteration) {
}
TEST(TestUseOfIncrementalBarrierOnCompileLazy) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
// Turn off always_opt because it interferes with running the built-in for
// the last call to g().
i::FLAG_always_opt = false;
i::FLAG_allow_natives_syntax = true;
FLAG_always_opt = false;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Factory* factory = isolate->factory();
......@@ -1361,7 +1365,9 @@ TEST(TestInternalWeakLists) {
// Some flags turn Scavenge collections into Mark-sweep collections
// and hence are incompatible with this test case.
if (FLAG_gc_global || FLAG_stress_compaction) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
FLAG_retain_maps_for_n_gc = 0;
static const int kNumTestContexts = 10;
......@@ -1958,7 +1964,7 @@ static int NumberOfGlobalObjects() {
// Test that we don't embed maps from foreign contexts into
// optimized code.
TEST(LeakNativeContextViaMap) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope outer_scope(isolate);
v8::Persistent<v8::Context> ctx1p;
......@@ -2007,7 +2013,7 @@ TEST(LeakNativeContextViaMap) {
// Test that we don't embed functions from foreign contexts into
// optimized code.
TEST(LeakNativeContextViaFunction) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope outer_scope(isolate);
v8::Persistent<v8::Context> ctx1p;
......@@ -2054,7 +2060,7 @@ TEST(LeakNativeContextViaFunction) {
TEST(LeakNativeContextViaMapKeyed) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope outer_scope(isolate);
v8::Persistent<v8::Context> ctx1p;
......@@ -2101,7 +2107,7 @@ TEST(LeakNativeContextViaMapKeyed) {
TEST(LeakNativeContextViaMapProto) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope outer_scope(isolate);
v8::Persistent<v8::Context> ctx1p;
......@@ -2152,15 +2158,16 @@ TEST(LeakNativeContextViaMapProto) {
TEST(InstanceOfStubWriteBarrier) {
if (!i::FLAG_incremental_marking) return;
i::FLAG_allow_natives_syntax = true;
if (!FLAG_incremental_marking) return;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
#ifdef VERIFY_HEAP
i::FLAG_verify_heap = true;
FLAG_verify_heap = true;
#endif
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer()) return;
if (i::FLAG_force_marking_deque_overflows) return;
if (FLAG_force_marking_deque_overflows) return;
v8::HandleScope outer_scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
......@@ -2220,11 +2227,12 @@ int GetProfilerTicks(SharedFunctionInfo* shared) {
} // namespace
TEST(ResetSharedFunctionInfoCountersDuringIncrementalMarking) {
if (!i::FLAG_incremental_marking) return;
i::FLAG_stress_compaction = false;
i::FLAG_allow_natives_syntax = true;
if (!FLAG_incremental_marking) return;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
#ifdef VERIFY_HEAP
i::FLAG_verify_heap = true;
FLAG_verify_heap = true;
#endif
CcTest::InitializeVM();
......@@ -2266,10 +2274,11 @@ TEST(ResetSharedFunctionInfoCountersDuringIncrementalMarking) {
TEST(ResetSharedFunctionInfoCountersDuringMarkSweep) {
i::FLAG_stress_compaction = false;
i::FLAG_allow_natives_syntax = true;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
#ifdef VERIFY_HEAP
i::FLAG_verify_heap = true;
FLAG_verify_heap = true;
#endif
CcTest::InitializeVM();
......@@ -2308,7 +2317,7 @@ TEST(ResetSharedFunctionInfoCountersDuringMarkSweep) {
HEAP_TEST(GCFlags) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
CcTest::InitializeVM();
Heap* heap = CcTest::heap();
......@@ -2341,8 +2350,9 @@ HEAP_TEST(GCFlags) {
TEST(IdleNotificationFinishMarking) {
if (!i::FLAG_incremental_marking) return;
i::FLAG_allow_natives_syntax = true;
if (!FLAG_incremental_marking) return;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
const int initial_gc_count = CcTest::heap()->gc_count();
heap::SimulateFullSpace(CcTest::heap()->old_space());
......@@ -2389,10 +2399,12 @@ TEST(IdleNotificationFinishMarking) {
// Test that HAllocateObject will always return an object in new-space.
TEST(OptimizedAllocationAlwaysInNewSpace) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
heap::SimulateFullSpace(CcTest::heap()->new_space());
......@@ -2423,11 +2435,13 @@ TEST(OptimizedAllocationAlwaysInNewSpace) {
TEST(OptimizedPretenuringAllocationFolding) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
// Grow new space unitl maximum capacity reached.
......@@ -2474,11 +2488,13 @@ TEST(OptimizedPretenuringAllocationFolding) {
TEST(OptimizedPretenuringObjectArrayLiterals) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
// Grow new space unitl maximum capacity reached.
......@@ -2514,11 +2530,13 @@ TEST(OptimizedPretenuringObjectArrayLiterals) {
TEST(OptimizedPretenuringMixedInObjectProperties) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
// Grow new space unitl maximum capacity reached.
......@@ -2572,11 +2590,13 @@ TEST(OptimizedPretenuringMixedInObjectProperties) {
TEST(OptimizedPretenuringDoubleArrayProperties) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
// Grow new space unitl maximum capacity reached.
......@@ -2612,11 +2632,13 @@ TEST(OptimizedPretenuringDoubleArrayProperties) {
TEST(OptimizedPretenuringdoubleArrayLiterals) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
// Grow new space unitl maximum capacity reached.
......@@ -2652,11 +2674,13 @@ TEST(OptimizedPretenuringdoubleArrayLiterals) {
TEST(OptimizedPretenuringNestedMixedArrayLiterals) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
// Grow new space unitl maximum capacity reached.
......@@ -2702,11 +2726,13 @@ TEST(OptimizedPretenuringNestedMixedArrayLiterals) {
TEST(OptimizedPretenuringNestedObjectLiterals) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
// Grow new space unitl maximum capacity reached.
......@@ -2753,11 +2779,13 @@ TEST(OptimizedPretenuringNestedObjectLiterals) {
TEST(OptimizedPretenuringNestedDoubleLiterals) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
// Grow new space unitl maximum capacity reached.
......@@ -2805,10 +2833,12 @@ TEST(OptimizedPretenuringNestedDoubleLiterals) {
// Test regular array literals allocation.
TEST(OptimizedAllocationArrayLiterals) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
if (!CcTest::i_isolate()->use_optimizer() || i::FLAG_always_opt) return;
if (i::FLAG_gc_global || i::FLAG_stress_compaction) return;
if (!CcTest::i_isolate()->use_optimizer() || FLAG_always_opt) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
v8::Local<v8::Value> res = CompileRun(
......@@ -2841,11 +2871,12 @@ static int CountMapTransitions(Map* map) {
// Test that map transitions are cleared and maps are collected with
// incremental marking as well.
TEST(Regress1465) {
if (!i::FLAG_incremental_marking) return;
i::FLAG_stress_compaction = false;
i::FLAG_allow_natives_syntax = true;
i::FLAG_trace_incremental_marking = true;
i::FLAG_retain_maps_for_n_gc = 0;
if (!FLAG_incremental_marking) return;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
FLAG_trace_incremental_marking = true;
FLAG_retain_maps_for_n_gc = 0;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
......@@ -2908,17 +2939,18 @@ static void AddPropertyTo(
Factory* factory = isolate->factory();
Handle<String> prop_name = factory->InternalizeUtf8String(property_name);
Handle<Smi> twenty_three(Smi::FromInt(23), isolate);
i::FLAG_gc_interval = gc_count;
i::FLAG_gc_global = true;
i::FLAG_retain_maps_for_n_gc = 0;
FLAG_gc_interval = gc_count;
FLAG_gc_global = true;
FLAG_retain_maps_for_n_gc = 0;
CcTest::heap()->set_allocation_timeout(gc_count);
JSReceiver::SetProperty(object, prop_name, twenty_three, SLOPPY).Check();
}
TEST(TransitionArrayShrinksDuringAllocToZero) {
i::FLAG_stress_compaction = false;
i::FLAG_allow_natives_syntax = true;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 10;
......@@ -2947,8 +2979,9 @@ TEST(TransitionArrayShrinksDuringAllocToZero) {
TEST(TransitionArrayShrinksDuringAllocToOne) {
i::FLAG_stress_compaction = false;
i::FLAG_allow_natives_syntax = true;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 10;
......@@ -2974,8 +3007,9 @@ TEST(TransitionArrayShrinksDuringAllocToOne) {
TEST(TransitionArrayShrinksDuringAllocToOnePropertyFound) {
i::FLAG_stress_compaction = false;
i::FLAG_allow_natives_syntax = true;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 10;
......@@ -3001,8 +3035,9 @@ TEST(TransitionArrayShrinksDuringAllocToOnePropertyFound) {
TEST(TransitionArraySimpleToFull) {
i::FLAG_stress_compaction = false;
i::FLAG_allow_natives_syntax = true;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
static const int transitions_count = 1;
......@@ -3031,7 +3066,7 @@ TEST(TransitionArraySimpleToFull) {
TEST(Regress2143a) {
i::FLAG_incremental_marking = true;
FLAG_incremental_marking = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
......@@ -3070,8 +3105,8 @@ TEST(Regress2143a) {
TEST(Regress2143b) {
i::FLAG_incremental_marking = true;
i::FLAG_allow_natives_syntax = true;
FLAG_incremental_marking = true;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
......@@ -3114,19 +3149,19 @@ TEST(Regress2143b) {
TEST(ReleaseOverReservedPages) {
if (FLAG_never_compact) return;
i::FLAG_trace_gc = true;
FLAG_trace_gc = true;
// The optimizer can allocate stuff, messing up the test.
i::FLAG_opt = false;
i::FLAG_always_opt = false;
FLAG_opt = false;
FLAG_always_opt = false;
// Parallel compaction increases fragmentation, depending on how existing
// memory is distributed. Since this is non-deterministic because of
// concurrent sweeping, we disable it for this test.
i::FLAG_parallel_compaction = false;
FLAG_parallel_compaction = false;
// Concurrent sweeping adds non determinism, depending on when memory is
// available for further reuse.
i::FLAG_concurrent_sweeping = false;
FLAG_concurrent_sweeping = false;
// Fast evacuation of pages may result in a different page count in old space.
i::FLAG_page_promotion = false;
FLAG_page_promotion = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
// If there's snapshot available, we don't know whether 20 small arrays will
......@@ -3183,7 +3218,7 @@ void MockUseCounterCallback(v8::Isolate* isolate,
TEST(CountForcedGC) {
i::FLAG_expose_gc = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::HandleScope scope(CcTest::isolate());
......@@ -3218,7 +3253,7 @@ TEST(PrintSharedFunctionInfo) {
TEST(IncrementalMarkingPreservesMonomorphicCallIC) {
if (!FLAG_incremental_marking) return;
if (i::FLAG_always_opt) return;
if (FLAG_always_opt) return;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Value> fun1, fun2;
......@@ -3292,8 +3327,8 @@ static void CheckVectorIC(Handle<JSFunction> f, int slot_index,
}
TEST(IncrementalMarkingPreservesMonomorphicConstructor) {
if (!i::FLAG_incremental_marking) return;
if (i::FLAG_always_opt) return;
if (!FLAG_incremental_marking) return;
if (FLAG_always_opt) return;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
......@@ -3316,8 +3351,8 @@ TEST(IncrementalMarkingPreservesMonomorphicConstructor) {
}
TEST(IncrementalMarkingPreservesMonomorphicIC) {
if (!i::FLAG_incremental_marking) return;
if (i::FLAG_always_opt) return;
if (!FLAG_incremental_marking) return;
if (FLAG_always_opt) return;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Context> ctx = CcTest::isolate()->GetCurrentContext();
......@@ -3338,8 +3373,8 @@ TEST(IncrementalMarkingPreservesMonomorphicIC) {
}
TEST(IncrementalMarkingPreservesPolymorphicIC) {
if (!i::FLAG_incremental_marking) return;
if (i::FLAG_always_opt) return;
if (!FLAG_incremental_marking) return;
if (FLAG_always_opt) return;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Value> obj1, obj2;
......@@ -3376,8 +3411,8 @@ TEST(IncrementalMarkingPreservesPolymorphicIC) {
}
TEST(ContextDisposeDoesntClearPolymorphicIC) {
if (!i::FLAG_incremental_marking) return;
if (i::FLAG_always_opt) return;
if (!FLAG_incremental_marking) return;
if (FLAG_always_opt) return;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
v8::Local<v8::Value> obj1, obj2;
......@@ -3473,7 +3508,7 @@ void ReleaseStackTraceDataTest(v8::Isolate* isolate, const char* source,
UNINITIALIZED_TEST(ReleaseStackTraceData) {
if (i::FLAG_always_opt) {
if (FLAG_always_opt) {
// TODO(ulan): Remove this once the memory leak via code_next_link is fixed.
// See: https://codereview.chromium.org/181833004/
return;
......@@ -3532,8 +3567,8 @@ UNINITIALIZED_TEST(ReleaseStackTraceData) {
TEST(Regress159140) {
if (!i::FLAG_incremental_marking) return;
i::FLAG_allow_natives_syntax = true;
if (!FLAG_incremental_marking) return;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
LocalContext env;
......@@ -3593,8 +3628,8 @@ TEST(Regress159140) {
TEST(Regress165495) {
if (!i::FLAG_incremental_marking) return;
i::FLAG_allow_natives_syntax = true;
if (!FLAG_incremental_marking) return;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
......@@ -3639,8 +3674,8 @@ TEST(Regress165495) {
}
TEST(Regress169928) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_opt = false;
FLAG_allow_natives_syntax = true;
FLAG_opt = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
LocalContext env;
......@@ -3649,7 +3684,9 @@ TEST(Regress169928) {
// Some flags turn Scavenge collections into Mark-sweep collections
// and hence are incompatible with this test case.
if (FLAG_gc_global || FLAG_stress_compaction) return;
if (FLAG_gc_global || FLAG_stress_compaction ||
FLAG_stress_incremental_marking)
return;
// Prepare the environment
CompileRun("function fastliteralcase(literal, value) {"
......@@ -3719,8 +3756,8 @@ TEST(Regress169928) {
#ifdef DEBUG
TEST(Regress513507) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_gc_global = true;
FLAG_allow_natives_syntax = true;
FLAG_gc_global = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
LocalContext env;
......@@ -3769,7 +3806,7 @@ TEST(Regress513507) {
#endif // DEBUG
TEST(Regress513496) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
HandleScope scope(isolate);
......@@ -3829,8 +3866,9 @@ TEST(Regress513496) {
TEST(LargeObjectSlotRecording) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
FLAG_manual_evacuation_candidates_selection = true;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
......@@ -3923,7 +3961,7 @@ TEST(IncrementalMarkingStepMakesBigProgressWithLargeObjects) {
TEST(DisableInlineAllocation) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CompileRun("function test() {"
......@@ -3963,8 +4001,8 @@ static int AllocationSitesCount(Heap* heap) {
TEST(EnsureAllocationSiteDependentCodesProcessed) {
if (i::FLAG_always_opt || !i::FLAG_opt) return;
i::FLAG_allow_natives_syntax = true;
if (FLAG_always_opt || !FLAG_opt) return;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::internal::Heap* heap = CcTest::heap();
......@@ -4034,8 +4072,8 @@ TEST(EnsureAllocationSiteDependentCodesProcessed) {
TEST(CellsInOptimizedCodeAreWeak) {
if (i::FLAG_always_opt || !i::FLAG_opt) return;
i::FLAG_allow_natives_syntax = true;
if (FLAG_always_opt || !FLAG_opt) return;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::internal::Heap* heap = CcTest::heap();
......@@ -4078,8 +4116,8 @@ TEST(CellsInOptimizedCodeAreWeak) {
TEST(ObjectsInOptimizedCodeAreWeak) {
if (i::FLAG_always_opt || !i::FLAG_opt) return;
i::FLAG_allow_natives_syntax = true;
if (FLAG_always_opt || !FLAG_opt) return;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::internal::Heap* heap = CcTest::heap();
......@@ -4119,8 +4157,8 @@ TEST(ObjectsInOptimizedCodeAreWeak) {
}
TEST(NewSpaceObjectsInOptimizedCode) {
if (i::FLAG_always_opt || !i::FLAG_opt || i::FLAG_turbo) return;
i::FLAG_allow_natives_syntax = true;
if (FLAG_always_opt || !FLAG_opt || FLAG_turbo) return;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::internal::Heap* heap = CcTest::heap();
......@@ -4180,11 +4218,11 @@ TEST(NewSpaceObjectsInOptimizedCode) {
}
TEST(NoWeakHashTableLeakWithIncrementalMarking) {
if (i::FLAG_always_opt || !i::FLAG_opt) return;
if (!i::FLAG_incremental_marking) return;
i::FLAG_allow_natives_syntax = true;
i::FLAG_compilation_cache = false;
i::FLAG_retain_maps_for_n_gc = 0;
if (FLAG_always_opt || !FLAG_opt) return;
if (!FLAG_incremental_marking) return;
FLAG_allow_natives_syntax = true;
FLAG_compilation_cache = false;
FLAG_retain_maps_for_n_gc = 0;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
......@@ -4259,8 +4297,8 @@ static int GetCodeChainLength(Code* code) {
TEST(NextCodeLinkIsWeak) {
i::FLAG_always_opt = false;
i::FLAG_allow_natives_syntax = true;
FLAG_always_opt = false;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::internal::Heap* heap = CcTest::heap();
......@@ -4306,7 +4344,7 @@ static Handle<Code> DummyOptimizedCode(Isolate* isolate) {
TEST(NextCodeLinkIsWeak2) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
v8::internal::Heap* heap = CcTest::heap();
......@@ -4343,8 +4381,9 @@ static void ClearWeakIC(
TEST(WeakFunctionInConstructor) {
if (i::FLAG_always_opt) return;
i::FLAG_stress_compaction = false;
if (FLAG_always_opt) return;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
LocalContext env;
......@@ -4403,7 +4442,8 @@ TEST(WeakFunctionInConstructor) {
// Checks that the value returned by execution of the source is weak.
void CheckWeakness(const char* source) {
i::FLAG_stress_compaction = false;
FLAG_stress_compaction = false;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
v8::Isolate* isolate = CcTest::isolate();
LocalContext env;
......@@ -4745,12 +4785,12 @@ TEST(WeakCellsWithIncrementalMarking) {
#ifdef DEBUG
TEST(AddInstructionChangesNewSpacePromotion) {
i::FLAG_allow_natives_syntax = true;
i::FLAG_expose_gc = true;
i::FLAG_stress_compaction = true;
i::FLAG_gc_interval = 1000;
FLAG_allow_natives_syntax = true;
FLAG_expose_gc = true;
FLAG_stress_compaction = true;
FLAG_gc_interval = 1000;
CcTest::InitializeVM();
if (!i::FLAG_allocation_site_pretenuring) return;
if (!FLAG_allocation_site_pretenuring) return;
v8::HandleScope scope(CcTest::isolate());
Isolate* isolate = CcTest::i_isolate();
Heap* heap = isolate->heap();
......@@ -4793,7 +4833,7 @@ void OnFatalErrorExpectOOM(const char* location, const char* message) {
TEST(CEntryStubOOM) {
i::FLAG_allow_natives_syntax = true;
FLAG_allow_natives_syntax = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CcTest::isolate()->SetFatalErrorHandler(OnFatalErrorExpectOOM);
......@@ -4818,7 +4858,7 @@ static void RequestInterrupt(const v8::FunctionCallbackInfo<v8::Value>& args) {
}
HEAP_TEST(Regress538257) {
i::FLAG_manual_evacuation_candidates_selection = true;
FLAG_manual_evacuation_candidates_selection = true;
v8::Isolate::CreateParams create_params;
// Set heap limits.
create_params.constraints.set_max_semi_space_size(1);
......@@ -4900,9 +4940,9 @@ TEST(Regress507979) {
UNINITIALIZED_TEST(PromotionQueue) {
i::FLAG_expose_gc = true;
i::FLAG_max_semi_space_size = 2 * Page::kPageSize / MB;
i::FLAG_min_semi_space_size = i::FLAG_max_semi_space_size;
FLAG_expose_gc = true;
FLAG_max_semi_space_size = 2 * Page::kPageSize / MB;
FLAG_min_semi_space_size = FLAG_max_semi_space_size;
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
......@@ -4935,7 +4975,7 @@ UNINITIALIZED_TEST(PromotionQueue) {
CHECK(new_space->IsAtMaximumCapacity());
CHECK_EQ(static_cast<size_t>(i::FLAG_min_semi_space_size * MB),
CHECK_EQ(static_cast<size_t>(FLAG_min_semi_space_size * MB),
new_space->TotalCapacity());
// Call the scavenger two times to get an empty new space
......@@ -4952,7 +4992,7 @@ UNINITIALIZED_TEST(PromotionQueue) {
}
heap->CollectGarbage(NEW_SPACE, i::GarbageCollectionReason::kTesting);
CHECK_EQ(static_cast<size_t>(i::FLAG_min_semi_space_size * MB),
CHECK_EQ(static_cast<size_t>(FLAG_min_semi_space_size * MB),
new_space->TotalCapacity());
// Fill-up the first semi-space page.
......@@ -4977,7 +5017,8 @@ UNINITIALIZED_TEST(PromotionQueue) {
TEST(Regress388880) {
if (!FLAG_incremental_marking) return;
i::FLAG_expose_gc = true;
FLAG_stress_incremental_marking = false;
FLAG_expose_gc = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
Isolate* isolate = CcTest::i_isolate();
......@@ -5025,7 +5066,7 @@ TEST(Regress388880) {
TEST(Regress3631) {
if (!FLAG_incremental_marking) return;
i::FLAG_expose_gc = true;
FLAG_expose_gc = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
Isolate* isolate = CcTest::i_isolate();
......@@ -5160,6 +5201,7 @@ void CheckMapRetainingFor(int n) {
TEST(MapRetaining) {
if (!FLAG_incremental_marking) return;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
CheckMapRetainingFor(FLAG_retain_maps_for_n_gc);
......@@ -5845,7 +5887,7 @@ TEST(Regress609761) {
}
TEST(Regress615489) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
FLAG_black_allocation = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
......@@ -5946,7 +5988,7 @@ TEST(Regress631969) {
}
TEST(LeftTrimFixedArrayInBlackArea) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
FLAG_black_allocation = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
......@@ -5985,7 +6027,7 @@ TEST(LeftTrimFixedArrayInBlackArea) {
}
TEST(ContinuousLeftTrimFixedArrayInBlackArea) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
FLAG_black_allocation = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
......@@ -6051,7 +6093,7 @@ TEST(ContinuousLeftTrimFixedArrayInBlackArea) {
}
TEST(ContinuousRightTrimFixedArrayInBlackArea) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
FLAG_black_allocation = true;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
......@@ -6111,7 +6153,7 @@ TEST(ContinuousRightTrimFixedArrayInBlackArea) {
}
TEST(Regress618958) {
if (!i::FLAG_incremental_marking) return;
if (!FLAG_incremental_marking) return;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
Heap* heap = CcTest::heap();
......@@ -6221,6 +6263,7 @@ TEST(RememberedSetRemoveRange) {
HEAP_TEST(Regress670675) {
if (!FLAG_incremental_marking) return;
FLAG_stress_incremental_marking = false;
CcTest::InitializeVM();
v8::HandleScope scope(CcTest::isolate());
Heap* heap = CcTest::heap();
......
......@@ -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