markSweep.cpp revision 948
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This code is free software; you can redistribute it and/or modify it
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * under the terms of the GNU General Public License version 2 only, as
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * published by the Free Software Foundation.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * This code is distributed in the hope that it will be useful, but WITHOUT
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * version 2 for more details (a copy is included in the LICENSE file that
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * accompanied this code).
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * You should have received a copy of the GNU General Public License version
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * 2 along with this work; if not, write to the Free Software Foundation,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * CA 95054 USA or visit www.sun.com if you need additional information or
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw * have any questions.
ed81dd52230eff1a7c7625caad21af232c36f6cbAlek Pinchuk#include "incls/_precompiled.incl"
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amw#include "incls/_markSweep.cpp.incl"
ed81dd52230eff1a7c7625caad21af232c36f6cbAlek PinchukGrowableArray<oop>* MarkSweep::_marking_stack = NULL;
ed81dd52230eff1a7c7625caad21af232c36f6cbAlek PinchukGrowableArray<Klass*>* MarkSweep::_revisit_klass_stack = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<DataLayout*>* MarkSweep::_revisit_mdo_stack = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<oop>* MarkSweep::_preserved_oop_stack = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<markOop>* MarkSweep::_preserved_mark_stack= NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<void*>* MarkSweep::_root_refs_stack = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<oop> * MarkSweep::_live_oops_moved_to = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<size_t>* MarkSweep::_live_oops_size = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<void*>* MarkSweep::_other_refs_stack = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<void*>* MarkSweep::_adjusted_pointers = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<HeapWord*>* MarkSweep::_cur_gc_live_oops = NULL;
da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0amwGrowableArray<HeapWord*>* MarkSweep::_cur_gc_live_oops_moved_to = NULL;
if (PrintRevisitStats) {
gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes());
follow_stack();
if (PrintRevisitStats) {
gclog_or_tty->print_cr("#classes in system dictionary = %d", SystemDictionary::number_of_classes());
follow_stack();
if (_preserved_oop_stack) {
adjust_pointer(p);
if (_preserved_oop_stack) {
#ifdef VALIDATE_MARK_SWEEP
if (!ValidateMarkSweep)
if (!isroot) {
if (_pointer_tracking) {
AdjusterTracker() {}
if (ValidateMarkSweep) {
_pointer_tracking = true;
if (ValidateMarkSweep) {
_pointer_tracking = false;
if (ValidateMarkSweep) {
if (ValidateMarkSweep) {
if (ValidateMarkSweep) {
if (ValidateMarkSweep) {
if (RecordMarkSweepCompaction) {
if (RecordMarkSweepCompaction) {
if (!RecordMarkSweepCompaction) {
tty->print_cr(" Was in oop " PTR_FORMAT ", size " SIZE_FORMAT ", at offset " SIZE_FORMAT, old_oop, sz, offset);
void MarkSweep::KeepAliveClosure::do_oop(narrowOop* p) { MarkSweep::KeepAliveClosure::do_oop_work(p); }
#ifndef PRODUCT
if (TraceMarkSweep)