Change action_list_buffer to snapshot memory instead of half-shapshot-half-non-snapshot
authorweiyu <weiyuluo1232@gmail.com>
Thu, 12 Sep 2019 21:03:28 +0000 (14:03 -0700)
committerweiyu <weiyuluo1232@gmail.com>
Thu, 12 Sep 2019 21:03:28 +0000 (14:03 -0700)
funcnode.cc
funcnode.h
history.cc

index 64972b4d4d1555a441bc30b7a3306314da9c9fce..19601fac5c4f3bd62882f8ba8456afb8ad36af0f 100644 (file)
@@ -7,13 +7,13 @@ FuncNode::FuncNode(ModelHistory * history) :
        func_inst_map(),
        inst_list(),
        entry_insts(),
-       action_list_buffer(),
        predicate_tree_position()
 {
        predicate_tree_entry = new Predicate(NULL, true);
        predicate_tree_entry->add_predicate_expr(NOPREDICATE, NULL, true);
 
        // memories that are reclaimed after each execution
+       action_list_buffer = new SnapList<action_list_t *>();
        read_locations = new loc_set_t();
        val_loc_map = new HashTable<uint64_t, loc_set_t *, uint64_t, 0>();
        loc_may_equal_map = new HashTable<void *, loc_set_t *, uintptr_t, 0>();
@@ -30,6 +30,7 @@ void FuncNode::set_new_exec_flag()
                inst->unset_location();
        }
 
+       action_list_buffer = new SnapList<action_list_t *>();
        read_locations = new loc_set_t();
        val_loc_map = new HashTable<uint64_t, loc_set_t *, uint64_t, 0>();
        loc_may_equal_map = new HashTable<void *, loc_set_t *, uintptr_t, 0>();
index b022284a2fb52a6d36ca67c8649f230f3d96d917..c70bc59c05c13e996be0e1da4d501b3c04395fce 100644 (file)
@@ -38,7 +38,7 @@ public:
        void incr_exit_count() { exit_count++; }
        uint32_t get_exit_count() { return exit_count; }
 
-       ModelList<action_list_t *> * get_action_list_buffer() { return &action_list_buffer; }
+       SnapList<action_list_t *> * get_action_list_buffer() { return action_list_buffer; }
 
        void add_to_val_loc_map(uint64_t val, void * loc);
        void add_to_val_loc_map(value_set_t * values, void * loc);
@@ -83,7 +83,7 @@ private:
        bool amend_predicate_expr(Predicate ** curr_pred, FuncInst * next_inst, ModelAction * next_act);
 
        /* Store action_lists when calls to update_tree are deferred */
-       ModelList<action_list_t *> action_list_buffer;
+       SnapList<action_list_t *> * action_list_buffer;
 
        /* read_locations: set of locations read by this FuncNode
         * val_loc_map: keep track of locations that have the same values written to;
index 584b9f0058ac1690a9b7bebdf2a58ade4704ca8a..8a605fbfd8f2f06fc32b7219ef1a6b82683dd5e1 100644 (file)
@@ -69,7 +69,6 @@ void ModelHistory::exit_function(const uint32_t func_id, thread_id_t tid)
                FuncNode * func_node = func_nodes[func_id];
                func_node->set_predicate_tree_position(tid, NULL);
                func_node->reset_inst_act_map(tid);
-               //func_node->clear_read_map(tid);
 
                action_list_t * curr_act_list = func_act_lists->back();
 
@@ -78,7 +77,7 @@ void ModelHistory::exit_function(const uint32_t func_id, thread_id_t tid)
                 */
                func_node->incr_exit_count();
                if (func_node->get_exit_count() >= 2) {
-                       ModelList<action_list_t *> * action_list_buffer = func_node->get_action_list_buffer();
+                       SnapList<action_list_t *> * action_list_buffer = func_node->get_action_list_buffer();
                        while (action_list_buffer->size() > 0) {
                                action_list_t * act_list = action_list_buffer->back();
                                action_list_buffer->pop_back();