hotspot/src/share/vm/classfile/placeholders.cpp
changeset 46554 aa1cfd918c4f
parent 46545 b970b6e40209
child 46729 c62d2e8b2728
--- a/hotspot/src/share/vm/classfile/placeholders.cpp	Wed Jul 05 23:44:18 2017 +0200
+++ b/hotspot/src/share/vm/classfile/placeholders.cpp	Thu Jun 22 00:51:07 2017 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -175,37 +175,6 @@
     : TwoOopHashtable<Symbol*, mtClass>(table_size, sizeof(PlaceholderEntry)) {
 }
 
-
-void PlaceholderTable::classes_do(KlassClosure* f) {
-  for (int index = 0; index < table_size(); index++) {
-    for (PlaceholderEntry* probe = bucket(index);
-                           probe != NULL;
-                           probe = probe->next()) {
-      probe->classes_do(f);
-    }
-  }
-}
-
-
-void PlaceholderEntry::classes_do(KlassClosure* closure) {
-  assert(klassname() != NULL, "should have a non-null klass");
-  if (_instanceKlass != NULL) {
-    closure->do_klass(instance_klass());
-  }
-}
-
-// do all entries in the placeholder table
-void PlaceholderTable::entries_do(void f(Symbol*)) {
-  for (int index = 0; index < table_size(); index++) {
-    for (PlaceholderEntry* probe = bucket(index);
-                           probe != NULL;
-                           probe = probe->next()) {
-      f(probe->klassname());
-    }
-  }
-}
-
-
 #ifndef PRODUCT
 // Note, doesn't append a cr
 void PlaceholderEntry::print() const {
@@ -249,27 +218,19 @@
 }
 
 void PlaceholderTable::verify() {
-  int element_count = 0;
-  for (int pindex = 0; pindex < table_size(); pindex++) {
-    for (PlaceholderEntry* probe = bucket(pindex);
-                           probe != NULL;
-                           probe = probe->next()) {
-      probe->verify();
-      element_count++;  // both klasses and place holders count
-    }
-  }
-  guarantee(number_of_entries() == element_count,
-            "Verify of system dictionary failed");
+  verify_table<PlaceholderEntry>("Placeholder Table");
 }
 
 
 #ifndef PRODUCT
 void PlaceholderTable::print() {
+  tty->print_cr("Placeholder table table_size=%d, entries=%d",
+                table_size(), number_of_entries());
   for (int pindex = 0; pindex < table_size(); pindex++) {
     for (PlaceholderEntry* probe = bucket(pindex);
                            probe != NULL;
                            probe = probe->next()) {
-      if (Verbose) tty->print("%4d: ", pindex);
+      tty->print("%4d: ", pindex);
       tty->print(" place holder ");
 
       probe->print();