< prev index next >

src/hotspot/share/classfile/compactHashtable.cpp

Print this page




  25 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "classfile/compactHashtable.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "logging/logMessage.hpp"
  30 #include "memory/dynamicArchive.hpp"
  31 #include "memory/heapShared.inline.hpp"
  32 #include "memory/metadataFactory.hpp"
  33 #include "memory/metaspaceShared.hpp"
  34 #include "runtime/vmThread.hpp"
  35 #include "utilities/numberSeq.hpp"
  36 #include <sys/stat.h>
  37 
  38 #if INCLUDE_CDS
  39 /////////////////////////////////////////////////////
  40 //
  41 // The compact hash table writer implementations
  42 //
  43 CompactHashtableWriter::CompactHashtableWriter(int num_entries,
  44                                                CompactHashtableStats* stats) {
  45   assert(DumpSharedSpaces || DynamicDumpSharedSpaces, "dump-time only");
  46   assert(num_entries >= 0, "sanity");
  47   _num_buckets = calculate_num_buckets(num_entries);
  48   assert(_num_buckets > 0, "no buckets");
  49 
  50   _num_entries_written = 0;
  51   _buckets = NEW_C_HEAP_ARRAY(GrowableArray<Entry>*, _num_buckets, mtSymbol);
  52   for (int i=0; i<_num_buckets; i++) {
  53     _buckets[i] = new (ResourceObj::C_HEAP, mtSymbol) GrowableArray<Entry>(0, true, mtSymbol);
  54   }
  55 
  56   _stats = stats;
  57   _compact_buckets = NULL;
  58   _compact_entries = NULL;
  59   _num_empty_buckets = 0;
  60   _num_value_only_buckets = 0;
  61   _num_other_buckets = 0;
  62 }
  63 
  64 CompactHashtableWriter::~CompactHashtableWriter() {
  65   for (int index = 0; index < _num_buckets; index++) {




  25 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "classfile/compactHashtable.hpp"
  28 #include "classfile/javaClasses.hpp"
  29 #include "logging/logMessage.hpp"
  30 #include "memory/dynamicArchive.hpp"
  31 #include "memory/heapShared.inline.hpp"
  32 #include "memory/metadataFactory.hpp"
  33 #include "memory/metaspaceShared.hpp"
  34 #include "runtime/vmThread.hpp"
  35 #include "utilities/numberSeq.hpp"
  36 #include <sys/stat.h>
  37 
  38 #if INCLUDE_CDS
  39 /////////////////////////////////////////////////////
  40 //
  41 // The compact hash table writer implementations
  42 //
  43 CompactHashtableWriter::CompactHashtableWriter(int num_entries,
  44                                                CompactHashtableStats* stats) {
  45   Arguments::assert_is_dumping_archive();
  46   assert(num_entries >= 0, "sanity");
  47   _num_buckets = calculate_num_buckets(num_entries);
  48   assert(_num_buckets > 0, "no buckets");
  49 
  50   _num_entries_written = 0;
  51   _buckets = NEW_C_HEAP_ARRAY(GrowableArray<Entry>*, _num_buckets, mtSymbol);
  52   for (int i=0; i<_num_buckets; i++) {
  53     _buckets[i] = new (ResourceObj::C_HEAP, mtSymbol) GrowableArray<Entry>(0, true, mtSymbol);
  54   }
  55 
  56   _stats = stats;
  57   _compact_buckets = NULL;
  58   _compact_entries = NULL;
  59   _num_empty_buckets = 0;
  60   _num_value_only_buckets = 0;
  61   _num_other_buckets = 0;
  62 }
  63 
  64 CompactHashtableWriter::~CompactHashtableWriter() {
  65   for (int index = 0; index < _num_buckets; index++) {


< prev index next >