Lines Matching refs:MemMgr
34 OwningPtr<JITMemoryManager> MemMgr(
42 uint8_t *FunctionBody1 = MemMgr->startFunctionBody(F1.get(), size);
44 MemMgr->endFunctionBody(F1.get(), FunctionBody1, FunctionBody1 + 1024);
45 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
49 uint8_t *FunctionBody2 = MemMgr->startFunctionBody(F2.get(), size);
51 MemMgr->endFunctionBody(F2.get(), FunctionBody2, FunctionBody2 + 1024);
52 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
56 uint8_t *FunctionBody3 = MemMgr->startFunctionBody(F3.get(), size);
58 MemMgr->endFunctionBody(F3.get(), FunctionBody3, FunctionBody3 + 1024);
59 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
62 MemMgr->deallocateFunctionBody(FunctionBody2);
63 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
64 MemMgr->deallocateFunctionBody(FunctionBody1);
65 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
66 MemMgr->deallocateFunctionBody(FunctionBody3);
67 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
73 OwningPtr<JITMemoryManager> MemMgr(
80 const uintptr_t bigFuncSize = (MemMgr->GetDefaultCodeSlabSize() -
86 uint8_t *FunctionBody1 = MemMgr->startFunctionBody(F1.get(), size);
89 MemMgr->endFunctionBody(F1.get(), FunctionBody1, FunctionBody1 + bigFuncSize);
90 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
94 uint8_t *FunctionBody2 = MemMgr->startFunctionBody(F2.get(), size);
97 MemMgr->endFunctionBody(F2.get(), FunctionBody2, FunctionBody2 + bigFuncSize);
98 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
102 uint8_t *FunctionBody3 = MemMgr->startFunctionBody(F3.get(), size);
105 MemMgr->endFunctionBody(F3.get(), FunctionBody3, FunctionBody3 + bigFuncSize);
106 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
109 EXPECT_EQ(3U, MemMgr->GetNumCodeSlabs());
114 uint8_t *FunctionBody4 = MemMgr->startFunctionBody(F4.get(), size);
117 MemMgr->endFunctionBody(F4.get(), FunctionBody4,
119 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
123 uint8_t *FunctionBody5 = MemMgr->startFunctionBody(F5.get(), size);
126 MemMgr->endFunctionBody(F5.get(), FunctionBody5,
128 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
132 uint8_t *FunctionBody6 = MemMgr->startFunctionBody(F6.get(), size);
135 MemMgr->endFunctionBody(F6.get(), FunctionBody6,
137 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
140 EXPECT_EQ(3U, MemMgr->GetNumCodeSlabs());
143 MemMgr->deallocateFunctionBody(FunctionBody2);
144 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
145 MemMgr->deallocateFunctionBody(FunctionBody1);
146 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
147 MemMgr->deallocateFunctionBody(FunctionBody4);
148 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
149 MemMgr->deallocateFunctionBody(FunctionBody3);
150 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
151 MemMgr->deallocateFunctionBody(FunctionBody5);
152 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
153 MemMgr->deallocateFunctionBody(FunctionBody6);
154 EXPECT_TRUE(MemMgr->CheckInvariants(Error)) << Error;
160 OwningPtr<JITMemoryManager> MemMgr(
162 uint8_t *a = (uint8_t *)MemMgr->allocateGlobal(8, 0);
163 uint16_t *b = (uint16_t*)MemMgr->allocateGlobal(16, 2);
164 uint32_t *c = (uint32_t*)MemMgr->allocateGlobal(32, 4);
165 uint64_t *d = (uint64_t*)MemMgr->allocateGlobal(64, 8);
201 EXPECT_EQ(1U, MemMgr->GetNumDataSlabs());
207 OwningPtr<JITMemoryManager> MemMgr(
209 size_t Size = 4 * MemMgr->GetDefaultDataSlabSize();
210 uint64_t *a = (uint64_t*)MemMgr->allocateGlobal(64, 8);
211 uint8_t *g = MemMgr->allocateGlobal(Size, 8);
212 uint64_t *b = (uint64_t*)MemMgr->allocateGlobal(64, 8);
231 EXPECT_EQ(2U, MemMgr->GetNumDataSlabs());
237 OwningPtr<JITMemoryManager> MemMgr(
239 size_t SlabSize = MemMgr->GetDefaultDataSlabSize();
244 EXPECT_EQ(0U, MemMgr->GetNumDataSlabs());
248 MemMgr->allocateGlobal(Size, 8);
249 EXPECT_EQ(2U, MemMgr->GetNumDataSlabs());
253 MemMgr->allocateGlobal(Size, 8);
254 EXPECT_EQ(3U, MemMgr->GetNumDataSlabs());
260 OwningPtr<JITMemoryManager> MemMgr(
262 size_t SlabSize = MemMgr->GetDefaultStubSlabSize();
267 EXPECT_EQ(0U, MemMgr->GetNumDataSlabs());
271 MemMgr->allocateStub(NULL, Size, 8);
272 EXPECT_EQ(2U, MemMgr->GetNumStubSlabs());
276 MemMgr->allocateStub(NULL, Size, 8);
277 EXPECT_EQ(3U, MemMgr->GetNumStubSlabs());
282 OwningPtr<JITMemoryManager> MemMgr(
284 uint8_t *code1 = MemMgr->allocateCodeSection(256, 0, 1);
285 uint8_t *data1 = MemMgr->allocateDataSection(256, 16, 2, true);
286 uint8_t *code2 = MemMgr->allocateCodeSection(257, 32, 3);
287 uint8_t *data2 = MemMgr->allocateDataSection(256, 64, 4, false);
288 uint8_t *code3 = MemMgr->allocateCodeSection(258, 64, 5);