/arkcompiler/runtime_core/static_core/runtime/include/mem/ |
H A D | allocator-inl.h | 23 inline void *ObjectAllocatorBase::AllocateSafe(size_t size, Alignment align, AllocT *objectAllocator, size_t poolSize, in AllocateSafe() argument 26 void *mem = objectAllocator->template Alloc<NEED_LOCK>(size, align); in AllocateSafe() 28 return AddPoolsAndAlloc<AllocT, NEED_LOCK>(size, align, objectAllocator, poolSize, spaceType, heapSpace); in AllocateSafe() 34 inline void *ObjectAllocatorBase::AddPoolsAndAlloc(size_t size, Alignment align, AllocT *objectAllocator, in AddPoolsAndAlloc() argument 49 mem = objectAllocator->template Alloc<NEED_LOCK>(size, align); in AddPoolsAndAlloc() 62 Alignment align = DEFAULT_ALIGNMENT; in AllocateTenuredImpl() local 63 size_t alignedSize = AlignUp(size, GetAlignmentInBytes(align)); in AllocateTenuredImpl() 66 mem = AllocateSafe<ObjectAllocator, NEED_LOCK>(size, align, objectAllocator_, poolSize, in AllocateTenuredImpl() 70 mem = AllocateSafe<LargeObjectAllocator, NEED_LOCK>(size, align, largeObjectAllocator_, poolSize, in AllocateTenuredImpl() 74 mem = AllocateSafe<HumongousObjectAllocator, NEED_LOCK>(size, align, humongousObjectAllocator in AllocateTenuredImpl() [all...] |
H A D | allocator.h | 105 [[nodiscard]] void *Alloc(size_t size, Alignment align) in Alloc() argument 107 return Allocate(size, align, nullptr); in Alloc() 115 [[nodiscard]] void *AllocLocal(size_t size, Alignment align) in AllocLocal() argument 117 return AllocateLocal(size, align, nullptr); in AllocLocal() 120 [[nodiscard]] virtual void *Allocate(size_t size, Alignment align, [[maybe_unused]] ark::ManagedThread *thread) = 0; 122 [[nodiscard]] virtual void *AllocateLocal(size_t size, Alignment align, 271 virtual void *AllocateInLargeAllocator([[maybe_unused]] size_t size, [[maybe_unused]] Alignment align, in AllocateInLargeAllocator() argument 286 virtual Alignment CalculateAllocatorAlignment(size_t align) = 0; 298 inline void *AddPoolsAndAlloc(size_t size, Alignment align, AllocT *objectAllocator, size_t poolSize, 304 * @param align [all...] |
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/include/be/ |
H A D | common_utils.h | 315 inline uint64 RoundUpConst(uint64 offset, uint64 align) in RoundUpConst() argument 317 CHECK_FATAL(offset <= UINT64_MAX - align, "must not be zero"); in RoundUpConst() 318 DEBUG_ASSERT(offset + align >= 1, "result must be uint"); in RoundUpConst() 319 return (-align) & (offset + align - 1); in RoundUpConst() 327 /* align must be a power of 2 */ 328 inline uint64 RoundUp(uint64 offset, uint64 align) in RoundUp() argument 330 if (align == 0) { in RoundUp() 333 DEBUG_ASSERT(IsPowerOf2(align), "align mus in RoundUp() 337 RoundDownConst(int64 offset, int64 align) RoundDownConst() argument 343 RoundDown(int64 offset, int64 align) RoundDown() argument 352 IsAlignedTo(uint64 offset, uint64 align) IsAlignedTo() argument [all...] |
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/include/cg/x86_64/assembler/ |
H A D | elf_file.h | 29 static T Align(T offset, T align) in Align() argument 31 if (align <= 1) { in Align() 34 return (offset + align - 1) & (~(align - 1)); in Align() 40 Section(const std::string &name, Word type, Xword flags, Xword align) : name(name) in Section() argument 44 sectionHeader.sh_addralign = align; in Section() 149 DataSection(const std::string &name, Word type, Xword flags, Xword align) : Section(name, type, flags, align) {} in DataSection() argument 198 StringSection(const std::string &name, Word type, Xword flags, Xword align) : DataSection(name, type, flags, align) in StringSection() argument 215 RelaSection(const std::string &name, Word type, Xword flags, Word info, Xword align, const Section &link) RelaSection() argument 246 SymbolSection(const std::string &name, Word type, Xword flags, Xword align, const Section &link) SymbolSection() argument [all...] |
/arkcompiler/runtime_core/static_core/runtime/mem/ |
H A D | internal_allocator.cpp | 65 [[nodiscard]] void *InternalAllocator<CONFIG>::Alloc(size_t size, Alignment align) in Alloc() argument 78 res = AllocViaPandaAllocators<ALLOC_SCOPE_T>(size, align); in Alloc() 80 res = mallocAllocator_->Alloc(size, align); in Alloc() 87 tracker_->TrackAlloc(res, AlignUp(size, align), SpaceType::SPACE_TYPE_INTERNAL); in Alloc() 141 void *AllocInRunSlots(AllocatorT *runslotsAllocator, size_t size, Alignment align, size_t poolSize) in AllocInRunSlots() argument 143 void *res = runslotsAllocator->Alloc(size, align); in AllocInRunSlots() 149 res = runslotsAllocator->Alloc(size, align); in AllocInRunSlots() 168 void *InternalAllocator<CONFIG>::AllocViaRunSlotsAllocator(size_t size, Alignment align) in AllocViaRunSlotsAllocator() argument 173 res = AllocInRunSlots(runslotsAllocator_, size, align, RunSlotsAllocatorT::GetMinPoolSize()); in AllocViaRunSlotsAllocator() 178 res = AllocInRunSlots(ark::ManagedThread::GetCurrent()->GetLocalInternalAllocator(), size, align, in AllocViaRunSlotsAllocator() 185 AllocViaFreeListAllocator(size_t size, Alignment align) AllocViaFreeListAllocator() argument 213 AllocViaHumongousAllocator(size_t size, Alignment align) AllocViaHumongousAllocator() argument 242 AllocViaPandaAllocators(size_t size, Alignment align) AllocViaPandaAllocators() argument [all...] |
H A D | internal_allocator.h | 70 [[nodiscard]] void *Alloc(size_t size, Alignment align = DEFAULT_ALIGNMENT); 72 [[nodiscard]] void *AllocLocal(size_t size, Alignment align = DEFAULT_ALIGNMENT) in AllocLocal() 74 return Alloc<AllocScope::LOCAL>(size, align); in AllocLocal() 163 void *AllocViaPandaAllocators(size_t size, Alignment align); 165 void *AllocViaRunSlotsAllocator(size_t size, Alignment align); 166 void *AllocViaFreeListAllocator(size_t size, Alignment align); 167 void *AllocViaHumongousAllocator(size_t size, Alignment align);
|
H A D | allocator.cpp | 113 void *ObjectAllocatorNoGen<MT_MODE>::Allocate(size_t size, Alignment align, [[maybe_unused]] ark::ManagedThread *thread, in Allocate() argument 117 size_t alignedSize = AlignUp(size, GetAlignmentInBytes(align)); in Allocate() 120 mem = AllocateSafe(size, align, objectAllocator_, poolSize, SpaceType::SPACE_TYPE_OBJECT, &heapSpace_); in Allocate() 123 mem = AllocateSafe(size, align, largeObjectAllocator_, poolSize, SpaceType::SPACE_TYPE_OBJECT, &heapSpace_); in Allocate() 126 mem = AllocateSafe(size, align, humongousObjectAllocator_, poolSize, SpaceType::SPACE_TYPE_HUMONGOUS_OBJECT, in Allocate() 136 void *ObjectAllocatorNoGen<MT_MODE>::AllocateNonMovable(size_t size, Alignment align, ark::ManagedThread *thread, in AllocateNonMovable() argument 141 if (UNLIKELY(IsPygoteAllocEnabled() && pygoteSpaceAllocator_->CanAllocNonMovable(size, align))) { in AllocateNonMovable() 142 mem = pygoteSpaceAllocator_->Alloc(size, align); in AllocateNonMovable() 145 mem = Allocate(size, align, thread, objInit, false); in AllocateNonMovable() 154 Alignment ObjectAllocatorNoGen<MT_MODE>::CalculateAllocatorAlignment(size_t align) in CalculateAllocatorAlignment() argument 268 Allocate(size_t size, Alignment align, [[maybe_unused]] ark::ManagedThread *thread, ObjMemInitPolicy objInit, [[maybe_unused]] bool pinned) Allocate() argument 285 AllocateNonMovable(size_t size, Alignment align, [[maybe_unused]] ark::ManagedThread *thread, ObjMemInitPolicy objInit) AllocateNonMovable() argument 318 CalculateAllocatorAlignment(size_t align) CalculateAllocatorAlignment() argument [all...] |
H A D | heap_manager.cpp | 102 ObjectHeader *HeapManager::AllocateObject(BaseClass *cls, size_t size, Alignment align, ManagedThread *thread, in AllocateObject() argument 113 void *mem = AllocateMemoryForObject(size, align, thread, objInitType, pinned); in AllocateObject() 115 mem = TryGCAndAlloc(size, align, thread, objInitType, pinned); in AllocateObject() 135 void *HeapManager::TryGCAndAlloc(size_t size, Alignment align, ManagedThread *thread, in TryGCAndAlloc() argument 155 mem = AllocateMemoryForObject(size, align, thread, objInitType, pinned); in TryGCAndAlloc() 172 void *HeapManager::AllocateMemoryForObject(size_t size, Alignment align, ManagedThread *thread, in AllocateMemoryForObject() argument 198 mem = objectAllocator_.AsObjectAllocator()->Allocate(size, align, thread, objInitType, pinned); in AllocateMemoryForObject() 204 ObjectHeader *HeapManager::AllocateNonMovableObject(BaseClass *cls, size_t size, Alignment align, ManagedThread *thread, in AllocateNonMovableObject() argument 210 void *mem = objectAllocator_.AsObjectAllocator()->AllocateNonMovable(size, align, thread, objInitType); in AllocateNonMovableObject() 214 mem = objectAllocator_.AsObjectAllocator()->AllocateNonMovable(size, align, threa in AllocateNonMovableObject() [all...] |
H A D | pygote_space_allocator-inl.h | 88 inline void *PygoteSpaceAllocator<AllocConfigT>::Alloc(size_t size, Alignment align) in Alloc() argument 95 void *obj = runslotsAlloc_.template Alloc<true, false>(size, align); in Alloc() 103 obj = runslotsAlloc_.Alloc(size, align); in Alloc() 117 obj = runslotsAlloc_.Alloc(size, align); in Alloc() 120 obj = arena_->Alloc(size, align); in Alloc() 131 obj = arena_->Alloc(size, align); in Alloc()
|
/arkcompiler/runtime_core/libpandabase/tests/ |
H A D | arena_allocator_test.cpp | 80 for (Alignment align = LOG_ALIGN_MIN; align <= LOG_ALIGN_MAX; in AllocateWithAlignment() 81 align = static_cast<Alignment>(static_cast<size_t>(align) + 1)) { in AllocateWithAlignment() 84 size_t mask = GetAlignmentInBytes(align) - 1; in AllocateWithAlignment() 89 arr[i] = static_cast<T *>(aa.Alloc(sizeof(T), align)); in AllocateWithAlignment() 96 ASSERT_NE(arr[i], nullptr) << "value of i: " << i << ", align: " << align; in AllocateWithAlignment() local 97 ASSERT_EQ(reinterpret_cast<size_t>(arr[i]) & mask, 0U) << "value of i: " << i << ", align: " << align; in AllocateWithAlignment() local 123 size_t align = MIN_LOG_ALIGN_SIZE_T + random_value % (MAX_LOG_ALIGN_SIZE_T - MIN_LOG_ALIGN_SIZE_T); AllocateWithDiffAlignment() local 127 ASSERT_EQ(reinterpret_cast<size_t>(arr[i]) & mask, 0U) << "value of i: " << i << ", align: " << align; AllocateWithDiffAlignment() local [all...] |
/arkcompiler/runtime_core/static_core/libpandabase/tests/ |
H A D | arena_allocator_test.cpp | 88 for (Alignment align = LOG_ALIGN_MIN; align <= LOG_ALIGN_MAX; in AllocateWithAlignment() 89 align = static_cast<Alignment>(static_cast<size_t>(align) + 1)) { in AllocateWithAlignment() 92 size_t mask = GetAlignmentInBytes(align) - 1L; in AllocateWithAlignment() 97 arr[i] = static_cast<T *>(aa.Alloc(sizeof(T), align)); in AllocateWithAlignment() 104 ASSERT_NE(arr[i], nullptr) << "value of i: " << i << ", align: " << align; in AllocateWithAlignment() local 105 ASSERT_EQ(reinterpret_cast<size_t>(arr[i]) & mask, 0U) << "value of i: " << i << ", align: " << align; in AllocateWithAlignment() local 131 size_t align = MIN_LOG_ALIGN_SIZE_T + randomValue % (MAX_LOG_ALIGN_SIZE_T - MIN_LOG_ALIGN_SIZE_T); AllocateWithDiffAlignment() local 135 ASSERT_EQ(reinterpret_cast<size_t>(arr[i]) & mask, 0U) << "value of i: " << i << ", align: " << align; AllocateWithDiffAlignment() local [all...] |
/arkcompiler/ets_runtime/ecmascript/dfx/dump_code/ |
H A D | jit_dump_elf.h | 44 Section(const std::string &name, maplebe::Word type, maplebe::Xword flags, maplebe::Xword align) : name(name) in Section() argument 48 sectionHeader.sh_addralign = align; in Section() 154 maplebe::Xword align, const Section &link) : Section(name, type, flags, align) in RelaSection() 184 SymbolSection(const std::string &name, maplebe::Word type, maplebe::Xword flags, maplebe::Xword align, in SymbolSection() argument 185 const Section &link) : Section(name, type, flags, align) in SymbolSection() 253 DataSection(const std::string &name, maplebe::Word type, maplebe::Xword flags, maplebe::Xword align) in DataSection() argument 254 : Section(name, type, flags, align) {} in DataSection() 303 StringSection(const std::string &name, maplebe::Word type, maplebe::Xword flags, maplebe::Xword align) in StringSection() argument 304 : DataSection(name, type, flags, align) in StringSection() 153 RelaSection(const std::string &name, maplebe::Word type, maplebe::Xword flags, maplebe::Word info, maplebe::Xword align, const Section &link) RelaSection() argument 322 Align(T offset, T align) Align() argument [all...] |
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/src/cg/x86_64/ |
H A D | x64_memlayout.cpp | 53 void X64MemLayout::SetSizeAlignForTypeIdx(uint32 typeIdx, uint32 &size, uint32 &align) const in SetSizeAlignForTypeIdx() 55 align = GlobalTables::GetTypeTable().GetTypeFromTyIdx(typeIdx)->GetAlign(); in SetSizeAlignForTypeIdx() 84 uint32 align = 0; in LayoutFormalParams() local 87 SetSizeAlignForTypeIdx(ptyIdx, size, align); in LayoutFormalParams() 89 segArgsRegPassed.SetSize(static_cast<uint32>(RoundUp(segArgsRegPassed.GetSize(), align))); in LayoutFormalParams() 94 SetSizeAlignForTypeIdx(ptyIdx, size, align); in LayoutFormalParams() 96 segArgsStkPassed.SetSize(static_cast<uint32>(RoundUp(segArgsStkPassed.GetSize(), align))); in LayoutFormalParams() 120 uint32 align = ty->GetAlign(); in LayoutLocalVariables() local 121 segLocals.SetSize(static_cast<uint32>(RoundUp(segLocals.GetSize(), align))); in LayoutLocalVariables()
|
/arkcompiler/runtime_core/static_core/verification/config/ |
H A D | config.h | 35 PandaString Image(size_t align = 0) const in Image() 37 PandaString spaces(align, ' '); in Image() 40 result += s.Image(align + 2UL); in Image()
|
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/src/cg/aarch64/ |
H A D | aarch64_memlayout.cpp | 63 void AArch64MemLayout::SetSizeAlignForTypeIdx(uint32 typeIdx, uint32 &size, uint32 &align) const in SetSizeAlignForTypeIdx() 67 align = mirType->GetAlign(); in SetSizeAlignForTypeIdx() 88 uint32 align; in LayoutFormalParams() local 89 SetSizeAlignForTypeIdx(ptyIdx, size, align); in LayoutFormalParams() 92 segArgsRegPassed.SetSize(static_cast<uint32>(RoundUp(segArgsRegPassed.GetSize(), align))); in LayoutFormalParams() 98 uint32 align; in LayoutFormalParams() local 99 SetSizeAlignForTypeIdx(ptyIdx, size, align); in LayoutFormalParams() 101 segArgsStkPassed.SetSize(static_cast<uint32>(RoundUp(segArgsStkPassed.GetSize(), align))); in LayoutFormalParams() 117 // | GR saved area | 16 byte align| 119 // | VR saved area | 16 byte align | 156 uint32 align = ty->GetAlign(); LayoutLocalVariables() local [all...] |
/arkcompiler/runtime_core/libpandabase/mem/ |
H A D | arena_allocator.cpp | 91 void *ArenaAllocatorT<use_oom_handler>::Alloc(size_t size, Alignment align) in Alloc() argument 94 LOG(DEBUG, ALLOC) << "ArenaAllocator: try to alloc " << size << " with align " << align; in Alloc() local 98 ret = buff_.Alloc(size, align); in Alloc() 101 ret = AllocateAndAddNewPool(size, align); in Alloc() 104 ret = AllocateAndAddNewPool(size, align); in Alloc() 112 LOG(DEBUG, ALLOC) << "ArenaAllocator: allocated " << size << " bytes aligned by " << align; in Alloc() local
|
H A D | arena_allocator.h | 73 [[nodiscard]] virtual void *Alloc(size_t size, Alignment align = DEFAULT_ARENA_ALIGNMENT); 131 void *Alloc(size_t size, Alignment align = DEFAULT_ARENA_ALIGNMENT) in Alloc() 135 void *ret = std::align(GetAlignmentInBytes(align), size, new_pos, free_size); in Alloc() 166 void *Alloc([[maybe_unused]] size_t size, [[maybe_unused]] Alignment align = DEFAULT_ARENA_ALIGNMENT) in Alloc()
|
/arkcompiler/runtime_core/static_core/libpandabase/mem/ |
H A D | arena_allocator.cpp | 86 void *ArenaAllocatorT<USE_OOM_HANDLER>::Alloc(size_t size, Alignment align) in Alloc() argument 89 LOG(DEBUG, ALLOC) << "ArenaAllocator: try to alloc " << size << " with align " << align; in Alloc() local 93 ret = buff_.Alloc(size, align); in Alloc() 96 ret = AllocateAndAddNewPool(size, align); in Alloc() 99 ret = AllocateAndAddNewPool(size, align); in Alloc() 107 LOG(DEBUG, ALLOC) << "ArenaAllocator: allocated " << size << " bytes aligned by " << align; in Alloc() local
|
H A D | arena_allocator.h | 71 [[nodiscard]] PANDA_PUBLIC_API void *Alloc(size_t size, Alignment align = DEFAULT_ARENA_ALIGNMENT); 129 void *Alloc(size_t size, Alignment align = DEFAULT_ARENA_ALIGNMENT) in Alloc() 133 void *ret = std::align(GetAlignmentInBytes(align), size, newPos, freeSize); in Alloc() 164 void *Alloc([[maybe_unused]] size_t size, [[maybe_unused]] Alignment align = DEFAULT_ARENA_ALIGNMENT) in Alloc()
|
/arkcompiler/runtime_core/static_core/runtime/tests/ |
H A D | tlab_test.cpp | 97 Alignment align = DEFAULT_ALIGNMENT; 100 size_t mask = GetAlignmentInBytes(align) - 1; 113 ASSERT_NE(arr[i], nullptr) << "value of i: " << i << ", align: " << align; 115 << "value of i: " << i << ", align: " << align; 117 ASSERT_EQ(*arr[i], rand() % std::numeric_limits<int>::max()) << "value of i: " << i << ", align: " << align;
|
H A D | bump_allocator_test.cpp | 121 Alignment align = DEFAULT_ALIGNMENT; in DEATH_TEST_F() local 124 size_t mask = GetAlignmentInBytes(align) - 1; in DEATH_TEST_F() 129 arr[i] = static_cast<int *>(bpAllocator.Alloc(sizeof(int), align)); in DEATH_TEST_F() 137 ASSERT_NE(arr[i], nullptr) << "value of i: " << i << ", align: " << align << ", seed:" << seed_; in DEATH_TEST_F() 139 << "value of i: " << i << ", align: " << align << ", seed:" << seed_; in DEATH_TEST_F() 142 << "value of i: " << i << ", align: " << align << ", seed:" << seed_; in DEATH_TEST_F()
|
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/include/cg/ |
H A D | ifile.h | 37 static T Align(T offset, T align) in Align() argument 39 if (align <= 1) { in Align() 42 return (offset + align - 1) & (~(align - 1)); in Align() 103 Section(std::string name, Word type, Word flags, uint32 align, ObjEmitter &emitter, MemPool &memPool); 219 DataSection(const std::string &name, Word type, Word flags, Word align, ObjEmitter &emitter, MemPool &inputMemPool) in DataSection() argument 220 : Section(name, type, flags, align, emitter, inputMemPool), in DataSection() 332 StringSection(const std::string &name, Word type, Word flags, Word align, ObjEmitter &emitter, MemPool &memPool) in StringSection() argument 333 : DataSection(name, type, flags, align, emitter, memPool) in StringSection() 357 SymbolSection(const std::string &name, Word type, Word flags, Word align, ObjEmitte argument 417 RelaSection(const std::string &name, Word type, Word flags, Word info, Word align, const Section &link, ObjEmitter &emitter, MemPool &memPool) RelaSection() argument [all...] |
/arkcompiler/runtime_core/static_core/runtime/mem/gc/g1/ |
H A D | g1-allocator.cpp | 193 void *ObjectAllocatorG1<MT_MODE>::Allocate(size_t size, Alignment align, [[maybe_unused]] ark::ManagedThread *thread, in Allocate() argument 197 size_t alignedSize = AlignUp(size, GetAlignmentInBytes(align)); in Allocate() 199 mem = objectAllocator_->Alloc(size, align, pinned); in Allocate() 212 void *ObjectAllocatorG1<MT_MODE>::AllocateNonMovable(size_t size, Alignment align, in AllocateNonMovable() argument 218 if (UNLIKELY(IsPygoteAllocEnabled() && pygoteSpaceAllocator_->CanAllocNonMovable(size, align))) { in AllocateNonMovable() 219 mem = pygoteSpaceAllocator_->Alloc(size, align); in AllocateNonMovable() 221 size_t alignedSize = AlignUp(size, GetAlignmentInBytes(align)); in AllocateNonMovable() 224 mem = nonmovableAllocator_->Alloc(alignedSize, align); in AllocateNonMovable() 227 mem = humongousObjectAllocator_->Alloc(alignedSize, align); in AllocateNonMovable() 239 Alignment ObjectAllocatorG1<MT_MODE>::CalculateAllocatorAlignment(size_t align) in CalculateAllocatorAlignment() argument [all...] |
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_be/src/cg/ |
H A D | ifile.cpp | 23 Section::Section(std::string secName, Word type, Word flags, uint32 align, ObjEmitter &objEmitter, MemPool &memPool) in Section() argument 28 secHeader.sh_addralign = align; in Section()
|
/arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_ir/src/ |
H A D | mir_type.cpp | 250 LogInfo::MapleLogger() << " align(" << GetAlign() << ")"; in DumpAttributes() 363 static constexpr uint64 RoundUpConst(uint64 offset, uint32 align) in RoundUpConst() argument 365 uint64 tempFirst = static_cast<uint64>(-align); in RoundUpConst() 366 CHECK_FATAL((offset <= UINT64_MAX - align), "must not be zero"); in RoundUpConst() 367 DEBUG_ASSERT(offset + align > 0, "offset and align should not be zero"); in RoundUpConst() 368 uint64 tempSecond = static_cast<uint64>(offset + align - 1); in RoundUpConst() 372 static inline uint64 RoundUp(uint64 offset, uint32 align) in RoundUp() argument 374 if (align == 0) { in RoundUp() 377 return RoundUpConst(offset, align); in RoundUp() [all...] |