src/hotspot/share/utilities/concurrentHashTable.hpp
changeset 52717 b22da519f2e3
parent 52516 d5eebe1e03fe
child 53149 259c36ef27df
--- a/src/hotspot/share/utilities/concurrentHashTable.hpp	Wed Nov 28 11:06:58 2018 +0100
+++ b/src/hotspot/share/utilities/concurrentHashTable.hpp	Wed Nov 28 11:06:27 2018 +0100
@@ -313,8 +313,13 @@
 
   // Insert which handles a number of cases.
   template <typename LOOKUP_FUNC, typename VALUE_FUNC, typename CALLBACK_FUNC>
-  bool internal_insert(Thread* thread, LOOKUP_FUNC& lookup_f, VALUE_FUNC& value_f,
-                       CALLBACK_FUNC& callback, bool* grow_hint = NULL, bool* clean_hint = NULL);
+  bool internal_get_insert(Thread* thread, LOOKUP_FUNC& lookup_f, VALUE_FUNC& value_f,
+                           CALLBACK_FUNC& callback_f, bool* grow_hint = NULL, bool* clean_hint = NULL);
+
+  // Plain insert.
+  template <typename LOOKUP_FUNC>
+  bool internal_insert(Thread* thread, LOOKUP_FUNC& lookup_f, const VALUE& value,
+                       bool* grow_hint, bool* clean_hint);
 
   // Returns true if an item matching LOOKUP_FUNC is removed.
   // Calls DELETE_FUNC before destroying the node.
@@ -402,7 +407,7 @@
   template <typename LOOKUP_FUNC, typename VALUE_FUNC, typename CALLBACK_FUNC>
   bool get_insert_lazy(Thread* thread, LOOKUP_FUNC& lookup_f, VALUE_FUNC& val_f,
                        CALLBACK_FUNC& callback_f, bool* grow_hint = NULL, bool* clean_hint = NULL) {
-    return !internal_insert(thread, lookup_f, val_f, callback_f, grow_hint, clean_hint);
+    return !internal_get_insert(thread, lookup_f, val_f, callback_f, grow_hint, clean_hint);
   }
 
   // Same without CALLBACK_FUNC.
@@ -442,8 +447,7 @@
   template <typename LOOKUP_FUNC>
   bool insert(Thread* thread, LOOKUP_FUNC& lookup_f, const VALUE& value,
               bool* grow_hint = NULL, bool* clean_hint = NULL) {
-    LazyValueRetrieve vp(value);
-    return internal_insert(thread, lookup_f, vp, noOp, grow_hint, clean_hint);
+    return internal_insert(thread, lookup_f, value, grow_hint, clean_hint);
   }
 
   // This does a fast unsafe insert and can thus only be used when there is no