2273N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// The following classes are C++ `closures` for iterating over objects, roots and spaces 342N/A// Closure provides abortability. 342N/A // A subtype can use this mechanism to indicate to some iterator mapping 342N/A // functions that the iteration should cease. 0N/A// OopClosure is used for iterating through roots (oop*) 0N/A // In support of post-processing of weak links of KlassKlass objects; 0N/A // see KlassKlass::oop_oop_iterate(). 941N/A // In support of post-processing of weak references in 941N/A // ProfileData (MethodDataOop) objects; see, for example, 941N/A // VirtualCallData::oop_iterate(). 0N/A // The methods below control how object iterations invoking this closure 0N/A // should be performed: 0N/A // If "true", invoke on header klass field. 0N/A bool do_header() {
return true; }
// Note that this is non-virtual. 0N/A // Controls how prefetching is done for invocations of this closure. 342N/A // True iff this closure may be safely applied more than once to an oop 342N/A // location without an intervening "major reset" (like the end of a GC). 0N/A// ObjectClosure is used for iterating through an object space 0N/A // Called for each object. 0N/A// Applies an oop closure to all ref fields in objects iterated over in an 0N/A// A version of ObjectClosure with "memory" (see _previous_address below) 0N/A // A return value of "true" can be used by the caller to decide 0N/A // if this object's end should *NOT* be recorded in 0N/A // _previous_address above. 0N/A// A version of ObjectClosure that is expected to be robust 0N/A// in the face of possibly uninitialized objects. 0N/A// The following are used in CompactibleFreeListSpace and 0N/A// ConcurrentMarkSweepGeneration. 0N/A// Blk closure (abstract class) 0N/A// A version of BlkClosure that is expected to be robust 0N/A// in the face of possibly uninitialized objects. 0N/A// SpaceClosure is used for iterating over spaces 0N/A // Called for each space 0N/A // Called for each compactible space 989N/A// CodeBlobClosure is used for iterating through code blobs 989N/A// in the code cache or on thread stacks 989N/A // Called for each code blob. 989N/A // Called for each code blob, but at most once per unique blob. 989N/A // = { if (!nmethod(cb)->test_set_oops_do_mark()) do_newly_marked_nmethod(cb); } 989N/A // = { if (active) nmethod::oops_do_marking_prologue(); } 989N/A // = { if (active) nmethod::oops_do_marking_epilogue(); } 989N/A// Applies an oop closure to all ref fields in code blobs 989N/A// iterated over in an object iteration. 989N/A // = { cb->oops_do(_cl); } 989N/A // = { if (_do_marking) super::do_code_blob(cb); else cb->oops_do(_cl); } 0N/A// MonitorClosure is used for iterating over monitors in the monitors cache 0N/A // called for each monitor in cache 0N/A// A closure that is applied without any arguments. 0N/A // I would have liked to declare this a pure virtual, but that breaks 0N/A // in mysterious ways, for unknown reasons. 0N/A// YieldClosure is intended for use by iteration loops 0N/A// to incrementalize their work, allowing interleaving 0N/A// of an interruptable task so as to allow other 0N/A// threads to run (which may not otherwise be able to access 0N/A// exclusive resources, for instance). Additionally, the 0N/A// closure also allows for aborting an ongoing iteration 0N/A// by means of checking the return value from the polling 0N/A// Abstract closure for serializing data (read or write). 0N/A // Return bool indicating whether closure implements read or write. 0N/A // the passed in value and fail is they don't match. This allows 0N/A // for verification that sections of the serialized data are of the 2062N/A // Clear LSB in symbol address; it can be set by CPSlot. 2062N/A // Store symbol, adjusting new pointer if the original pointer was adjusted 2062N/A // (symbol references in constant pool slots have their LSB set to 1). 935N/A// This class is used to flag phases of a collection that 935N/A// can unload classes and which should override the 935N/A// should_remember_klasses() and remember_klass() of OopClosure. 935N/A// The _must_remember_klasses is set in the contructor and restored 935N/A// in the destructor. _must_remember_klasses is checked in assertions 935N/A// in the OopClosure implementations of should_remember_klasses() and 935N/A// remember_klass() and the expectation is that the OopClosure 935N/A// implementation should not be in use if _must_remember_klasses is set. 935N/A// Instances of RememberKlassesChecker can be place in 935N/A// marking phases of collections which can do class unloading. 935N/A// RememberKlassesChecker can be passed "false" to turn off checking. 935N/A// It is used by CMS when CMS yields to a different collector. 1190N/A // The ClassUnloading unloading flag affects the collectors except 1190N/A // CMS unloads classes if CMSClassUnloadingEnabled is true or 1190N/A // if ExplicitGCInvokesConcurrentAndUnloadsClasses is true and 1190N/A // the current collection is an explicit collection. Turning 1190N/A // on the checking in general for 1190N/A // ExplicitGCInvokesConcurrentAndUnloadsClasses and 1190N/A // UseConcMarkSweepGC should not lead to false positives. 1879N/A#
endif // SHARE_VM_MEMORY_ITERATOR_HPP