Commit 3c04ee6d authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Make aborting compaction a fatal

Last attempt failed because of too agressive growing and no proper GC
scheduling.

Also refactor live object iteration on the way to avoid a branch when we
know that we will succeed.

Bug: chromium:651354
Change-Id: I8f52cbc79ac293989fb7c29c492d4ae4afe5ebe4
Reviewed-on: https://chromium-review.googlesource.com/544829
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46245}
parent 218edfd7
......@@ -728,6 +728,8 @@ DEFINE_BOOL(manual_evacuation_candidates_selection, false,
"candidates pages (requires --stress_compaction).")
DEFINE_BOOL(fast_promotion_new_space, false,
"fast promote new space on high survival rates")
DEFINE_BOOL(oom_on_compaction_failure, true,
"compaction failure results in an OOM")
// assembler-ia32.cc / assembler-arm.cc / assembler-x64.cc
DEFINE_BOOL(debug_code, DEBUG_BOOL,
......
This diff is collapsed.
......@@ -230,28 +230,38 @@ class LiveObjectRange {
Address end_;
};
class LiveObjectVisitor BASE_EMBEDDED {
class LiveObjectVisitor : AllStatic {
public:
enum IterationMode {
kKeepMarking,
kClearMarkbits,
};
// Visits black objects on a MemoryChunk until the Visitor returns for an
// object. If IterationMode::kClearMarkbits is passed the markbits and slots
// for visited objects are cleared for each successfully visited object.
// Visits black objects on a MemoryChunk until the Visitor returns |false| for
// an object. If IterationMode::kClearMarkbits is passed the markbits and
// slots for visited objects are cleared for each successfully visited object.
template <class Visitor>
bool VisitBlackObjects(MemoryChunk* chunk, const MarkingState& state,
Visitor* visitor, IterationMode iteration_mode);
static bool VisitBlackObjects(MemoryChunk* chunk, const MarkingState& state,
Visitor* visitor, IterationMode iteration_mode,
HeapObject** failed_object);
// Visits grey objects on a Memorychunk. Is not allowed to fail visitation
// for an object.
// Visits black objects on a MemoryChunk. The visitor is not allowed to fail
// visitation for an object.
template <class Visitor>
bool VisitGreyObjectsNoFail(MemoryChunk* chunk, const MarkingState& state,
Visitor* visitor, IterationMode iteration_mode);
static void VisitBlackObjectsNoFail(MemoryChunk* chunk,
const MarkingState& state,
Visitor* visitor,
IterationMode iteration_mode);
private:
void RecomputeLiveBytes(MemoryChunk* chunk, const MarkingState& state);
// Visits black objects on a MemoryChunk. The visitor is not allowed to fail
// visitation for an object.
template <class Visitor>
static void VisitGreyObjectsNoFail(MemoryChunk* chunk,
const MarkingState& state,
Visitor* visitor,
IterationMode iteration_mode);
static void RecomputeLiveBytes(MemoryChunk* chunk, const MarkingState& state);
};
enum PageEvacuationMode { NEW_TO_NEW, NEW_TO_OLD };
......
......@@ -41,6 +41,7 @@ void CheckAllObjectsOnPage(std::vector<Handle<FixedArray>>& handles,
} // namespace
HEAP_TEST(CompactionFullAbortedPage) {
FLAG_oom_on_compaction_failure = false;
if (FLAG_never_compact) return;
// Test the scenario where we reach OOM during compaction and the whole page
// is aborted.
......@@ -86,6 +87,7 @@ HEAP_TEST(CompactionFullAbortedPage) {
HEAP_TEST(CompactionPartiallyAbortedPage) {
FLAG_oom_on_compaction_failure = false;
if (FLAG_never_compact) return;
// Test the scenario where we reach OOM during compaction and parts of the
// page have already been migrated to a new one.
......@@ -161,6 +163,7 @@ HEAP_TEST(CompactionPartiallyAbortedPage) {
HEAP_TEST(CompactionPartiallyAbortedPageIntraAbortedPointers) {
FLAG_oom_on_compaction_failure = false;
if (FLAG_never_compact) return;
// Test the scenario where we reach OOM during compaction and parts of the
// page have already been migrated to a new one. Objects on the aborted page
......@@ -248,6 +251,7 @@ HEAP_TEST(CompactionPartiallyAbortedPageIntraAbortedPointers) {
HEAP_TEST(CompactionPartiallyAbortedPageWithStoreBufferEntries) {
FLAG_oom_on_compaction_failure = false;
if (FLAG_never_compact) return;
// Test the scenario where we reach OOM during compaction and parts of the
// page have already been migrated to a new one. Objects on the aborted page
......
......@@ -4854,6 +4854,7 @@ static void RequestInterrupt(const v8::FunctionCallbackInfo<v8::Value>& args) {
}
HEAP_TEST(Regress538257) {
FLAG_oom_on_compaction_failure = false;
FLAG_concurrent_marking = false;
FLAG_manual_evacuation_candidates_selection = true;
v8::Isolate::CreateParams create_params;
......@@ -5692,6 +5693,7 @@ HEAP_TEST(Regress587004) {
}
HEAP_TEST(Regress589413) {
FLAG_oom_on_compaction_failure = false;
if (!FLAG_incremental_marking) return;
FLAG_stress_compaction = true;
FLAG_manual_evacuation_candidates_selection = true;
......
......@@ -14592,6 +14592,7 @@ static void event_handler(const v8::JitCodeEvent* event) {
UNINITIALIZED_TEST(SetJitCodeEventHandler) {
i::FLAG_oom_on_compaction_failure = false;
i::FLAG_stress_compaction = true;
i::FLAG_incremental_marking = false;
if (i::FLAG_never_compact) return;
......
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