src/share/vm/utilities/hashtable.inline.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File

## src/share/vm/utilities/hashtable.inline.hpp

Print this page

    *** 35,44 ****
    --- 35,47 ----
      // --------------------------------------------------------------------------

      // Initialize a table.

      template <MEMFLAGS F> inline BasicHashtable<F>::BasicHashtable(int table_size, int entry_size) {
    +   if (HashtablesUseEvenSize == true) {
    +     table_size += (table_size%2);
    +   }
        // Called on startup, no locking needed
        initialize(table_size, entry_size, 0);
        _buckets = NEW_C_HEAP_ARRAY2(HashtableBucket<F>, table_size, F, CURRENT_PC);
        for (int index = 0; index < _table_size; index++) {
          _buckets[index].clear();
    *** 55,71 ****
    --- 58,103 ----
      }

      template <MEMFLAGS F> inline void BasicHashtable<F>::initialize(int table_size, int entry_size,
                                             int number_of_entries) {
    + #ifdef PRINT_HASHTABLES_CREATION
    +   fprintf(stderr, "BasicHashtable %p with size %d\n", this, (int)table_size);
    + #endif
        // Called on startup, no locking needed
        _table_size = table_size;
        _entry_size = entry_size;
        _free_list = NULL;
        _first_free_entry = NULL;
        _end_block = NULL;
        _number_of_entries = number_of_entries;
    +
    + #ifndef PRODUCT
    + //#ifdef PRODUCT_TEST
    +   for (int i=0; i<1024; i++) {
    +     _debug_table_threads[i] = 0;
    +   }
    +   _debug_resize_fire = 0;
    +   _debug_all_lookup_count = 0;
    +   _debug_all_insertion_count = 0;
    +   _debug_lookup_count = 0;
    +   _debug_insertion_count = 0;
    +   _debug_lookup_found_count = 0;
    +   _debug_lookup_found_max_duration = 0;
    +   _debug_lookup_found_total_duration = 0;
    +   _debug_chain_found_maximum_length = 0;
    +   _debug_chain_found_total_length = 0;
    +   _debug_lookup_failed_count = 0;
    +   _debug_lookup_failed_max_duration = 0;
    +   _debug_lookup_failed_total_duration = 0;
    +   _debug_chain_failed_maximum_length = 0;
    +   _debug_chain_failed_total_length = 0;
    +   _debug_resize_max_duration = 0;
    +   _debug_resize_total_duration = 0;
    +   _debug_resize_total_count = 0;
    + #endif
    +
      #ifdef ASSERT
        _lookup_count = 0;
        _lookup_length = 0;
      #endif
      }

src/share/vm/utilities/hashtable.inline.hpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File