Lines Matching defs:Mapping
44 struct Mapping {
76 struct Mapping {
97 // mapping to use. Although slower, it make a same instrumented binary run on
174 // Indicates that mapping defines a mid range memory segment.
180 // mapping to use. Although slower, it make a same instrumented binary run on
266 struct Mapping {
291 struct Mapping {
334 template<typename Mapping, int Type>
338 case MAPPING_LO_APP_BEG: return Mapping::kLoAppMemBeg;
339 case MAPPING_LO_APP_END: return Mapping::kLoAppMemEnd;
341 case MAPPING_MID_APP_BEG: return Mapping::kMidAppMemBeg;
342 case MAPPING_MID_APP_END: return Mapping::kMidAppMemEnd;
344 case MAPPING_HI_APP_BEG: return Mapping::kHiAppMemBeg;
345 case MAPPING_HI_APP_END: return Mapping::kHiAppMemEnd;
346 case MAPPING_HEAP_BEG: return Mapping::kHeapMemBeg;
347 case MAPPING_HEAP_END: return Mapping::kHeapMemEnd;
348 case MAPPING_VDSO_BEG: return Mapping::kVdsoBeg;
350 case MAPPING_APP_BEG: return Mapping::kAppMemBeg;
351 case MAPPING_APP_END: return Mapping::kAppMemEnd;
353 case MAPPING_SHADOW_BEG: return Mapping::kShadowBeg;
354 case MAPPING_SHADOW_END: return Mapping::kShadowEnd;
355 case MAPPING_META_SHADOW_BEG: return Mapping::kMetaShadowBeg;
356 case MAPPING_META_SHADOW_END: return Mapping::kMetaShadowEnd;
357 case MAPPING_TRACE_BEG: return Mapping::kTraceMemBeg;
358 case MAPPING_TRACE_END: return Mapping::kTraceMemEnd;
377 return MappingImpl<Mapping, Type>();
499 template<typename Mapping>
502 return (mem >= Mapping::kHeapMemBeg && mem < Mapping::kHeapMemEnd) ||
504 (mem >= Mapping::kMidAppMemBeg && mem < Mapping::kMidAppMemEnd) ||
506 (mem >= Mapping::kLoAppMemBeg && mem < Mapping::kLoAppMemEnd) ||
507 (mem >= Mapping::kHiAppMemBeg && mem < Mapping::kHiAppMemEnd);
509 return mem >= Mapping::kAppMemBeg && mem < Mapping::kAppMemEnd;
528 return IsAppMemImpl<Mapping>(mem);
533 template<typename Mapping>
535 return mem >= Mapping::kShadowBeg && mem <= Mapping::kShadowEnd;
553 return IsShadowMemImpl<Mapping>(mem);
558 template<typename Mapping>
560 return mem >= Mapping::kMetaShadowBeg && mem <= Mapping::kMetaShadowEnd;
578 return IsMetaMemImpl<Mapping>(mem);
583 template<typename Mapping>
587 return (((x) & ~(Mapping::kAppMemMsk | (kShadowCell - 1)))
588 ^ Mapping::kAppMemXor) * kShadowCnt;
590 return ((x & ~(kShadowCell - 1)) * kShadowCnt) | Mapping::kShadowBeg;
609 return MemToShadowImpl<Mapping>(x);
614 template<typename Mapping>
618 return (u32*)(((((x) & ~(Mapping::kAppMemMsk | (kMetaShadowCell - 1)))
619 ^ Mapping::kAppMemXor) / kMetaShadowCell * kMetaShadowSize)
620 | Mapping::kMetaShadowBeg);
623 kMetaShadowCell * kMetaShadowSize) | Mapping::kMetaShadowBeg);
642 return MemToMetaImpl<Mapping>(x);
647 template<typename Mapping>
651 if (s >= MemToShadow(Mapping::kLoAppMemBeg)
652 && s <= MemToShadow(Mapping::kLoAppMemEnd - 1))
653 return (s / kShadowCnt) ^ Mapping::kAppMemXor;
655 if (s >= MemToShadow(Mapping::kMidAppMemBeg)
656 && s <= MemToShadow(Mapping::kMidAppMemEnd - 1))
657 return ((s / kShadowCnt) ^ Mapping::kAppMemXor) + Mapping::kMidShadowOff;
660 return ((s / kShadowCnt) ^ Mapping::kAppMemXor) | Mapping::kAppMemMsk;
663 return (s & ~Mapping::kShadowBeg) / kShadowCnt;
665 // FIXME(dvyukov): this is most likely wrong as the mapping is not bijection.
666 return (s - Mapping::kShadowBeg) / kShadowCnt;
686 return ShadowToMemImpl<Mapping>(s);
697 template<typename Mapping>
699 uptr p = Mapping::kTraceMemBeg + (uptr)tid * kTotalTraceSize;
700 DCHECK_LT(p, Mapping::kTraceMemEnd);
719 return GetThreadTraceImpl<Mapping>(tid);
724 template<typename Mapping>
726 uptr p = Mapping::kTraceMemBeg + (uptr)tid * kTotalTraceSize
728 DCHECK_LT(p, Mapping::kTraceMemEnd);
747 return GetThreadTraceHeaderImpl<Mapping>(tid);