< prev index next >

src/hotspot/share/gc/g1/g1CodeCacheRemSet.cpp

Print this page




  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 "code/codeCache.hpp"
  27 #include "code/nmethod.hpp"
  28 #include "gc/g1/g1CodeRootSetTable.hpp"
  29 #include "gc/g1/g1CodeCacheRemSet.hpp"
  30 #include "gc/g1/heapRegion.hpp"
  31 #include "memory/heap.hpp"
  32 #include "memory/iterator.hpp"
  33 #include "oops/access.inline.hpp"
  34 #include "oops/oop.inline.hpp"

  35 #include "utilities/hashtable.inline.hpp"
  36 #include "utilities/stack.inline.hpp"
  37 
  38 G1CodeRootSetTable* volatile G1CodeRootSetTable::_purge_list = NULL;
  39 
  40 size_t G1CodeRootSetTable::mem_size() {
  41   return sizeof(G1CodeRootSetTable) + (entry_size() * number_of_entries()) + (sizeof(HashtableBucket<mtGC>) * table_size());
  42 }
  43 
  44 G1CodeRootSetTable::Entry* G1CodeRootSetTable::new_entry(nmethod* nm) {
  45   unsigned int hash = compute_hash(nm);
  46   Entry* entry = (Entry*) new_entry_free_list();
  47   if (entry == NULL) {
  48     entry = (Entry*) NEW_C_HEAP_ARRAY2(char, entry_size(), mtGC, CURRENT_PC);
  49   }
  50   entry->set_next(NULL);
  51   entry->set_hash(hash);
  52   entry->set_literal(nm);
  53   return entry;
  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 "code/codeCache.hpp"
  27 #include "code/nmethod.hpp"
  28 #include "gc/g1/g1CodeRootSetTable.hpp"
  29 #include "gc/g1/g1CodeCacheRemSet.hpp"
  30 #include "gc/g1/heapRegion.hpp"
  31 #include "memory/heap.hpp"
  32 #include "memory/iterator.hpp"
  33 #include "oops/access.inline.hpp"
  34 #include "oops/oop.inline.hpp"
  35 #include "runtime/atomic.hpp"
  36 #include "utilities/hashtable.inline.hpp"
  37 #include "utilities/stack.inline.hpp"
  38 
  39 G1CodeRootSetTable* volatile G1CodeRootSetTable::_purge_list = NULL;
  40 
  41 size_t G1CodeRootSetTable::mem_size() {
  42   return sizeof(G1CodeRootSetTable) + (entry_size() * number_of_entries()) + (sizeof(HashtableBucket<mtGC>) * table_size());
  43 }
  44 
  45 G1CodeRootSetTable::Entry* G1CodeRootSetTable::new_entry(nmethod* nm) {
  46   unsigned int hash = compute_hash(nm);
  47   Entry* entry = (Entry*) new_entry_free_list();
  48   if (entry == NULL) {
  49     entry = (Entry*) NEW_C_HEAP_ARRAY2(char, entry_size(), mtGC, CURRENT_PC);
  50   }
  51   entry->set_next(NULL);
  52   entry->set_hash(hash);
  53   entry->set_literal(nm);
  54   return entry;
  55 }


< prev index next >