13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_SHARED_WEAKPROCESSOR_HPP 26 #define SHARE_VM_GC_SHARED_WEAKPROCESSOR_HPP 27 28 #include "memory/allocation.hpp" 29 #include "memory/iterator.hpp" 30 31 // Helper class to aid in root scanning and cleaning of weak oops in the VM. 32 // 33 // New sets of weak oops added to this class will automatically 34 // be cleaned by all GCs, including the young generation GCs. 35 class WeakProcessor : AllStatic { 36 public: 37 static void unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete = NULL); 38 static void oops_do(OopClosure* closure); 39 }; 40 41 #endif // SHARE_VM_GC_SHARED_WEAKPROCESSOR_HPP | 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 * 23 */ 24 25 #ifndef SHARE_VM_GC_SHARED_WEAKPROCESSOR_HPP 26 #define SHARE_VM_GC_SHARED_WEAKPROCESSOR_HPP 27 28 #include "memory/allocation.hpp" 29 #include "memory/iterator.hpp" 30 31 // Helper class to aid in root scanning and cleaning of weak oops in the VM. 32 // 33 // New contains of weak oops added to this class will automatically 34 // be cleaned by all GCs, including the young generation GCs. 35 class WeakProcessor : AllStatic { 36 public: 37 // Visit all oop*s and either apply the keep_alive closure if the referenced 38 // object is considered alive by the is_alive closure, otherwise do some 39 // container specific cleanup of element holding the oop. 40 // 41 // The complete closure is used as a post-processing step called 42 // after each container has been processed. 43 static void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* keep_alive, VoidClosure* complete = NULL); 44 45 // Visit all oop*s and apply the given clousre. 46 static void oops_do(OopClosure* closure); 47 }; 48 49 #endif // SHARE_VM_GC_SHARED_WEAKPROCESSOR_HPP |