< prev index next >

src/share/vm/gc/g1/g1RootProcessor.cpp

Print this page
rev 8362 : 8079792: GC directory structure cleanup
Reviewed-by:


  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 
  27 #include "classfile/stringTable.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "code/codeCache.hpp"
  30 #include "gc_implementation/g1/bufferingOopClosure.hpp"
  31 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  32 #include "gc_implementation/g1/g1CollectorPolicy.hpp"
  33 #include "gc_implementation/g1/g1GCPhaseTimes.hpp"
  34 #include "gc_implementation/g1/g1RemSet.inline.hpp"
  35 #include "gc_implementation/g1/g1RootProcessor.hpp"
  36 #include "memory/allocation.inline.hpp"
  37 #include "runtime/fprofiler.hpp"
  38 #include "runtime/mutex.hpp"
  39 #include "services/management.hpp"
  40 
  41 class G1CodeBlobClosure : public CodeBlobClosure {
  42   class HeapRegionGatheringOopClosure : public OopClosure {
  43     G1CollectedHeap* _g1h;
  44     OopClosure* _work;
  45     nmethod* _nm;
  46 
  47     template <typename T>
  48     void do_oop_work(T* p) {
  49       _work->do_oop(p);
  50       T oop_or_narrowoop = oopDesc::load_heap_oop(p);
  51       if (!oopDesc::is_null(oop_or_narrowoop)) {
  52         oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
  53         HeapRegion* hr = _g1h->heap_region_containing_raw(o);
  54         assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
  55         hr->add_strong_code_root(_nm);




  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 
  27 #include "classfile/stringTable.hpp"
  28 #include "classfile/systemDictionary.hpp"
  29 #include "code/codeCache.hpp"
  30 #include "gc/g1/bufferingOopClosure.hpp"
  31 #include "gc/g1/g1CollectedHeap.inline.hpp"
  32 #include "gc/g1/g1CollectorPolicy.hpp"
  33 #include "gc/g1/g1GCPhaseTimes.hpp"
  34 #include "gc/g1/g1RemSet.inline.hpp"
  35 #include "gc/g1/g1RootProcessor.hpp"
  36 #include "memory/allocation.inline.hpp"
  37 #include "runtime/fprofiler.hpp"
  38 #include "runtime/mutex.hpp"
  39 #include "services/management.hpp"
  40 
  41 class G1CodeBlobClosure : public CodeBlobClosure {
  42   class HeapRegionGatheringOopClosure : public OopClosure {
  43     G1CollectedHeap* _g1h;
  44     OopClosure* _work;
  45     nmethod* _nm;
  46 
  47     template <typename T>
  48     void do_oop_work(T* p) {
  49       _work->do_oop(p);
  50       T oop_or_narrowoop = oopDesc::load_heap_oop(p);
  51       if (!oopDesc::is_null(oop_or_narrowoop)) {
  52         oop o = oopDesc::decode_heap_oop_not_null(oop_or_narrowoop);
  53         HeapRegion* hr = _g1h->heap_region_containing_raw(o);
  54         assert(!_g1h->obj_in_cs(o) || hr->rem_set()->strong_code_roots_list_contains(_nm), "if o still in CS then evacuation failed and nm must already be in the remset");
  55         hr->add_strong_code_root(_nm);


< prev index next >