Lines Matching refs:UWord
160 static UWord stats__lockN_acquires = 0;
161 static UWord stats__lockN_releases = 0;
267 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_writer()
277 tl_assert(VG_(elemBag)(lk->heldBy, (UWord)thr) in lockN_acquire_writer()
279 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_writer()
317 VG_(addToBag)(lk->heldBy, (UWord)thr); in lockN_acquire_reader()
321 VG_(addToBag)( lk->heldBy, (UWord)thr ); in lockN_acquire_reader()
340 b = VG_(delFromBag)(lk->heldBy, (UWord)thr); in lockN_release()
363 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, NULL )) { in remove_Lock_from_locksets_of_all_owning_Threads()
366 thr->locksetA, (UWord)lk )); in remove_Lock_from_locksets_of_all_owning_Threads()
368 = HG_(delFromWS)( univ_lsets, thr->locksetA, (UWord)lk ); in remove_Lock_from_locksets_of_all_owning_Threads()
372 thr->locksetW, (UWord)lk )); in remove_Lock_from_locksets_of_all_owning_Threads()
374 = HG_(delFromWS)( univ_lsets, thr->locksetW, (UWord)lk ); in remove_Lock_from_locksets_of_all_owning_Threads()
498 UWord count; in pp_Lock()
501 while (VG_(nextIterBag)( lk->heldBy, (UWord*)&thr, &count )) { in pp_Lock()
548 while (VG_(nextIterFM)( map_locks, (UWord*)&gla, in pp_map_locks()
549 (UWord*)&lk )) { in pp_map_locks()
600 tl_assert(sizeof(Addr) == sizeof(UWord)); in initialise_data_structures()
718 NULL, (UWord*)&oldlock, (UWord)ga ); in map_locks_lookup_or_create()
723 VG_(addToFM)( map_locks, (UWord)ga, (UWord)lock ); in map_locks_lookup_or_create()
738 found = VG_(lookupFM)( map_locks, NULL, (UWord*)&lk, (UWord)ga ); in map_locks_maybe_lookup()
748 (UWord*)&ga2, (UWord*)&lk, (UWord)ga ); in map_locks_delete()
762 static UWord stats__sanity_checks = 0;
840 return VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0; in thread_is_a_holder_of_Lock()
853 UWord* ls_words; in threads__sanity_check()
854 UWord ls_size, i; in threads__sanity_check()
897 (UWord*)&gla, (UWord*)&lk )) { in locks__sanity_check()
912 UWord count; in locks__sanity_check()
915 (UWord*)&thr, &count )) { in locks__sanity_check()
919 if (!HG_(elemWS)(univ_lsets, thr->locksetA, (UWord)lk)) in locks__sanity_check()
923 && !HG_(elemWS)(univ_lsets, thr->locksetW, (UWord)lk)) in locks__sanity_check()
926 && HG_(elemWS)(univ_lsets, thr->locksetW, (UWord)lk)) in locks__sanity_check()
1142 thr->locksetA = HG_(addToWS)( univ_lsets, thr->locksetA, (UWord)lk ); in evhH__post_thread_w_acquires_lock()
1143 thr->locksetW = HG_(addToWS)( univ_lsets, thr->locksetW, (UWord)lk ); in evhH__post_thread_w_acquires_lock()
1217 thr->locksetA = HG_(addToWS)( univ_lsets, thr->locksetA, (UWord)lk ); in evhH__post_thread_r_acquires_lock()
1273 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock )); in evhH__pre_thread_releases_lock()
1274 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1284 n = VG_(elemBag)( lock->heldBy, (UWord)thr ); in evhH__pre_thread_releases_lock()
1294 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock )); in evhH__pre_thread_releases_lock()
1295 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1310 tl_assert(n == VG_(elemBag)( lock->heldBy, (UWord)thr )); in evhH__pre_thread_releases_lock()
1315 tl_assert(HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lock )); in evhH__pre_thread_releases_lock()
1317 tl_assert(HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1319 tl_assert(!HG_(elemWS)( univ_lsets, thr->locksetW, (UWord)lock )); in evhH__pre_thread_releases_lock()
1349 = HG_(delFromWS)( univ_lsets, thr->locksetA, (UWord)lock ); in evhH__pre_thread_releases_lock()
1351 = HG_(delFromWS)( univ_lsets, thr->locksetW, (UWord)lock ); in evhH__pre_thread_releases_lock()
1998 && VG_(elemBag)( lk->heldBy, (UWord)thr ) > 0 ) { in evh__HG_PTHREAD_MUTEX_LOCK_PRE()
2157 UWord nWaiters; /* # threads waiting on the CV */
2174 UWord key, val; in map_cond_to_CVInfo_lookup_or_alloc()
2176 if (VG_(lookupFM)( map_cond_to_CVInfo, &key, &val, (UWord)cond )) { in map_cond_to_CVInfo_lookup_or_alloc()
2177 tl_assert(key == (UWord)cond); in map_cond_to_CVInfo_lookup_or_alloc()
2184 VG_(addToFM)( map_cond_to_CVInfo, (UWord)cond, (UWord)cvi ); in map_cond_to_CVInfo_lookup_or_alloc()
2190 UWord key, val; in map_cond_to_CVInfo_lookup_NO_alloc()
2192 if (VG_(lookupFM)( map_cond_to_CVInfo, &key, &val, (UWord)cond )) { in map_cond_to_CVInfo_lookup_NO_alloc()
2193 tl_assert(key == (UWord)cond); in map_cond_to_CVInfo_lookup_NO_alloc()
2203 UWord keyW, valW; in map_cond_to_CVInfo_delete()
2209 if (VG_(lookupFM)( map_cond_to_CVInfo, &keyW, &valW, (UWord)cond )) { in map_cond_to_CVInfo_delete()
2211 tl_assert(keyW == (UWord)cond); in map_cond_to_CVInfo_delete()
2222 if (!VG_(delFromFM)( map_cond_to_CVInfo, &keyW, &valW, (UWord)cond )) in map_cond_to_CVInfo_delete()
2298 if (lk->heldBy != NULL && 0 == VG_(elemBag)(lk->heldBy, (UWord)thr)) { in evh__HG_PTHREAD_COND_SIGNAL_PRE()
2360 && VG_(elemBag)( lk->heldBy, (UWord)thr ) == 0) { in evh__HG_PTHREAD_COND_WAIT_PRE()
2657 UWord keyW; in push_SO_for_sem()
2662 &keyW, (UWord*)&xa, (UWord)sem )) { in push_SO_for_sem()
2663 tl_assert(keyW == (UWord)sem); in push_SO_for_sem()
2669 VG_(addToFM)( map_sem_to_SO_stack, (UWord)sem, (UWord)xa ); in push_SO_for_sem()
2674 UWord keyW; in mb_pop_SO_for_sem()
2679 &keyW, (UWord*)&xa, (UWord)sem )) { in mb_pop_SO_for_sem()
2682 tl_assert(keyW == (UWord)sem); in mb_pop_SO_for_sem()
2699 UWord keyW, valW; in evh__HG_POSIX_SEM_DESTROY_PRE()
2716 if (VG_(delFromFM)( map_sem_to_SO_stack, &keyW, &valW, (UWord)sem )) { in evh__HG_POSIX_SEM_DESTROY_PRE()
2718 tl_assert(keyW == (UWord)sem); in evh__HG_POSIX_SEM_DESTROY_PRE()
2726 void evh__HG_POSIX_SEM_INIT_POST ( ThreadId tid, void* sem, UWord value ) in evh__HG_POSIX_SEM_INIT_POST()
2844 UWord size; /* declared size */
2878 UWord key, val; in map_barrier_to_Bar_lookup_or_alloc()
2880 if (VG_(lookupFM)( map_barrier_to_Bar, &key, &val, (UWord)barrier )) { in map_barrier_to_Bar_lookup_or_alloc()
2881 tl_assert(key == (UWord)barrier); in map_barrier_to_Bar_lookup_or_alloc()
2885 VG_(addToFM)( map_barrier_to_Bar, (UWord)barrier, (UWord)bar ); in map_barrier_to_Bar_lookup_or_alloc()
2891 UWord keyW, valW; in map_barrier_to_Bar_delete()
2893 if (VG_(delFromFM)( map_barrier_to_Bar, &keyW, &valW, (UWord)barrier )) { in map_barrier_to_Bar_delete()
2895 tl_assert(keyW == (UWord)barrier); in map_barrier_to_Bar_delete()
2903 UWord count, in evh__HG_PTHREAD_BARRIER_INIT_PRE()
2904 UWord resizable ) in evh__HG_PTHREAD_BARRIER_INIT_PRE()
3011 UWord i; in do_barrier_cross_sync_and_empty()
3084 UWord present; in evh__HG_PTHREAD_BARRIER_WAIT_PRE()
3123 UWord newcount ) in evh__HG_PTHREAD_BARRIER_RESIZE_PRE()
3127 UWord present; in evh__HG_PTHREAD_BARRIER_RESIZE_PRE()
3209 static SO* map_usertag_to_SO_lookup_or_alloc ( UWord usertag ) { in map_usertag_to_SO_lookup_or_alloc()
3210 UWord key, val; in map_usertag_to_SO_lookup_or_alloc()
3213 tl_assert(key == (UWord)usertag); in map_usertag_to_SO_lookup_or_alloc()
3217 VG_(addToFM)( map_usertag_to_SO, usertag, (UWord)so ); in map_usertag_to_SO_lookup_or_alloc()
3222 static void map_usertag_to_SO_delete ( UWord usertag ) { in map_usertag_to_SO_delete()
3223 UWord keyW, valW; in map_usertag_to_SO_delete()
3235 void evh__HG_USERSO_SEND_PRE ( ThreadId tid, UWord usertag ) in evh__HG_USERSO_SEND_PRE()
3263 void evh__HG_USERSO_RECV_POST ( ThreadId tid, UWord usertag ) in evh__HG_USERSO_RECV_POST()
3291 void evh__HG_USERSO_FORGET_ALL ( ThreadId tid, UWord usertag ) in evh__HG_USERSO_FORGET_ALL()
3358 static Word cmp_LAOGLinkExposition ( UWord llx1W, UWord llx2W ) { in cmp_LAOGLinkExposition()
3390 UWord i, ws_size; in laog__show()
3391 UWord* ws_words; in laog__show()
3398 while (VG_(nextIterFM)( laog, (UWord*)&me, in laog__show()
3399 (UWord*)&links )) { in laog__show()
3421 const UWord univ_laog_cardinality = HG_(cardinalityWSU)( univ_laog); in univ_laog_do_GC()
3435 while (VG_(nextIterFM)( laog, NULL, (UWord*)&links )) { in univ_laog_do_GC()
3497 UWord keyW; in laog__add_edge()
3515 if (VG_(lookupFM)( laog, &keyW, (UWord*)&links, (UWord)src )) { in laog__add_edge()
3518 tl_assert(keyW == (UWord)src); in laog__add_edge()
3519 outs_new = HG_(addToWS)( univ_laog, links->outs, (UWord)dst ); in laog__add_edge()
3525 links->outs = HG_(singletonWS)( univ_laog, (UWord)dst ); in laog__add_edge()
3526 VG_(addToFM)( laog, (UWord)src, (UWord)links ); in laog__add_edge()
3531 if (VG_(lookupFM)( laog, &keyW, (UWord*)&links, (UWord)dst )) { in laog__add_edge()
3534 tl_assert(keyW == (UWord)dst); in laog__add_edge()
3535 inns_new = HG_(addToWS)( univ_laog, links->inns, (UWord)src ); in laog__add_edge()
3540 links->inns = HG_(singletonWS)( univ_laog, (UWord)src ); in laog__add_edge()
3542 VG_(addToFM)( laog, (UWord)dst, (UWord)links ); in laog__add_edge()
3561 if (VG_(lookupFM)( laog_exposition, NULL, NULL, (UWord)&expo )) { in laog__add_edge()
3570 VG_(addToFM)( laog_exposition, (UWord)expo2, (UWord)NULL ); in laog__add_edge()
3580 UWord keyW; in laog__del_edge()
3586 if (VG_(lookupFM)( laog, &keyW, (UWord*)&links, (UWord)src )) { in laog__del_edge()
3588 tl_assert(keyW == (UWord)src); in laog__del_edge()
3589 links->outs = HG_(delFromWS)( univ_laog, links->outs, (UWord)dst ); in laog__del_edge()
3594 if (VG_(lookupFM)( laog, &keyW, (UWord*)&links, (UWord)dst )) { in laog__del_edge()
3596 tl_assert(keyW == (UWord)dst); in laog__del_edge()
3597 links->inns = HG_(delFromWS)( univ_laog, links->inns, (UWord)src ); in laog__del_edge()
3611 (UWord*)&fm_expo, NULL, (UWord)&expo )) { in laog__del_edge()
3624 UWord keyW; in laog__succs()
3628 if (VG_(lookupFM)( laog, &keyW, (UWord*)&links, (UWord)lk )) { in laog__succs()
3630 tl_assert(keyW == (UWord)lk); in laog__succs()
3639 UWord keyW; in laog__preds()
3643 if (VG_(lookupFM)( laog, &keyW, (UWord*)&links, (UWord)lk )) { in laog__preds()
3645 tl_assert(keyW == (UWord)lk); in laog__preds()
3654 UWord i, ws_size; in laog__sanity_check()
3655 UWord* ws_words; in laog__sanity_check()
3662 while (VG_(nextIterFM)( laog, (UWord*)&me, in laog__sanity_check()
3663 (UWord*)&links )) { in laog__sanity_check()
3670 (UWord)me )) in laog__sanity_check()
3677 (UWord)me )) in laog__sanity_check()
3706 UWord succs_size, i; in laog__do_dfs_from_to()
3707 UWord* succs_words; in laog__do_dfs_from_to()
3730 if (HG_(elemWS)( univ_lsets, dsts, (UWord)here )) { ret = here; break; } in laog__do_dfs_from_to()
3732 if (VG_(lookupFM)( visited, NULL, NULL, (UWord)here )) in laog__do_dfs_from_to()
3735 VG_(addToFM)( visited, (UWord)here, 0 ); in laog__do_dfs_from_to()
3759 UWord* ls_words; in laog__pre_thread_acquires_lock()
3760 UWord ls_size, i; in laog__pre_thread_acquires_lock()
3766 if (HG_(elemWS)( univ_lsets, thr->locksetA, (UWord)lk )) in laog__pre_thread_acquires_lock()
3791 (UWord*)&found, NULL, (UWord)&key )) { in laog__pre_thread_acquires_lock()
3876 static UWord* UWordV_dup(UWord* words, Word words_size) in UWordV_dup()
3883 UWord *dup = HG_(zalloc) ("hg.dup.1", (SizeT) words_size * sizeof(UWord)); in UWordV_dup()
3897 UWord preds_size, succs_size, i, j; in laog__handle_one_lock_deletion()
3898 UWord *preds_words, *succs_words; in laog__handle_one_lock_deletion()
3939 (UWord*)&linked_lk, (UWord*)&links, (UWord)lk)) { in laog__handle_one_lock_deletion()
4073 md = (MallocMeta*) VG_(HT_lookup)( hg_mallocmeta_table, (UWord)p ); in handle_free()
4082 VG_(HT_remove)( hg_mallocmeta_table, (UWord)p ); in handle_free()
4114 md = (MallocMeta*) VG_(HT_lookup)( hg_mallocmeta_table, (UWord)payload ); in hg_cli__realloc()
4183 MallocMeta *md = VG_(HT_lookup)( hg_mallocmeta_table, (UWord)p ); in hg_cli_malloc_usable_size()
4223 data_addr - (UWord)(UInt)i * sizeof(UWord) ); in HG_()
4809 Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret) in hg_handle_client_request()
4851 *ret = (UWord)-1; in hg_handle_client_request()
4898 VG_(addToFM)( map_pthread_t_to_Thread, (UWord)args[1], (UWord)my_thr ); in hg_handle_client_request()
4908 my_thr, (HChar*)args[1], (UWord)args[2], (HChar*)args[3] ); in hg_handle_client_request()
4922 NULL, (UWord*)&thr_q, (UWord)args[1] ); in hg_handle_client_request()
5336 void for_libhb__get_stacktrace ( Thr* hbt, Addr* frames, UWord nRequest ) in for_libhb__get_stacktrace()
5340 UWord nActual; in for_libhb__get_stacktrace()
5345 nActual = (UWord)VG_(get_StackTrace)( tid, frames, (UInt)nRequest, in for_libhb__get_stacktrace()
5485 tl_assert( sizeof(UWord) == sizeof(Addr) ); in hg_pre_clo_init()