hotspot/src/share/vm/utilities/resourceHash.hpp
author stefank
Tue, 05 Apr 2016 10:35:39 +0200
changeset 37254 8631304f255c
parent 33754 49614940dafc
child 37466 287c4ebd11b0
permissions -rw-r--r--
8152637: Create a stack allocatable LogStream class Reviewed-by: rehn, brutisso
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     1
/*
33754
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
     2
 * Copyright (c) 2012, 2015 Oracle and/or its affiliates. All rights reserved.
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     4
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     7
 * published by the Free Software Foundation.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     8
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    13
 * accompanied this code).
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    14
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    18
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    21
 * questions.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    22
 *
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    23
 */
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    24
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    25
#ifndef SHARE_VM_UTILITIES_RESOURCEHASH_HPP
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    26
#define SHARE_VM_UTILITIES_RESOURCEHASH_HPP
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    27
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    28
#include "memory/allocation.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    29
#include "utilities/top.hpp"
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    30
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    31
template<typename K> struct ResourceHashtableFns {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    32
    typedef unsigned (*hash_fn)(K const&);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    33
    typedef bool (*equals_fn)(K const&, K const&);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    34
};
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    35
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    36
template<typename K> unsigned primitive_hash(const K& k) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    37
  unsigned hash = (unsigned)((uintptr_t)k);
33754
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    38
  return hash ^ (hash >> 3); // just in case we're dealing with aligned ptrs
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    39
}
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    40
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    41
template<typename K> bool primitive_equals(const K& k0, const K& k1) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    42
  return k0 == k1;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    43
}
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    44
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    45
template<
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    46
    typename K, typename V,
22827
07d991d45a51 8023033: PPC64 (part 13): basic changes for AIX
goetz
parents: 14385
diff changeset
    47
    // xlC does not compile this:
07d991d45a51 8023033: PPC64 (part 13): basic changes for AIX
goetz
parents: 14385
diff changeset
    48
    // http://stackoverflow.com/questions/8532961/template-argument-of-type-that-is-defined-by-inner-typedef-from-other-template-c
07d991d45a51 8023033: PPC64 (part 13): basic changes for AIX
goetz
parents: 14385
diff changeset
    49
    //typename ResourceHashtableFns<K>::hash_fn   HASH   = primitive_hash<K>,
07d991d45a51 8023033: PPC64 (part 13): basic changes for AIX
goetz
parents: 14385
diff changeset
    50
    //typename ResourceHashtableFns<K>::equals_fn EQUALS = primitive_equals<K>,
07d991d45a51 8023033: PPC64 (part 13): basic changes for AIX
goetz
parents: 14385
diff changeset
    51
    unsigned (*HASH)  (K const&)           = primitive_hash<K>,
07d991d45a51 8023033: PPC64 (part 13): basic changes for AIX
goetz
parents: 14385
diff changeset
    52
    bool     (*EQUALS)(K const&, K const&) = primitive_equals<K>,
