benchmark for performance results
[cdsspec-compiler.git] / benchmark / cliffc-hashtable / cliffc_hashtable.h
index 3cef98003233fbbb5ceaa89da53d7b00139f0269..b5b941e66d539d46b23f715638ec8d92818fe2b5 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <iostream>
 #include <atomic>
+#include "stdio.h" 
 //#include <common.h>
 #ifdef STANDALONE
 #include <assert.h>
@@ -413,8 +414,9 @@ friend class CHM;
        /**
                @Begin
                @Interface: Get
-               //@Commit_point_set: Get_Point1 | Get_Point2 | Get_Point3 | Get_ReadKVS
-               @Commit_point_set: Get_Point1 | Get_Point2 | Get_Point3
+               //@Commit_point_set: Get_Point1 | Get_Point2 | Get_ReadKVS | Get_ReadNewKVS | Get_Clear
+               @Commit_point_set: Get_Point1 | Get_Point2 | Get_Clear
+               //@Commit_point_set: Get_Point1 | Get_Point2 | Get_Point3
                @ID: getKeyTag(key)
                @Action:
                        TypeV *_Old_Val = (TypeV*) spec_table_get(map, key);
@@ -451,7 +453,8 @@ friend class CHM;
        /**
                @Begin
                @Interface: Put
-               @Commit_point_set: Put_Point
+               //@Commit_point_set: Put_Point | Put_ReadKVS | Put_ReadNewKVS | Put_WriteKey
+               @Commit_point_set: Put_Point | Put_WriteKey
                @ID: getKeyTag(key)
                @Action:
                        # Remember this old value at checking point
@@ -735,6 +738,13 @@ friend class CHM;
                        if (keyeq(K, key_slot, hashes, idx, fullhash)) {
                                // Key hit! Check if table-resize in progress
                                if (!is_prime(V)) {
+                                       /**
+                                               @Begin
+                                               @Commit_point_clear: true
+                                               @Label: Get_Clear
+                                               @End
+                                       */
+
                                        /**
                                                @Begin
                                                @Commit_point_define: true
@@ -756,9 +766,9 @@ friend class CHM;
                                /**** FIXME: miss ****/
                                kvs_data *newkvs = chm->_newkvs.load(memory_order_acquire);
                                /**
-                                       @Begin
-                                       @Commit_point_define_check: newkvs == NULL
-                                       @Label: Get_Point3
+                                       //@Begin
+                                       @Commit_point_define_check: true
+                                       @Label: Get_ReadNewKVS
                                        @End
                                */
                                return newkvs == NULL ? NULL : get_impl(topmap,
@@ -825,6 +835,13 @@ friend class CHM;
                                if (val_slot == TOMBSTONE) return val_slot;
                                // Claim the null key-slot
                                if (CAS_key(kvs, idx, NULL, key_slot)) {
+                                       /**
+                                               @Begin
+                                               @Commit_point_define: true
+                                               @Potential_commit_point_label: Write_Key_Point
+                                               @Label: Put_WriteKey
+                                               @End
+                                       */
                                        chm->_slots.fetch_add(1, memory_order_relaxed); // Inc key-slots-used count
                                        hashes[idx] = fullhash; // Memorize full hash
                                        break;
@@ -858,6 +875,12 @@ friend class CHM;
                // its progress (eagerly try to resize soon)
                /**** FIXME: miss ****/
                newkvs = chm->_newkvs.load(memory_order_acquire);
+               /**
+                       //@Begin
+                       @Commit_point_define_check: true
+                       @Label: Put_ReadNewKVS
+                       @End
+               */
                if (newkvs == NULL &&
                        ((V == NULL && chm->table_full(reprobe_cnt, len)) || is_prime(V))) {
                        //model_print("resize2\n");