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 #include "precompiled.hpp" 26 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 27 #include "gc_implementation/g1/satbQueue.hpp" 28 #include "memory/allocation.inline.hpp" 29 #include "memory/sharedHeap.hpp" 30 #include "oops/oop.inline.hpp" 31 #include "runtime/mutexLocker.hpp" 32 #include "runtime/thread.hpp" 33 #include "runtime/vmThread.hpp" 34 35 void ObjPtrQueue::flush() { 36 // The buffer might contain refs into the CSet. We have to filter it 37 // first before we flush it, otherwise we might end up with an 38 // enqueued buffer with refs into the CSet which breaks our invariants. 39 filter(); 40 PtrQueue::flush(); 41 } 42 43 // This method removes entries from an SATB buffer that will not be 44 // useful to the concurrent marking threads. An entry is removed if it 45 // satisfies one of the following conditions: 46 // 47 // * it points to an object outside the G1 heap (G1's concurrent 48 // marking only visits objects inside the G1 heap), 49 // * it points to an object that has been allocated since marking 50 // started (according to SATB those objects do not need to be 51 // visited during marking), or 52 // * it points to an object that has already been marked (no need to 53 // process it again). 54 // | 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 #include "precompiled.hpp" 26 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 27 #include "gc_implementation/g1/satbQueue.hpp" 28 #include "memory/allocation.inline.hpp" 29 #include "memory/sharedHeap.hpp" 30 #include "oops/oop.inline.hpp" 31 #include "runtime/mutexLocker.hpp" 32 #include "runtime/thread.hpp" 33 #include "runtime/vmThread.hpp" 34 35 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC 36 37 void ObjPtrQueue::flush() { 38 // The buffer might contain refs into the CSet. We have to filter it 39 // first before we flush it, otherwise we might end up with an 40 // enqueued buffer with refs into the CSet which breaks our invariants. 41 filter(); 42 PtrQueue::flush(); 43 } 44 45 // This method removes entries from an SATB buffer that will not be 46 // useful to the concurrent marking threads. An entry is removed if it 47 // satisfies one of the following conditions: 48 // 49 // * it points to an object outside the G1 heap (G1's concurrent 50 // marking only visits objects inside the G1 heap), 51 // * it points to an object that has been allocated since marking 52 // started (according to SATB those objects do not need to be 53 // visited during marking), or 54 // * it points to an object that has already been marked (no need to 55 // process it again). 56 // |