src/hotspot/share/prims/resolvedMethodTable.cpp
changeset 54574 7b74bbe5085b
parent 54511 fbfcebad8e66
child 54623 1126f0607c70
--- a/src/hotspot/share/prims/resolvedMethodTable.cpp	Thu Apr 18 07:02:07 2019 -0400
+++ b/src/hotspot/share/prims/resolvedMethodTable.cpp	Wed Apr 17 07:41:09 2019 +0200
@@ -346,16 +346,6 @@
 // cleaning. Note it might trigger a resize instead.
 void ResolvedMethodTable::finish_dead_counter() {
   check_concurrent_work();
-
-#ifdef ASSERT
-  if (SafepointSynchronize::is_at_safepoint()) {
-    size_t fail_cnt = verify_and_compare_entries();
-    if (fail_cnt != 0) {
-      tty->print_cr("ERROR: fail_cnt=" SIZE_FORMAT, fail_cnt);
-      guarantee(fail_cnt == 0, "unexpected ResolvedMethodTable verification failures");
-    }
-  }
-#endif // ASSERT
 }
 
 #if INCLUDE_JVMTI
@@ -402,26 +392,16 @@
 }
 #endif // INCLUDE_JVMTI
 
-// Verification and comp
-class VerifyCompResolvedMethod : StackObj {
-  GrowableArray<oop>* _oops;
+// Verification
+class VerifyResolvedMethod : StackObj {
  public:
-  size_t _errors;
-  VerifyCompResolvedMethod(GrowableArray<oop>* oops) : _oops(oops), _errors(0) {}
   bool operator()(WeakHandle<vm_resolved_method_table_data>* val) {
-    oop s = val->peek();
-    if (s == NULL) {
-      return true;
+    oop obj = val->peek();
+    if (obj != NULL) {
+      Method* method = (Method*)java_lang_invoke_ResolvedMethodName::vmtarget(obj);
+      guarantee(method->is_method(), "Must be");
+      guarantee(!method->is_old(), "Must be");
     }
-    int len = _oops->length();
-    for (int i = 0; i < len; i++) {
-      bool eq = s == _oops->at(i);
-      assert(!eq, "Duplicate entries");
-      if (eq) {
-        _errors++;
-      }
-    }
-    _oops->push(s);
     return true;
   };
 };
@@ -430,16 +410,9 @@
   return _items_count;
 }
 
-size_t ResolvedMethodTable::verify_and_compare_entries() {
-  Thread* thr = Thread::current();
-  GrowableArray<oop>* oops =
-    new (ResourceObj::C_HEAP, mtInternal)
-      GrowableArray<oop>((int)_current_size, true);
-
-  VerifyCompResolvedMethod vcs(oops);
-  if (!_local_table->try_scan(thr, vcs)) {
+void ResolvedMethodTable::verify() {
+  VerifyResolvedMethod vcs;
+  if (!_local_table->try_scan(Thread::current(), vcs)) {
     log_info(membername, table)("verify unavailable at this moment");
   }
-  delete oops;
-  return vcs._errors;
 }