Lines Matching refs:Seg
31 auto &Seg = Segments[{Sec.getMemProt(), Sec.getMemDeallocPolicy()}]; in BasicLayout() local
34 Seg.ContentBlocks.push_back(B); in BasicLayout()
36 Seg.ZeroFillBlocks.push_back(B); in BasicLayout()
51 auto &Seg = KV.second; in BasicLayout() local
53 llvm::sort(Seg.ContentBlocks, CompareBlocks); in BasicLayout()
54 llvm::sort(Seg.ZeroFillBlocks, CompareBlocks); in BasicLayout()
56 for (auto *B : Seg.ContentBlocks) { in BasicLayout()
57 Seg.ContentSize = alignToBlock(Seg.ContentSize, *B); in BasicLayout()
58 Seg.ContentSize += B->getSize(); in BasicLayout()
59 Seg.Alignment = std::max(Seg.Alignment, Align(B->getAlignment())); in BasicLayout()
62 uint64_t SegEndOffset = Seg.ContentSize; in BasicLayout()
63 for (auto *B : Seg.ZeroFillBlocks) { in BasicLayout()
66 Seg.Alignment = std::max(Seg.Alignment, Align(B->getAlignment())); in BasicLayout()
68 Seg.ZeroFillSize = SegEndOffset - Seg.ContentSize; in BasicLayout()
72 << ": content-size=" << formatv("{0:x}", Seg.ContentSize) in BasicLayout()
73 << ", zero-fill-size=" << formatv("{0:x}", Seg.ZeroFillSize) in BasicLayout()
74 << ", align=" << formatv("{0:x}", Seg.Alignment.value()) << "\n"; in BasicLayout()
85 auto &Seg = KV.second; in getContiguousPageBasedLayoutSizes() local
87 if (Seg.Alignment > PageSize) in getContiguousPageBasedLayoutSizes()
91 uint64_t SegSize = alignTo(Seg.ContentSize + Seg.ZeroFillSize, PageSize); in getContiguousPageBasedLayoutSizes()
103 auto &Seg = KV.second; in apply() local
105 assert(!(Seg.ContentBlocks.empty() && Seg.ZeroFillBlocks.empty()) && in apply()
108 for (auto *B : Seg.ContentBlocks) { in apply()
110 Seg.Addr = alignToBlock(Seg.Addr, *B); in apply()
111 Seg.NextWorkingMemOffset = alignToBlock(Seg.NextWorkingMemOffset, *B); in apply()
114 B->setAddress(Seg.Addr); in apply()
115 Seg.Addr += B->getSize(); in apply()
119 memcpy(Seg.WorkingMem + Seg.NextWorkingMemOffset, B->getContent().data(), in apply()
122 {Seg.WorkingMem + Seg.NextWorkingMemOffset, B->getSize()}); in apply()
123 Seg.NextWorkingMemOffset += B->getSize(); in apply()
126 for (auto *B : Seg.ZeroFillBlocks) { in apply()
128 Seg.Addr = alignToBlock(Seg.Addr, *B); in apply()
130 B->setAddress(Seg.Addr); in apply()
131 Seg.Addr += B->getSize(); in apply()
134 Seg.ContentBlocks.clear(); in apply()
135 Seg.ZeroFillBlocks.clear(); in apply()
164 auto &Seg = KV.second; in Create() local
173 if (Seg.ContentSize != 0) { in Create()
175 orc::ExecutorAddr(alignTo(NextAddr.getValue(), Seg.ContentAlign)); in Create()
177 G->createMutableContentBlock(Sec, G->allocateBuffer(Seg.ContentSize), in Create()
178 NextAddr, Seg.ContentAlign.value(), 0); in Create()
180 NextAddr += Seg.ContentSize; in Create()
280 auto &Seg = KV.second; in applyProtections() local
285 alignTo(Seg.ContentSize + Seg.ZeroFillSize, MemMgr.PageSize); in applyProtections()
286 sys::MemoryBlock MB(Seg.WorkingMem, SegSize); in applyProtections()
395 auto &Seg = KV.second; in allocate() local
401 Seg.WorkingMem = SegAddr.toPtr<char *>(); in allocate()
402 Seg.Addr = SegAddr; in allocate()
404 SegAddr += alignTo(Seg.ContentSize + Seg.ZeroFillSize, PageSize); in allocate()