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);
24 bool shouldWait(const ModelAction * wait);
26 void register_engine(ModelHistory * history, ModelExecution * execution);
30 ModelHistory * history;
31 ModelExecution * execution;
33 SnapVector<ModelAction *> thrd_last_read_act;
34 SnapVector<Predicate *> thrd_curr_pred;
35 SnapVector<Predicate *> thrd_selected_child_branch;
36 SnapVector< SnapVector<ModelAction *> *> thrd_pruned_writes;
38 bool prune_writes(thread_id_t tid, Predicate * pred, SnapVector<ModelAction *> * rf_set, inst_act_map_t * inst_act_map);
39 Predicate * selectBranch(thread_id_t tid, Predicate * curr_pred, FuncInst * read_inst);
41 /* Threads put to sleep by NewFuzzer because no writes in rf_set satisfies the selected predicate.
42 * Only used by selectWrite;
44 SnapVector<Thread *> paused_thread_set;
47 #endif /* end of __NEWFUZZER_H__ */