psCompactionManager.cpp revision 941
/*
* Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
* 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*
*/
#include "incls/_precompiled.incl"
#include "incls/_psCompactionManager.cpp.incl"
marking_stack()->initialize();
// We want the overflow stack to be permanent
region_stack()->initialize();
#else
region_stack()->initialize();
// We want the overflow stack to be permanent
#endif
// Note that _revisit_klass_stack is allocated out of the
// C heap (as opposed to out of ResourceArena).
int size =
// From some experiments (#klass/k)^2 for k = 10 seems a better fit, but this will
// have to do for now until we are able to investigate a more optimal setting.
}
delete _overflow_stack;
delete _revisit_klass_stack;
delete _revisit_mdo_stack;
// _manager_array and _stack_array are statics
// shared with all instances of ParCompactionManager
// should not be deallocated.
}
"Needed for initialization");
_mark_bitmap = mbm;
// Create and register the ParCompactionManager(s) for the worker threads.
for(uint i=0; i<parallel_gc_threads; i++) {
_manager_array[i] = new ParCompactionManager();
#else
#endif
}
// The VMThread gets its own ParCompactionManager, which is not available
// for work stealing.
"Could not create ParCompactionManager");
"Not initialized?");
}
bool ParCompactionManager::should_update() {
}
bool ParCompactionManager::should_copy() {
}
bool ParCompactionManager::should_verify_only() {
}
bool ParCompactionManager::should_reset_only() {
}
// For now save on a stack
stack_push(m);
}
}
}
// Should not be used in the parallel case
return NULL;
}
// Save region on a stack
#ifdef ASSERT
#endif
}
#else
}
#endif
}
#else
// Should not be used in the parallel case
return false;
#endif
}
return _manager_array[index];
}
void ParCompactionManager::reset() {
}
}
#ifdef ASSERT
#endif /* ASSERT */
do {
// Drain overflow stack first, so other threads can steal from
// claimed stack while we work.
while(!overflow_stack()->is_empty()) {
obj->follow_contents(this);
}
// obj is a reference!!!
// It would be nice to assert about the type of objects we might
// pop, but they can come from anywhere, unfortunately.
obj->follow_contents(this);
}
}
}
}
void ParCompactionManager::drain_region_stacks() {
#ifdef ASSERT
#endif /* ASSERT */
#if 1 // def DO_PARALLEL - the serial code hasn't been updated
do {
// Drain overflow stack first, so other threads can steal from
// claimed stack while we work.
}
}
} while (!region_stack()->is_empty());
#else
// Drain overflow stack first, so other threads can steal from
// claimed stack while we work.
while(!region_overflow_stack()->is_empty()) {
}
// obj is a reference!!!
// It would be nice to assert about the type of objects we might
// pop, but they can come from anywhere, unfortunately.
}
} while((region_stack()->size() != 0) ||
(region_overflow_stack()->length() != 0));
#endif
#else
#endif
#else
while (obj = retrieve_for_scanning()) {
obj->follow_contents(this);
}
#endif
}
#ifdef ASSERT
}
#endif