2362N/A * Copyright (c) 2001, 2010, 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. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// A closure class for processing card table entries. Note that we don't 0N/A// require these closure objects to be stack-allocated. 0N/A // Process the card whose card table entry is "card_ptr". If returns 0N/A // "false", terminate the iteration early. 0N/A// A ptrQueue whose elements are "oops", pointers to object heads. 0N/A // Dirty card queues are always active, so we create them with their 0N/A // active field set to true. 0N/A // Apply the closure to all elements, and reset the index to make the 0N/A // buffer empty. If a closure application returns "false", return 0N/A // "false" immediately, halting the iteration. If "consume" is true, 0N/A // deletes processed entries from logs. 0N/A // Apply the closure to all elements of "buf", down to "index" 0N/A // (inclusive.) If returns "false", then a closure application returned 0N/A // "false", and we return immediately. If "consume" is true, entries are 0N/A // set to NULL as they are processed, so they will not be processed again 0N/A // Protected by the _cbl_mon. 0N/A // The number of completed buffers processed by mutator and rs thread, // The number of parallel ids that can be claimed to allow collector or // mutator threads to do card-processing work. // Register "blk" as "the closure" for all queues. Only one such closure // is allowed. The "apply_closure_to_completed_buffer" method will apply // this closure to a completed buffer, and "iterate_closure_all_threads" // applies it to partially-filled buffers (the latter should only be done // with the world stopped). // If there is a registered closure for buffers, apply it to all entries // in all currently-active buffers. This should only be applied at a // safepoint. (Currently must not be called in parallel; this should // change in the future.) If "consume" is true, processed entries are // If there exists some completed buffer, pop it, then apply the // registered closure to all its elements, nulling out those elements // processed. If all elements are processed, returns "true". If no // completed buffers exist, returns false. If a completed buffer exists, // but is only partially completed before a "yield" happens, the // partially completed buffer (with its processed elements set to NULL) // is returned to the completed buffer set, and this call returns false. // If there exists some completed buffer, pop it, then apply the // specified closure to all its elements, nulling out those elements // processed. If all elements are processed, returns "true". If no // completed buffers exist, returns false. If a completed buffer exists, // but is only partially completed before a "yield" happens, the // partially completed buffer (with its processed elements set to NULL) // is returned to the completed buffer set, and this call returns false. // Helper routine for the above. // Applies the current closure to all completed buffers, // Deallocate any completed log buffers // If a full collection is happening, reset partial logs, and ignore // completed ones: the full collection will make them all irrelevant. // If any threads have partial logs, add them to the global list of logs. #
endif // SHARE_VM_GC_IMPLEMENTATION_G1_DIRTYCARDQUEUE_HPP