Commit bd329976 authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by V8 LUCI CQ

Revert "[heap] Disable the young generation in shared heaps"

This reverts commit 1186fc50.

Reason for revert: https://ci.chromium.org/ui/p/v8/builders/ci/V8%20Linux64%20UBSan/16531/overview

Original change's description:
> [heap] Disable the young generation in shared heaps
>
> A shared heap will not have a young generation in the beginning.
>
> Bug: v8:11708
> Change-Id: I947ddb91a23a72a8cee3aa3e554723dda8146011
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2891569
> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
> Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#74697}

Bug: v8:11708
Change-Id: I8de67f70b00b5bd3066659e07fb1fd3ecfb76211
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2909693
Auto-Submit: Sathya Gunasekaran  <gsathya@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/master@{#74699}
parent 4e1fadf4
......@@ -449,7 +449,7 @@ GarbageCollector Heap::SelectGarbageCollector(AllocationSpace space,
return MARK_COMPACTOR;
}
if (FLAG_gc_global || ShouldStressCompaction() || !new_space()) {
if (FLAG_gc_global || ShouldStressCompaction() || FLAG_single_generation) {
*reason = "GC in old space forced by flags";
return MARK_COMPACTOR;
}
......@@ -2410,8 +2410,7 @@ void Heap::MarkCompact() {
void Heap::MinorMarkCompact() {
#ifdef ENABLE_MINOR_MC
DCHECK(FLAG_minor_mc);
DCHECK(new_space());
DCHECK(FLAG_minor_mc && !FLAG_single_generation);
PauseAllocationObserversScope pause_observers(this);
SetGCState(MINOR_MARK_COMPACT);
......@@ -2518,7 +2517,7 @@ void Heap::EvacuateYoungGeneration() {
}
void Heap::Scavenge() {
DCHECK_NOT_NULL(new_space());
DCHECK(!FLAG_single_generation);
if (fast_promotion_mode_ && CanPromoteYoungAndExpandOldGeneration(0)) {
tracer()->NotifyYoungGenerationHandling(
......@@ -5436,8 +5435,7 @@ class StressConcurrentAllocationObserver : public AllocationObserver {
void Heap::SetUpSpaces() {
// Ensure SetUpFromReadOnlySpace has been ran.
DCHECK_NOT_NULL(read_only_space_);
const bool has_young_gen = !FLAG_single_generation && !IsShared();
if (has_young_gen) {
if (!FLAG_single_generation) {
space_[NEW_SPACE] = new_space_ =
new NewSpace(this, memory_allocator_->data_page_allocator(),
initial_semispace_size_, max_semi_space_size_);
......@@ -5446,7 +5444,7 @@ void Heap::SetUpSpaces() {
space_[CODE_SPACE] = code_space_ = new CodeSpace(this);
space_[MAP_SPACE] = map_space_ = new MapSpace(this);
space_[LO_SPACE] = lo_space_ = new OldLargeObjectSpace(this);
if (has_young_gen) {
if (!FLAG_single_generation) {
space_[NEW_LO_SPACE] = new_lo_space_ =
new NewLargeObjectSpace(this, NewSpaceCapacity());
}
......@@ -5485,7 +5483,7 @@ void Heap::SetUpSpaces() {
}
#endif // ENABLE_MINOR_MC
if (new_space()) {
if (!FLAG_single_generation) {
scavenge_job_.reset(new ScavengeJob());
scavenge_task_observer_.reset(new ScavengeTaskObserver(
this, ScavengeJob::YoungGenerationTaskTriggerSize(this)));
......
......@@ -83,9 +83,6 @@ UNINITIALIZED_TEST(SharedCollection) {
create_params.array_buffer_allocator = allocator.get();
Isolate* shared_isolate = Isolate::NewShared(create_params);
DCHECK_NULL(shared_isolate->heap()->new_space());
DCHECK_NULL(shared_isolate->heap()->new_lo_space());
CcTest::CollectGarbage(OLD_SPACE, shared_isolate);
Isolate::Delete(shared_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