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

Reviewed-by: ayang, tschatzl
This commit is contained in:
Kim Barrett 2021-06-15 22:05:15 +00:00
parent 0b09129fae
commit 00e33a45fe
5 changed files with 11 additions and 42 deletions

View file

@ -495,9 +495,7 @@ HeapWord* DefNewGeneration::allocate_from_space(size_t size) {
return result; return result;
} }
HeapWord* DefNewGeneration::expand_and_allocate(size_t size, HeapWord* DefNewGeneration::expand_and_allocate(size_t size, bool is_tlab) {
bool is_tlab,
bool parallel) {
// We don't attempt to expand the young generation (but perhaps we should.) // We don't attempt to expand the young generation (but perhaps we should.)
return allocate(size, is_tlab); return allocate(size, is_tlab);
} }

View file

@ -308,9 +308,8 @@ protected:
bool clear_all_soft_refs, bool clear_all_soft_refs,
size_t size, size_t size,
bool is_tlab); bool is_tlab);
HeapWord* expand_and_allocate(size_t size,
bool is_tlab, HeapWord* expand_and_allocate(size_t size, bool is_tlab);
bool parallel = false);
oop copy_to_survivor_space(oop old); oop copy_to_survivor_space(oop old);
uint tenuring_threshold() { return _tenuring_threshold; } uint tenuring_threshold() { return _tenuring_threshold; }

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -188,34 +188,10 @@ void TenuredGeneration::collect(bool full,
} }
HeapWord* HeapWord*
TenuredGeneration::expand_and_allocate(size_t word_size, TenuredGeneration::expand_and_allocate(size_t word_size, bool is_tlab) {
bool is_tlab,
bool parallel) {
assert(!is_tlab, "TenuredGeneration does not support TLAB allocation"); assert(!is_tlab, "TenuredGeneration does not support TLAB allocation");
if (parallel) { expand(word_size*HeapWordSize, _min_heap_delta_bytes);
MutexLocker x(ParGCRareEvent_lock); return _the_space->allocate(word_size);
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);
}
} }
bool TenuredGeneration::expand(size_t bytes, size_t expand_bytes) { bool TenuredGeneration::expand(size_t bytes, size_t expand_bytes) {

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -93,9 +93,7 @@ class TenuredGeneration: public CardGeneration {
size_t size, size_t size,
bool is_tlab); bool is_tlab);
HeapWord* expand_and_allocate(size_t size, HeapWord* expand_and_allocate(size_t size, bool is_tlab);
bool is_tlab,
bool parallel = false);
virtual void prepare_for_verify(); virtual void prepare_for_verify();

View file

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * 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 // successful, perform the allocation and return the resulting
// "oop" (initializing the allocated block). If the allocation is // "oop" (initializing the allocated block). If the allocation is
// still unsuccessful, return "NULL". // still unsuccessful, return "NULL".
virtual HeapWord* expand_and_allocate(size_t word_size, virtual HeapWord* expand_and_allocate(size_t word_size, bool is_tlab) = 0;
bool is_tlab,
bool parallel = false) = 0;
// Some generations may require some cleanup or preparation actions before // Some generations may require some cleanup or preparation actions before
// allowing a collection. The default is to do nothing. // allowing a collection. The default is to do nothing.