changeset 9346:e2f40992e003

Make ModuleEntry hashtable lookup more efficient.
author hseigel
date Thu, 05 Nov 2015 16:58:58 -0500
parents e2caae19bed6
children 87a0cdda6d9e
files src/share/vm/classfile/moduleEntry.cpp
diffstat 1 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/classfile/moduleEntry.cpp	Thu Nov 05 04:56:28 2015 -0800
+++ b/src/share/vm/classfile/moduleEntry.cpp	Thu Nov 05 16:58:58 2015 -0500
@@ -248,11 +248,10 @@
     // Return this table's unnamed module
     return unnamed_module();
   }
-  for (int i = 0; i < table_size(); i++) {
-    for (ModuleEntry* m = bucket(i); m != NULL; m = m->next()) {
-      if (m->name()->fast_compare(name) == 0) {
-        return m;
-      }
+  int index = index_for(name);
+  for (ModuleEntry* m = bucket(index); m != NULL; m = m->next()) {
+    if (m->name()->fast_compare(name) == 0) {
+      return m;
     }
   }
   return NULL;