5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 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 # include "incls/_precompiled.incl" 26 # include "incls/_cardTableExtension.cpp.incl" 27 28 // Checks an individual oop for missing precise marks. Mark 29 // may be either dirty or newgen. 30 class CheckForUnmarkedOops : public OopClosure { 31 private: 32 PSYoungGen* _young_gen; 33 CardTableExtension* _card_table; 34 HeapWord* _unmarked_addr; 35 jbyte* _unmarked_card; 36 37 protected: 38 template <class T> void do_oop_work(T* p) { 39 oop obj = oopDesc::load_decode_heap_oop_not_null(p); 40 if (_young_gen->is_in_reserved(obj) && 41 !_card_table->addr_is_marked_imprecise(p)) { 42 // Don't overwrite the first missing card mark 43 if (_unmarked_addr == NULL) { 44 _unmarked_addr = (HeapWord*)p; 45 _unmarked_card = _card_table->byte_for(p); 46 } | 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 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 #include "precompiled.hpp" 26 #include "gc_implementation/parallelScavenge/cardTableExtension.hpp" 27 #include "gc_implementation/parallelScavenge/gcTaskManager.hpp" 28 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" 29 #include "gc_implementation/parallelScavenge/psTasks.hpp" 30 #include "gc_implementation/parallelScavenge/psYoungGen.hpp" 31 #include "oops/oop.inline.hpp" 32 #include "oops/oop.psgc.inline.hpp" 33 34 // Checks an individual oop for missing precise marks. Mark 35 // may be either dirty or newgen. 36 class CheckForUnmarkedOops : public OopClosure { 37 private: 38 PSYoungGen* _young_gen; 39 CardTableExtension* _card_table; 40 HeapWord* _unmarked_addr; 41 jbyte* _unmarked_card; 42 43 protected: 44 template <class T> void do_oop_work(T* p) { 45 oop obj = oopDesc::load_decode_heap_oop_not_null(p); 46 if (_young_gen->is_in_reserved(obj) && 47 !_card_table->addr_is_marked_imprecise(p)) { 48 // Don't overwrite the first missing card mark 49 if (_unmarked_addr == NULL) { 50 _unmarked_addr = (HeapWord*)p; 51 _unmarked_card = _card_table->byte_for(p); 52 } |