6700789: G1: Enable use of compressed oops with G1 heaps

Modifications to G1 so as to allow the use of compressed oops.

Reviewed-by: apetrusenko, coleenp, jmasa, kvn, never, phh, tonyp
This commit is contained in:
Y. Srinivas Ramakrishna 2009-07-14 15:40:39 -07:00
parent 50d7db1805
commit 075c1335cb
58 changed files with 1233 additions and 1175 deletions

View file

@ -64,15 +64,18 @@ bool ParallelTaskTerminator::peek_in_queue_set() {
}
void ParallelTaskTerminator::yield() {
assert(_offered_termination <= _n_threads, "Invariant");
os::yield();
}
void ParallelTaskTerminator::sleep(uint millis) {
assert(_offered_termination <= _n_threads, "Invariant");
os::sleep(Thread::current(), millis, false);
}
bool
ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
assert(_offered_termination < _n_threads, "Invariant");
Atomic::inc(&_offered_termination);
uint yield_count = 0;
@ -96,6 +99,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
// Loop waiting for all threads to offer termination or
// more work.
while (true) {
assert(_offered_termination <= _n_threads, "Invariant");
// Are all threads offering termination?
if (_offered_termination == _n_threads) {
return true;
@ -151,6 +155,7 @@ ParallelTaskTerminator::offer_termination(TerminatorTerminator* terminator) {
if (peek_in_queue_set() ||
(terminator != NULL && terminator->should_exit_termination())) {
Atomic::dec(&_offered_termination);
assert(_offered_termination < _n_threads, "Invariant");
return false;
}
}