mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8371369: Parallel: Relax precondition of PSOldGen::expand_and_allocate
Reviewed-by: eosterlund, fandreuzzi
This commit is contained in:
parent
59d2309578
commit
167c952bb0
@ -182,12 +182,11 @@ bool MutableSpace::cas_deallocate(HeapWord *obj, size_t size) {
|
||||
|
||||
// Only used by oldgen allocation.
|
||||
bool MutableSpace::needs_expand(size_t word_size) const {
|
||||
#ifdef ASSERT
|
||||
// If called by VM thread, locking is not needed.
|
||||
if (!Thread::current()->is_VM_thread()) {
|
||||
assert_lock_strong(PSOldGenExpand_lock);
|
||||
}
|
||||
#endif
|
||||
// This method can be invoked either outside of safepoint by java threads or
|
||||
// in safepoint by gc workers. Such accesses are synchronized by holding one
|
||||
// of the following locks.
|
||||
assert(Heap_lock->is_locked() || PSOldGenExpand_lock->is_locked(), "precondition");
|
||||
|
||||
// Holding the lock means end is stable. So while top may be advancing
|
||||
// via concurrent allocations, there is no need to order the reads of top
|
||||
// and end here, unlike in cas_allocate.
|
||||
|
||||
@ -118,8 +118,8 @@ void PSOldGen::initialize_performance_counters() {
|
||||
}
|
||||
|
||||
HeapWord* PSOldGen::expand_and_allocate(size_t word_size) {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "precondition");
|
||||
assert(Thread::current()->is_VM_thread(), "precondition");
|
||||
assert(Heap_lock->is_locked(), "precondition");
|
||||
|
||||
if (object_space()->needs_expand(word_size)) {
|
||||
expand(word_size*HeapWordSize);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user