Skip to content
Permalink
Browse files
8268647: Generation::expand_and_allocate has unused "parallel" argument
Reviewed-by: ayang, tschatzl
  • Loading branch information
Kim Barrett committed Jun 15, 2021
1 parent 0b09129 commit 00e33a45feee1544a9d5be8b2fd1e0987ef1dfc5
@@ -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) {
// 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.

1 comment on commit 00e33a4

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 00e33a4 Jun 15, 2021

Please sign in to comment.