Lines Matching full:cacheline
2880 // -------- CacheLine --------------- {{{1
2881 // The CacheLine is a set of Mask::kNBits (32 or 64) Shadow Values.
2921 class CacheLine {
2926 static CacheLine *CreateNewCacheLine(uintptr_t tag) {
2930 return new (mem) CacheLine(tag);
2933 static void Delete(CacheLine *line) {
2946 Printf("CacheLine %p, off=%ld off8=%ld gr=%d "
3161 Printf("sizeof(CacheLine) = %ld\n", sizeof(CacheLine));
3163 free_list_ = new FreeList(sizeof(CacheLine), 1024);
3167 explicit CacheLine(uintptr_t tag) {
3171 ~CacheLine() { }
3187 FreeList *CacheLine::free_list_;
3197 uintptr_t a_tag = CacheLine::ComputeTag(a);
3198 uintptr_t next_tag = CacheLine::ComputeNextTag(a);
3203 *line2_tag = CacheLine::ComputeTag(b);
3228 INLINE CacheLine *GetLine(uintptr_t a, bool create_new_if_need) {
3230 uintptr_t cli = (a - kMin) >> CacheLine::kLineSizeBits;
3232 CacheLine **cache_line_p = &cache_[cli];
3236 uintptr_t tag = CacheLine::ComputeTag(a);
3237 *cache_line_p = CacheLine::CreateNewCacheLine(tag);
3244 enum { kCacheSize = kRangeSize / CacheLine::kLineSize };
3245 CacheLine *cache_[kCacheSize];
3257 INLINE CacheLine *GetLine(uintptr_t a, bool create_new_if_need) {
3274 INLINE static CacheLine *kLineIsLocked() {
3275 return (CacheLine*)1;
3278 INLINE static bool LineIsNullOrLocked(CacheLine *line) {
3282 INLINE CacheLine *TidMagic(int32_t tid) {
3290 // Try to get a CacheLine for exclusive use.
3292 INLINE CacheLine *TryAcquireLine(Thread *thr, uintptr_t a, int call_site) {
3297 CacheLine **addr = &lines_[cli];
3298 CacheLine *res = (CacheLine*)AtomicExchange(
3301 uintptr_t tag = CacheLine::ComputeTag(a);
3314 INLINE CacheLine *AcquireLine(Thread *thr, uintptr_t a, int call_site) {
3316 CacheLine *line = NULL;
3339 // Release a CacheLine from exclusive use.
3340 INLINE void ReleaseLine(Thread *thr, uintptr_t a, CacheLine *line, int call_site) {
3347 CacheLine **addr = &lines_[cli];
3352 uintptr_t tag = CacheLine::ComputeTag(a);
3364 uintptr_t tag = i << CacheLine::kLineSizeBits;
3370 // Get a CacheLine. This operation should be performed under a lock
3375 INLINE CacheLine *GetLine(Thread *thr, uintptr_t a, bool create_new_if_need, int call_site) {
3376 uintptr_t tag = CacheLine::ComputeTag(a);
3378 DCHECK(tag + CacheLine::kLineSize > a);
3380 CacheLine
3381 CacheLine *line = NULL;
3419 INLINE CacheLine *GetLineOrCreateNew(Thread *thr, uintptr_t a, int call_site) {
3422 INLINE CacheLine *GetLineIfExists(Thread *thr, uintptr_t a, int call_site) {
3433 CacheLine *line = i->second;
3437 CacheLine::Delete(line);
3443 CacheLine *line = GetLineOrCreateNew(thr, it->first, __LINE__);
3455 CacheLine *line = it->second;
3462 for (uintptr_t i = 0; i < CacheLine::kLineSize; i++) {
3474 for (size_t size = 0; size <= CacheLine::kLineSize; size++) {
3508 return (addr >> CacheLine::kLineSizeBits) & (kNumLines - 1);
3511 NOINLINE CacheLine *WriteBackAndFetch(Thread *thr, CacheLine *old_line,
3515 CacheLine *res;
3517 CacheLine **line_for_this_tag = NULL;
3536 res = CacheLine::CreateNewCacheLine(tag);
3567 CacheLine::Delete(old_line);
3587 void DebugOnlyCheckCacheLineWhichWeReplace(CacheLine *old_line,
3588 CacheLine *new_line) {
3593 for (uintptr_t i = 0; i < CacheLine::kLineSize; i++) {
3606 + CacheLine::kLineSize);
3612 CacheLine *lines_[kNumLines];
3614 // tag => CacheLine
3615 typedef unordered_map<uintptr_t, CacheLine*> Map;
3641 uintptr_t tag = CacheLine::ComputeTag(a);
3642 uintptr_t off = CacheLine::ComputeOffset(a);
3682 static void ClearPublishedAttribute(CacheLine *line, Mask mask) {
3714 // Publish range [a, b) in addr's CacheLine with vts.
3718 DCHECK(b <= CacheLine::kLineSize);
3720 uintptr_t tag = CacheLine::ComputeTag(addr);
3722 CacheLine *line = G_cache->GetLineOrCreateNew(thr, tag, __LINE__);
3752 a, b, (int)(b - a), CacheLine::ComputeTag(a));
3759 uintptr_t a_tag = CacheLine::ComputeTag(a);
3760 PublishRangeInOneLine(thr, a, a - a_tag, CacheLine::kLineSize, vts);
3762 tag_i += CacheLine::kLineSize) {
3763 PublishRangeInOneLine(thr, tag_i, 0, CacheLine::kLineSize, vts);
3772 Mask mask, CacheLine *line) {
3784 CacheLine *line = G_cache->GetLineIfExists(thr, addr, __LINE__);
3785 // CacheLine *line = G_cache->GetLineOrCreateNew(addr, __LINE__);
3787 DCHECK(beg < CacheLine::kLineSize);
3788 DCHECK(end <= CacheLine::kLineSize);
3814 uintptr_t a_tag = CacheLine::ComputeTag(a);
3815 ClearMemoryStateInOneLine(thr, a, a - a_tag, CacheLine::kLineSize);
3818 tag_i += CacheLine::kLineSize) {
3819 ClearMemoryStateInOneLine(thr, tag_i, 0, CacheLine::kLineSize);
3829 uintptr_t off = CacheLine::ComputeOffset(x);
3830 CacheLine *line = G_cache->GetLineOrCreateNew(thr, x, __LINE__);
6582 CacheLine *line = G_cache->GetLineOrCreateNew(thr, p, __LINE__);
6584 line->racey().Set(CacheLine::ComputeOffset(p));
6720 CacheLine *line = G_cache->GetLineOrCreateNew(thr, a, __LINE__);
6721 uintptr_t offset = CacheLine::ComputeOffset(a);
6984 CacheLine *cache_line,
6991 uintptr_t offset = CacheLine::ComputeOffset(addr);
7067 CacheLine *cache_line,
7075 uintptr_t off = CacheLine::ComputeOffset(a);
7153 uintptr_t max_x = min(b, CacheLine::ComputeNextTag(a));
7155 off = CacheLine::ComputeOffset(x);
7156 DCHECK(CacheLine::ComputeTag(x) == cache_line->tag());
7183 off = CacheLine::ComputeOffset(x);
7201 INLINE bool IsTraced(CacheLine *cache_line, uintptr_t addr,
7206 uintptr_t off = CacheLine::ComputeOffset(addr);
7220 uintptr_t off = CacheLine::ComputeOffset(x);
7221 CacheLine *cache_line = G_cache->GetLineOrCreateNew(thr,
7259 CacheLine *cache_line = G_cache->GetLineOrCreateNew(thr, addr, __LINE__);
7300 CacheLine *cache_line = NULL;
7321 if (cache_line->tag() == CacheLine::ComputeTag(addr)) {
8376 CacheLine::InitClassMembers();