/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#include "gc_implementation/parallelScavenge/psOldGen.hpp"
#include "gc_implementation/shared/gcTrace.hpp"
#include "gc_implementation/shared/mutableSpace.hpp"
#include "memory/memRegion.hpp"
#include "oops/oop.inline.hpp"
#include "oops/oop.psgc.inline.hpp"
// Create and register the PSPromotionManager(s) for the worker threads.
for(uint i=0; i<ParallelGCThreads; i++) {
_manager_array[i] = new PSPromotionManager();
}
// The VMThread gets its own PSPromotionManager, which is not available
// for work stealing.
}
return _manager_array[index];
}
return _manager_array[ParallelGCThreads];
}
manager_array(i)->reset();
}
}
bool promotion_failure_occurred = false;
promotion_failure_occurred = true;
}
manager->flush_labs();
}
return promotion_failure_occurred;
}
#if TASKQUEUE_STATS
void
}
void
}
static const char* const pm_stats_hdr[] = {
" --------masked------- arrays array",
"thr push steal chunked chunks",
"--- ---------- ---------- ---------- ----------"
};
void
manager_array(i)->print_taskqueue_stats(i);
}
manager_array(i)->print_local_stats(i);
}
}
void
_masked_pushes = _masked_steals = 0;
}
#endif // TASKQUEUE_STATS
// We set the old lab's start array.
if (_totally_drain) {
_target_stack_size = 0;
} else {
// don't let the target stack size to be more than 1/4 of the entries
}
// let's choose 1.5x the chunk size
reset();
}
// We need to get an assert in here to make sure the labs are always flushed.
// Do not prefill the LAB's, save heap wastage!
_young_gen_is_full = false;
_old_gen_is_full = false;
}
#ifdef ASSERT
#endif /* ASSERT */
do {
StarTask p;
// Drain overflow stack first, so other threads can steal from
// claimed stack while we work.
while (tq->pop_overflow(p)) {
}
if (totally_drain) {
}
} else {
}
}
}
// If either promotion lab fills up, we can flush the
// lab but not refill it, so check first.
if (!_young_lab.is_flushed())
_young_lab.flush();
if (!_old_lab.is_flushed())
// Let PSScavenge know if we overflowed
if (_young_gen_is_full) {
PSScavenge::set_survivor_overflow(true);
}
}
while (p < chunk_end) {
if (PSScavenge::should_scavenge(p)) {
}
++p;
}
}
int start;
if (end > (int) _min_array_size_for_chunking) {
// we'll chunk more
} else {
// this is the final chunk for this array
start = 0;
}
if (UseCompressedOops) {
} else {
}
}
// Attempt to CAS in the header.
// This tests if the header is still the same as when
// this started. If it is the same (i.e., no forwarding
// pointer has been installed), then this thread owns
// it.
// We won any races, we "own" this object.
obj->push_contents(this);
// Save the mark if needed
} else {
// We lost, someone else "owns" this object
// No unallocation to worry about.
}
#ifdef DEBUG
if (TraceScavenge) {
"promotion-failure",
}
#endif
return obj;
}