src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp

Print this page
rev 5920 : 8035406: Improve data structure for Code Cache remembered sets
Summary: Change the code cache remembered sets data structure from a GrowableArray to a chunked list of nmethods. This makes the data structure more amenable to parallelization, and decreases freeing time.
Reviewed-by:
   1 /*
   2  * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  *


1639   // cleanup. Although the methods are reentrant, population/draining
1640   // phases must not overlap. For synchronization purposes the last
1641   // element on the list points to itself.
1642   HeapRegion* _dirty_cards_region_list;
1643   void push_dirty_cards_region(HeapRegion* hr);
1644   HeapRegion* pop_dirty_cards_region();
1645 
1646   // Optimized nmethod scanning support routines
1647 
1648   // Register the given nmethod with the G1 heap.
1649   virtual void register_nmethod(nmethod* nm);
1650 
1651   // Unregister the given nmethod from the G1 heap.
1652   virtual void unregister_nmethod(nmethod* nm);
1653 
1654   // Migrate the nmethods in the code root lists of the regions
1655   // in the collection set to regions in to-space. In the event
1656   // of an evacuation failure, nmethods that reference objects
1657   // that were not successfully evacuated are not migrated.
1658   void migrate_strong_code_roots();



1659 
1660   // During an initial mark pause, mark all the code roots that
1661   // point into regions *not* in the collection set.
1662   void mark_strong_code_roots(uint worker_id);
1663 
1664   // Rebuild the strong code root lists for each region
1665   // after a full GC.
1666   void rebuild_strong_code_roots();
1667 
1668   // Delete entries for dead interned string and clean up unreferenced symbols
1669   // in symbol table, possibly in parallel.
1670   void unlink_string_and_symbol_table(BoolObjectClosure* is_alive, bool unlink_strings = true, bool unlink_symbols = true);
1671 
1672   // Verification
1673 
1674   // The following is just to alert the verification code
1675   // that a full collection has occurred and that the
1676   // remembered sets are no longer up to date.
1677   bool _full_collection;
1678   void set_full_collection() { _full_collection = true;}


   1 /*
   2  * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   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  *


1639   // cleanup. Although the methods are reentrant, population/draining
1640   // phases must not overlap. For synchronization purposes the last
1641   // element on the list points to itself.
1642   HeapRegion* _dirty_cards_region_list;
1643   void push_dirty_cards_region(HeapRegion* hr);
1644   HeapRegion* pop_dirty_cards_region();
1645 
1646   // Optimized nmethod scanning support routines
1647 
1648   // Register the given nmethod with the G1 heap.
1649   virtual void register_nmethod(nmethod* nm);
1650 
1651   // Unregister the given nmethod from the G1 heap.
1652   virtual void unregister_nmethod(nmethod* nm);
1653 
1654   // Migrate the nmethods in the code root lists of the regions
1655   // in the collection set to regions in to-space. In the event
1656   // of an evacuation failure, nmethods that reference objects
1657   // that were not successfully evacuated are not migrated.
1658   void migrate_strong_code_roots();
1659 
1660   // Free up superfluous code root memory.
1661   void purge_code_root_memory();
1662 
1663   // During an initial mark pause, mark all the code roots that
1664   // point into regions *not* in the collection set.
1665   void mark_strong_code_roots(uint worker_id);
1666 
1667   // Rebuild the strong code root lists for each region
1668   // after a full GC.
1669   void rebuild_strong_code_roots();
1670 
1671   // Delete entries for dead interned string and clean up unreferenced symbols
1672   // in symbol table, possibly in parallel.
1673   void unlink_string_and_symbol_table(BoolObjectClosure* is_alive, bool unlink_strings = true, bool unlink_symbols = true);
1674 
1675   // Verification
1676 
1677   // The following is just to alert the verification code
1678   // that a full collection has occurred and that the
1679   // remembered sets are no longer up to date.
1680   bool _full_collection;
1681   void set_full_collection() { _full_collection = true;}