Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8268647: Generation::expand_and_allocate has unused "parallel" argument #4485

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -495,9 +495,7 @@ HeapWord* DefNewGeneration::allocate_from_space(size_t size) {
return result;
}

HeapWord* DefNewGeneration::expand_and_allocate(size_t size,
bool is_tlab,
bool parallel) {
HeapWord* DefNewGeneration::expand_and_allocate(size_t size, bool is_tlab) {

This comment has been minimized.

@tschatzl

tschatzl Jun 14, 2021
Contributor Outdated

Suggested change
HeapWord* DefNewGeneration::expand_and_allocate(size_t size, bool is_tlab) {
HeapWord* DefNewGeneration::expand_and_allocate(size_t size, bool is_tlab) {
// We don't attempt to expand the young generation (but perhaps we should.)
return allocate(size, is_tlab);
}
@@ -308,9 +308,8 @@ class DefNewGeneration: public Generation {
bool clear_all_soft_refs,
size_t size,
bool is_tlab);
HeapWord* expand_and_allocate(size_t size,
bool is_tlab,
bool parallel = false);

HeapWord* expand_and_allocate(size_t size, bool is_tlab);

oop copy_to_survivor_space(oop old);
uint tenuring_threshold() { return _tenuring_threshold; }
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -188,34 +188,10 @@ void TenuredGeneration::collect(bool full,
}

HeapWord*
TenuredGeneration::expand_and_allocate(size_t word_size,
bool is_tlab,
bool parallel) {
TenuredGeneration::expand_and_allocate(size_t word_size, bool is_tlab) {
assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
if (parallel) {
MutexLocker x(ParGCRareEvent_lock);
HeapWord* result = NULL;
size_t byte_size = word_size * HeapWordSize;
while (true) {
expand(byte_size, _min_heap_delta_bytes);
if (GCExpandToAllocateDelayMillis > 0) {
os::naked_sleep(GCExpandToAllocateDelayMillis);
}
result = _the_space->par_allocate(word_size);
if ( result != NULL) {
return result;
} else {
// If there's not enough expansion space available, give up.
if (_virtual_space.uncommitted_size() < byte_size) {
return NULL;
}
// else try again
}
}
} else {
expand(word_size*HeapWordSize, _min_heap_delta_bytes);
return _the_space->allocate(word_size);
}
expand(word_size*HeapWordSize, _min_heap_delta_bytes);
return _the_space->allocate(word_size);
}

bool TenuredGeneration::expand(size_t bytes, size_t expand_bytes) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -93,9 +93,7 @@ class TenuredGeneration: public CardGeneration {
size_t size,
bool is_tlab);

HeapWord* expand_and_allocate(size_t size,
bool is_tlab,
bool parallel = false);
HeapWord* expand_and_allocate(size_t size, bool is_tlab);

virtual void prepare_for_verify();

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -333,9 +333,7 @@ class Generation: public CHeapObj<mtGC> {
// successful, perform the allocation and return the resulting
// "oop" (initializing the allocated block). If the allocation is
// still unsuccessful, return "NULL".
virtual HeapWord* expand_and_allocate(size_t word_size,
bool is_tlab,
bool parallel = false) = 0;
virtual HeapWord* expand_and_allocate(size_t word_size, bool is_tlab) = 0;

// Some generations may require some cleanup or preparation actions before
// allowing a collection. The default is to do nothing.