markSweep.cpp revision 0
/*
* Copyright 1997-2005 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/_markSweep.cpp.incl"
#ifdef VALIDATE_MARK_SWEEP
bool MarkSweep::_pointer_tracking = false;
bool MarkSweep::_root_tracking = true;
#endif
_revisit_klass_stack->push(k);
}
void MarkSweep::follow_weak_klass_links() {
// All klasses on the revisit stack are marked at this point.
// Update and follow all subklass, sibling and implementor links.
for (int i = 0; i < _revisit_klass_stack->length(); i++) {
}
follow_stack();
}
"we should only be traversing objects here");
oop m = *p;
mark_object(m);
m->follow_contents(); // Follow contents of the marked object
}
}
// Push marked object, contents will be followed later
oop m = *p;
mark_object(m);
_marking_stack->push(m);
}
"roots shouldn't be things within the heap");
#ifdef VALIDATE_MARK_SWEEP
if (ValidateMarkSweep) {
_root_refs_stack->push(p);
}
#endif
oop m = *p;
mark_object(m);
m->follow_contents(); // Follow contents of the marked object
}
follow_stack();
}
void MarkSweep::follow_stack() {
while (!_marking_stack->is_empty()) {
obj->follow_contents();
}
}
// We preserve the mark which should be replaced at the end and the location that it
// will go. Note that the object that this markOop belongs to isn't currently at that
// address but it will be after phase4
// we try to store preserved marks in the to space of the new generation since this
// is storage which should be available. Most of the time this should be sufficient
// space for the marks we need to preserve but if it isn't we fall back in using
// GrowableArrays to keep track of the overflow.
if (_preserved_count < _preserved_count_max) {
} else {
if (_preserved_mark_stack == NULL) {
}
}
}
void MarkSweep::adjust_marks() {
"inconsistent preserved oop stacks");
// adjust the oops we saved earlier
for (size_t i = 0; i < _preserved_count; i++) {
}
// deal with the overflow stack
if (_preserved_oop_stack) {
for (int i = 0; i < _preserved_oop_stack->length(); i++) {
adjust_pointer(p);
}
}
}
void MarkSweep::restore_marks() {
"inconsistent preserved oop stacks");
}
// restore the marks we saved earlier
for (size_t i = 0; i < _preserved_count; i++) {
_preserved_marks[i].restore();
}
// deal with the overflow
if (_preserved_oop_stack) {
for (int i = 0; i < _preserved_oop_stack->length(); i++) {
}
}
}
#ifdef VALIDATE_MARK_SWEEP
if (!ValidateMarkSweep)
return;
if (!isroot) {
if (_pointer_tracking) {
_adjusted_pointers->remove(p);
}
} else {
if (index != -1) {
int l = _root_refs_stack->length();
if (l > 0 && l - 1 != index) {
} else {
_root_refs_stack->remove(p);
}
}
}
}
_adjusted_pointers->push(p);
}
class AdjusterTracker: public OopClosure {
public:
AdjusterTracker() {};
};
if (ValidateMarkSweep) {
_pointer_tracking = true;
}
}
void MarkSweep::check_interior_pointers() {
if (ValidateMarkSweep) {
_pointer_tracking = false;
}
}
if (ValidateMarkSweep) {
}
}
if (ValidateMarkSweep) {
_live_oops->push(p);
}
}
if (ValidateMarkSweep) {
}
}
"should be moved to forwarded location");
if (ValidateMarkSweep) {
}
if (RecordMarkSweepCompaction) {
_cur_gc_live_oops->push(q);
}
}
void MarkSweep::compaction_complete() {
if (RecordMarkSweepCompaction) {
}
}
if (!RecordMarkSweepCompaction) {
return;
}
if (_last_gc_live_oops == NULL) {
return;
}
for (int i = 0; i < _last_gc_live_oops->length(); i++) {
return;
}
}
}
#endif //VALIDATE_MARK_SWEEP
#ifdef VALIDATE_MARK_SWEEP
if (ValidateMarkSweep) {
_root_refs_stack->push(p);
} else {
_other_refs_stack->push(p);
}
}
#endif
mark_and_push(p);
}
void marksweep_init() { /* empty */ }
#ifndef PRODUCT
if (TraceMarkSweep)
}
#endif