33754
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    53
    unsigned SIZE = 256,
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    54
    ResourceObj::allocation_type ALLOC_TYPE = ResourceObj::RESOURCE_AREA,
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    55
    MEMFLAGS MEM_TYPE = mtInternal
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    56
    >
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    57
class ResourceHashtable : public ResourceObj {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    58
 private:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    59
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    60
  class Node : public ResourceObj {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    61
   public:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    62
    unsigned _hash;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    63
    K _key;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    64
    V _value;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    65
    Node* _next;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    66
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    67
    Node(unsigned hash, K const& key, V const& value) :
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    68
        _hash(hash), _key(key), _value(value), _next(NULL) {}
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    69
  };
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    70
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    71
  Node* _table[SIZE];
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    72
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    73
  // Returns a pointer to where the node where the value would reside if
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    74
  // it's in the table.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    75
  Node** lookup_node(unsigned hash, K const& key) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    76
    unsigned index = hash % SIZE;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    77
    Node** ptr = &_table[index];
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    78
    while (*ptr != NULL) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    79
      Node* node = *ptr;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    80
      if (node->_hash == hash && EQUALS(key, node->_key)) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    81
        break;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    82
      }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    83
      ptr = &(node->_next);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    84
    }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    85
    return ptr;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    86
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    87
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    88
  Node const** lookup_node(unsigned hash, K const& key) const {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    89
    return const_cast<Node const**>(
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    90
        const_cast<ResourceHashtable*>(this)->lookup_node(hash, key));
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    91
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    92
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    93
 public:
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    94
  ResourceHashtable() { memset(_table, 0, SIZE * sizeof(Node*)); }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
    95
33754
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    96
  ~ResourceHashtable() {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    97
    if (ALLOC_TYPE == C_HEAP) {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    98
      Node* const* bucket = _table;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
    99
      while (bucket < &_table[SIZE]) {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   100
        Node* node = *bucket;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   101
        while (node != NULL) {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   102
          Node* cur = node;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   103
          node = node->_next;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   104
          delete cur;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   105
        }
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   106
        ++bucket;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   107
      }
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   108
    }
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   109
  }
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   110
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   111
  bool contains(K const& key) const {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   112
    return get(key) != NULL;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   113
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   114
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   115
  V* get(K const& key) const {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   116
    unsigned hv = HASH(key);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   117
    Node const** ptr = lookup_node(hv, key);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   118
    if (*ptr != NULL) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   119
      return const_cast<V*>(&(*ptr)->_value);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   120
    } else {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   121
      return NULL;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   122
    }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   123
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   124
23187
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   125
 /**
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   126
  * Inserts or replaces a value in the table.
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   127
  * @return: true:  if a new item is added
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   128
  *          false: if the item already existed and the value is updated
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   129
  */
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   130
  bool put(K const& key, V const& value) {
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   131
    unsigned hv = HASH(key);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   132
    Node** ptr = lookup_node(hv, key);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   133
    if (*ptr != NULL) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   134
      (*ptr)->_value = value;
23187
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   135
      return false;
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   136
    } else {
33754
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   137
      *ptr = new (ALLOC_TYPE, MEM_TYPE) Node(hv, key, value);
23187
0f438571f278 8035946: Use ResourceHashtable for dependency checking
anoll
parents: 22827
diff changeset
   138
      return true;
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   139
    }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   140
  }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   141
33754
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   142
  bool remove(K const& key) {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   143
    unsigned hv = HASH(key);
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   144
    Node** ptr = lookup_node(hv, key);
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   145
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   146
    Node* node = *ptr;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   147
    if (node != NULL) {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   148
      *ptr = node->_next;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   149
      if (ALLOC_TYPE == C_HEAP) {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   150
        delete node;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   151
      }
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   152
      return true;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   153
    }
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   154
    return false;
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   155
  }
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   156
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   157
  // ITER contains bool do_entry(K const&, V const&), which will be
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   158
  // called for each entry in the table.  If do_entry() returns false,
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   159
  // the iteration is cancelled.
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   160
  template<class ITER>
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   161
  void iterate(ITER* iter) const {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   162
    Node* const* bucket = _table;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   163
    while (bucket < &_table[SIZE]) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   164
      Node* node = *bucket;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   165
      while (node != NULL) {
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   166
        bool cont = iter->do_entry(node->_key, node->_value);
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   167
        if (!cont) { return; }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   168
        node = node->_next;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   169
      }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   170
      ++bucket;
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   171
    }
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   172
  }
33754
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   173
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   174
  static size_t node_size() {
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   175
    return sizeof(Node);
49614940dafc 8055283: Expand ResourceHashtable with C_HEAP allocation, removal and some unit tests
mgerdin
parents: 23187
diff changeset
   176
  }
14385
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   177
};
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   178
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   179
959bbcc16725 7200776: Implement default methods in interfaces
kamg
parents:
diff changeset
   180
#endif // SHARE_VM_UTILITIES_RESOURCEHASH_HPP