Home | History | Annotate | Download | only in tsan

Lines Matching refs:CacheLine

2948 // -------- CacheLine --------------- {{{1
2949 // The CacheLine is a set of Mask::kNBits (32 or 64) Shadow Values.
2989 class CacheLine {
2994 static CacheLine *CreateNewCacheLine(uintptr_t tag) {
2998 return new (mem) CacheLine(tag);
3001 static void Delete(CacheLine *line) {
3018 Printf("CacheLine %p, off=%ld off8=%ld gr=%d "
3234 Printf("sizeof(CacheLine) = %ld\n", sizeof(CacheLine));
3236 free_list_ = new FreeList(sizeof(CacheLine), 1024);
3240 explicit CacheLine(uintptr_t tag) {
3244 ~CacheLine() { }
3260 FreeList *CacheLine::free_list_;
3270 uintptr_t a_tag = CacheLine::ComputeTag(a);
3271 uintptr_t next_tag = CacheLine::ComputeNextTag(a);
3276 *line2_tag = CacheLine::ComputeTag(b);
3290 INLINE static CacheLine *kLineIsLocked() {
3291 return (CacheLine*)1;
3294 INLINE static bool LineIsNullOrLocked(CacheLine *line) {
3298 INLINE CacheLine *TidMagic(int32_t tid) {
3302 // Try to get a CacheLine for exclusive use.
3304 INLINE CacheLine *TryAcquireLine(TSanThread *thr, uintptr_t a, int call_site) {
3306 CacheLine **addr = &lines_[cli];
3307 CacheLine *res = (CacheLine*)AtomicExchange(
3310 uintptr_t tag = CacheLine::ComputeTag(a);
3323 INLINE CacheLine *AcquireLine(TSanThread *thr, uintptr_t a, int call_site) {
3324 CacheLine *line = NULL;
3353 // Release a CacheLine from exclusive use.
3354 INLINE void ReleaseLine(TSanThread *thr, uintptr_t a, CacheLine *line, int call_site) {
3360 CacheLine **addr = &lines_[cli];
3365 uintptr_t tag = CacheLine::ComputeTag(a);
3377 uintptr_t tag = i << CacheLine::kLineSizeBits;
3383 // Get a CacheLine. This operation should be performed under a lock
3388 INLINE CacheLine *GetLine(TSanThread *thr, uintptr_t a, bool create_new_if_need, int call_site) {
3389 uintptr_t tag = CacheLine::ComputeTag(a);
3391 DCHECK(tag + CacheLine::kLineSize > a);
3393 CacheLine *res = NULL;
3394 CacheLine
3428 INLINE CacheLine *GetLineOrCreateNew(TSanThread *thr, uintptr_t a, int call_site) {
3431 INLINE CacheLine *GetLineIfExists(TSanThread *thr, uintptr_t a, int call_site) {
3442 CacheLine *line = i->second;
3446 CacheLine::Delete(line);
3452 CacheLine *line = GetLineOrCreateNew(thr, it->first, __LINE__);
3464 CacheLine *line = it->second;
3471 for (uintptr_t i = 0; i < CacheLine::kLineSize; i++) {
3483 for (size_t size = 0; size <= CacheLine::kLineSize; size++) {
3517 return (addr >> CacheLine::kLineSizeBits) & (kNumLines - 1);
3520 NOINLINE CacheLine *WriteBackAndFetch(TSanThread *thr, CacheLine *old_line,
3524 CacheLine *res;
3527 CacheLine **line_for_this_tag = NULL;
3546 res = CacheLine::CreateNewCacheLine(tag);
3577 CacheLine::Delete(old_line);
3594 void DebugOnlyCheckCacheLineWhichWeReplace(CacheLine *old_line,
3595 CacheLine *new_line) {
3600 for (uintptr_t i = 0; i < CacheLine::kLineSize; i++) {
3612 + CacheLine::kLineSize);
3618 CacheLine *lines_[kNumLines];
3620 // tag => CacheLine
3621 typedef unordered_map<uintptr_t, CacheLine*> Map;
3645 uintptr_t tag = CacheLine::ComputeTag(a);
3646 uintptr_t off = CacheLine::ComputeOffset(a);
3686 static void ClearPublishedAttribute(CacheLine *line, Mask mask) {
3718 // Publish range [a, b) in addr's CacheLine with vts.
3722 DCHECK(b <= CacheLine::kLineSize);
3724 uintptr_t tag = CacheLine::ComputeTag(addr);
3726 CacheLine *line = G_cache->GetLineOrCreateNew(thr, tag, __LINE__);
3756 a, b, (int)(b - a), CacheLine::ComputeTag(a));
3763 uintptr_t a_tag = CacheLine::ComputeTag(a);
3764 PublishRangeInOneLine(thr, a, a - a_tag, CacheLine::kLineSize, vts);
3766 tag_i += CacheLine::kLineSize) {
3767 PublishRangeInOneLine(thr, tag_i, 0, CacheLine::kLineSize, vts);
5349 Mask mask, CacheLine *line) {
5361 CacheLine *line = G_cache->GetLineIfExists(thr, addr, __LINE__);
5362 // CacheLine *line = G_cache->GetLineOrCreateNew(addr, __LINE__);
5364 DCHECK(beg < CacheLine::kLineSize);
5365 DCHECK(end <= CacheLine::kLineSize);
5391 uintptr_t a_tag = CacheLine::ComputeTag(a);
5392 ClearMemoryStateInOneLine(thr, a, a - a_tag, CacheLine::kLineSize);
5395 tag_i += CacheLine::kLineSize) {
5396 ClearMemoryStateInOneLine(thr, tag_i, 0, CacheLine::kLineSize);
5406 uintptr_t off = CacheLine::ComputeOffset(x);
5408 CacheLine *line = G_cache->GetLineOrCreateNew(thr, x, __LINE__);
6719 CacheLine *line = G_cache->GetLineOrCreateNew(thr, p, __LINE__);
6721 line->racey().Set(CacheLine::ComputeOffset(p));
6749 CacheLine *cache_line = G_cache->GetLineIfExists(thread, ptr, __LINE__);
6751 uintptr_t offset = CacheLine::ComputeOffset(ptr);
6863 CacheLine *line = G_cache->GetLineOrCreateNew(thr, a, __LINE__);
6864 uintptr_t offset = CacheLine::ComputeOffset(a);
7127 CacheLine *cache_line,
7134 uintptr_t offset = CacheLine::ComputeOffset(addr);
7214 CacheLine *cache_line,
7222 uintptr_t off = CacheLine::ComputeOffset(a);
7307 uintptr_t max_x = min(b, CacheLine::ComputeNextTag(a));
7309 off = CacheLine::ComputeOffset(x);
7310 DCHECK(CacheLine::ComputeTag(x) == cache_line->tag());
7337 off = CacheLine::ComputeOffset(x);
7355 INLINE bool IsTraced(CacheLine *cache_line, uintptr_t addr,
7360 uintptr_t off = CacheLine::ComputeOffset(addr);
7374 uintptr_t off = CacheLine::ComputeOffset(x);
7375 CacheLine *cache_line = G_cache->GetLineOrCreateNew(thr,
7413 CacheLine *cache_line = G_cache->GetLineOrCreateNew(thr, addr, __LINE__);
7455 CacheLine *cache_line = NULL;
7473 if (cache_line->tag() == CacheLine::ComputeTag(addr)) {
8566 CacheLine::InitClassMembers();