Lines Matching defs:Seg
32 auto &Seg = Segments[{Sec.getMemProt(), Sec.getMemLifetime()}];
35 Seg.ContentBlocks.push_back(B);
37 Seg.ZeroFillBlocks.push_back(B);
52 auto &Seg = KV.second;
54 llvm::sort(Seg.ContentBlocks, CompareBlocks);
55 llvm::sort(Seg.ZeroFillBlocks, CompareBlocks);
57 for (auto *B : Seg.ContentBlocks) {
58 Seg.ContentSize = alignToBlock(Seg.ContentSize, *B);
59 Seg.ContentSize += B->getSize();
60 Seg.Alignment = std::max(Seg.Alignment, Align(B->getAlignment()));
63 uint64_t SegEndOffset = Seg.ContentSize;
64 for (auto *B : Seg.ZeroFillBlocks) {
67 Seg.Alignment = std::max(Seg.Alignment, Align(B->getAlignment()));
69 Seg.ZeroFillSize = SegEndOffset - Seg.ContentSize;
72 dbgs() << " Seg " << KV.first
73 << ": content-size=" << formatv("{0:x}", Seg.ContentSize)
74 << ", zero-fill-size=" << formatv("{0:x}", Seg.ZeroFillSize)
75 << ", align=" << formatv("{0:x}", Seg.Alignment.value()) << "\n";
86 auto &Seg = KV.second;
88 if (Seg.Alignment > PageSize)
92 uint64_t SegSize = alignTo(Seg.ContentSize + Seg.ZeroFillSize, PageSize);
104 auto &Seg = KV.second;
106 assert(!(Seg.ContentBlocks.empty() && Seg.ZeroFillBlocks.empty()) &&
109 for (auto *B : Seg.ContentBlocks) {
111 Seg.Addr = alignToBlock(Seg.Addr, *B);
112 Seg.NextWorkingMemOffset = alignToBlock(Seg.NextWorkingMemOffset, *B);
115 B->setAddress(Seg.Addr);
116 Seg.Addr += B->getSize();
120 memcpy(Seg.WorkingMem + Seg.NextWorkingMemOffset, B->getContent().data(),
123 {Seg.WorkingMem + Seg.NextWorkingMemOffset, B->getSize()});
124 Seg.NextWorkingMemOffset += B->getSize();
127 for (auto *B : Seg.ZeroFillBlocks) {
129 Seg.Addr = alignToBlock(Seg.Addr, *B);
131 B->setAddress(Seg.Addr);
132 Seg.Addr += B->getSize();
135 Seg.ContentBlocks.clear();
136 Seg.ZeroFillBlocks.clear();
168 auto &Seg = KV.second;
180 if (Seg.ContentSize != 0) {
182 orc::ExecutorAddr(alignTo(NextAddr.getValue(), Seg.ContentAlign));
184 G->createMutableContentBlock(Sec, G->allocateBuffer(Seg.ContentSize),
185 NextAddr, Seg.ContentAlign.value(), 0);
187 NextAddr += Seg.ContentSize;
308 auto &Seg = KV.second;
313 alignTo(Seg.ContentSize + Seg.ZeroFillSize, MemMgr.PageSize);
314 sys::MemoryBlock MB(Seg.WorkingMem, SegSize);
422 auto &Seg = KV.second;
428 Seg.WorkingMem = SegAddr.toPtr<char *>();
429 Seg.Addr = SegAddr;
431 SegAddr += alignTo(Seg.ContentSize + Seg.ZeroFillSize, PageSize);