1 #ifndef __NEWFUZZER_H__
2 #define __NEWFUZZER_H__
9 typedef HashTable<FuncInst *, ModelAction *, uintptr_t, 0> inst_act_map_t;
11 class NewFuzzer : public Fuzzer {
14 int selectWrite(ModelAction *read, SnapVector<ModelAction *>* rf_set);
15 Predicate * get_selected_child_branch(thread_id_t tid);
16 void conditional_sleep(Thread * thread);
17 bool has_paused_threads();
18 void wake_up_paused_threads(int * threadlist, int * numthreads);
20 Thread * selectThread(int * threadlist, int numthreads);
21 Thread * selectNotify(action_list_t * waiters);
22 bool shouldSleep(const ModelAction *sleep);
23 bool shouldWake(const ModelAction *sleep);
25 void register_engine(ModelHistory * history, ModelExecution * execution);
29 ModelHistory * history;
30 ModelExecution * execution;
32 SnapVector<ModelAction *> thrd_last_read_act;
33 SnapVector<Predicate *> thrd_curr_pred;
34 SnapVector<Predicate *> thrd_selected_child_branch;
35 SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
37 bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set, inst_act_map_t * inst_act_map);
38 Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
40 /* Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate.
41 * Only used by selectWrite;
43 SnapVector<Thread *> paused_thread_set;
46 #endif /* end of __NEWFUZZER_H__ */