| /arkcompiler/ets_frontend/ets2panda/test/unit/public/ |
| D | ast_builder_test.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 18 #include "util/ast-builders/classDefinitionBuilder.h" 19 #include "util/ast-builders/binaryExpressionBuilder.h" 20 #include "util/ast-builders/classPropertyBuilder.h" 21 #include "util/ast-builders/identifierBuilder.h" 22 #include "util/ast-builders/numberLiteralBuilder.h" 23 #include "util/ast-builders/awaitExpressionBuilder.h" 24 #include "util/ast-builders/bigintLiteralBuilder.h" 25 #include "util/ast-builders/blockExpressionBuilder.h" 26 #include "util/ast-builders/blockStatementBuilder.h" [all …]
|
| /arkcompiler/runtime_core/static_core/runtime/tests/ |
| D | region_allocator_test.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 29 #include "runtime/mem/region_allocator-inl.h" 44 options_.SetHeapSizeLimit(320_MB); // NOLINT(readability-magic-numbers) in RegionAllocatorTestBase() 51 // we don't need young space for non-movable or humongous allocator tests in RegionAllocatorTestBase() 59 thread_->ManagedCodeBegin(); in RegionAllocatorTestBase() 60 classLinker_ = Runtime::GetCurrent()->GetClassLinker(); in RegionAllocatorTestBase() 61 … auto lang = Runtime::GetCurrent()->GetLanguageContext(panda_file::SourceLang::PANDA_ASSEMBLY); in RegionAllocatorTestBase() 62 auto *classLinkerExt = Runtime::GetCurrent()->GetClassLinker()->GetExtension(lang); in RegionAllocatorTestBase() 63 testClass_ = classLinkerExt->CreateClass(nullptr, 0, 0, sizeof(ark::Class)); in RegionAllocatorTestBase() [all …]
|
| D | allocator_test_base.h | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 31 #include "runtime/mem/bump-allocator.h" 38 template <class Allocator> 56 …d int seed_; // NOLINT(misc-non-private-member-variables-in-class… 57 …ray<uint8_t, BYTE_ARRAY_SIZE> byteArray_ {}; // NOLINT(misc-non-private-member-variables-in-class… 68 * @brief Add pool to allocator (maybe empty for some allocators) 69 * @param allocator - allocator for pool memory adding 71 virtual void AddMemoryPoolToAllocator([[maybe_unused]] Allocator &allocator) = 0; 74 * @brief Add pool to allocator and protect (maybe empty for some allocators) [all …]
|
| D | freelist_allocator_test.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 25 #include "runtime/mem/freelist_allocator-inl.h" 45 thread_->ManagedCodeBegin(); in FreeListAllocatorTest() 54 thread_->ManagedCodeEnd(); in ~FreeListAllocatorTest() 72 …Pool pool = PoolManager::GetMmapMemPool()->AllocPool(DEFAULT_POOL_SIZE_FOR_ALLOC, SpaceType::SPACE… in AddMemoryPoolToAllocator() 80 ASSERT_TRUE(0 && "Can't add mem pool to allocator"); in AddMemoryPoolToAllocator() 90 bool AllocatedByThisAllocator(NonObjectFreeListAllocator &allocator, void *mem) override in AllocatedByThisAllocator() argument 92 return allocator.AllocatedByFreeListAllocator(mem); in AllocatedByThisAllocator() 98 PoolManager::GetMmapMemPool()->FreePool(i.GetMem(), i.GetSize()); in ClearPoolManager() [all …]
|
| D | runslots_allocator_test.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 20 #include "runtime/mem/runslots_allocator-inl.h" 34 // NOLINTNEXTLINE(modernize-use-equals-default) 60 ASSERT_TRUE(0 && "Can't add mem pool to allocator"); in AddMemoryPoolToAllocator() 73 ASSERT_TRUE(0 && "Can't add mem pool to allocator"); in AddMemoryPoolToAllocatorProtected() 82 bool AllocatedByThisAllocator(NonObjectAllocator &allocator, void *mem) override in AllocatedByThisAllocator() argument 84 return allocator.AllocatedByRunSlotsAllocator(mem); in AllocatedByThisAllocator() 92 runslots->Initialize(slotsSize, ToUintPtr(mem), true); in TestRunSlots() 94 while (runslots->PopFreeSlot() != nullptr) { in TestRunSlots() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/varbinder/ |
| D | scope.h | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 38 // CC-OFFNXT(G.PRE.09) code gen 39 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 40 #define DECLARE_CLASSES(type, className) class className; // CC-OFF(G.PRE.02) name part 61 // NOLINTBEGIN(misc-non-private-member-variables-in-classes) 67 // NOLINTEND(misc-non-private-member-variables-in-classes) 84 // CC-OFFNXT(G.PRE.06) solid logic 85 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 89 /* CC-OFFNXT(G.PRE.05) The macro is used to generate a function. Return is needed*/ \ [all …]
|
| /arkcompiler/runtime_core/static_core/runtime/mem/ |
| D | internal_allocator.h | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 21 #include "libpandabase/mem/mmap_mem_pool-inl.h" 40 class Allocator; variable 44 LOCAL // The allocation will be in thread-local storage 48 PANDA_ALLOCATORS, // Use panda allocators as internal allocator 49 MALLOC_ALLOCATOR // Use malloc allocator as internal allocator 97 tracker_->Dump(); in Dump() 107 * @brief Iterates over memory pools used by this allocator. 109 * @param mem_visitor - function pointer or functor [all …]
|
| /arkcompiler/ets_frontend/ets2panda/checker/ts/ |
| D | typeCreation.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 24 return search->second; in CreateNumberLiteralType() 27 auto *newNumLiteralType = Allocator()->New<NumberLiteralType>(value); in CreateNumberLiteralType() 36 return search->second; in CreateBigintLiteralType() 39 auto *newBigintLiteralType = Allocator()->New<BigintLiteralType>(str, negative); in CreateBigintLiteralType() 48 return search->second; in CreateStringLiteralType() 51 auto *newStrLiteralType = Allocator()->New<StringLiteralType>(str); in CreateStringLiteralType() 58 ArenaVector<Type *> newConstituentTypes(Allocator()->Adapter()); in CreateUnionType() 69 ArenaVector<Type *> newConstituentTypes(Allocator()->Adapter()); in CreateUnionType() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ast_verifier/ |
| D | ASTVerifier.cpp | 2 * Copyright (c) 2023-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 41 ASTVerifier::ASTVerifier(ArenaAllocator *allocator) in ASTVerifier() argument 43 AddInvariant<NodeHasParent>(allocator, "NodeHasParent"); in ASTVerifier() 44 AddInvariant<NodeHasSourceRange>(allocator, "NodeHasSourceRange"); in ASTVerifier() 45 AddInvariant<NodeHasType>(allocator, "NodeHasType"); in ASTVerifier() 46 AddInvariant<IdentifierHasVariable>(allocator, "IdentifierHasVariable"); in ASTVerifier() 47 AddInvariant<VariableHasScope>(allocator, "VariableHasScope"); in ASTVerifier() 48 AddInvariant<EveryChildHasValidParent>(allocator, "EveryChildHasValidParent"); in ASTVerifier() 49 AddInvariant<EveryChildInParentRange>(allocator, "EveryChildInParentRange"); in ASTVerifier() [all …]
|
| /arkcompiler/runtime_core/static_core/docs/diagrams/ |
| D | gc-trigger-sequence-OOM.plantuml | 1 ' Copyright (c) 2021-2024 Huawei Device Co., Ltd. 6 ' http://www.apache.org/licenses/LICENSE-2.0 23 participant Allocator 27 AppThread1 -> Allocator: Request for the allocation 28 Allocator -> Allocator: OOM 29 Allocator -> GCTaskQueue: Add new GC task and wait for GC 30 Allocator -> AppThread2: Suspend 31 GCThread -> GCTaskQueue : Request for the task 32 GCTaskQueue -> GCThread : GC task 33 GCThread -> GC : GC task [all …]
|
| /arkcompiler/runtime_core/docs/diagrams/ |
| D | gc-trigger-sequence-OOM.pusequence | 1 ' Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 ' http://www.apache.org/licenses/LICENSE-2.0 23 participant Allocator 27 AppThread1 -> Allocator: Request for the allocation 28 Allocator -> Allocator: OOM 29 Allocator -> GCTaskQueue: Add new GC task and wait for GC 30 Allocator -> AppThread2: Suspend 31 GCThread -> GCTaskQueue : Request for the task 32 GCTaskQueue -> GCThread : GC task 33 GCThread -> GC : GC task [all …]
|
| /arkcompiler/ets_frontend/es2panda/binder/ |
| D | scope.h | 7 * http://www.apache.org/licenses/LICENSE-2.0 56 explicit TSBindings(ArenaAllocator *allocator) : allocator_(allocator) {} in TSBindings() argument 64 tsBindings_[index] = allocator_->New<VariableMap>(allocator_->Adapter()); in AddTSVariable() 66 return tsBindings_[index]->insert({name, variable}).second; in AddTSVariable() 77 auto res = tsBindings_[index]->find(name); in FindTSVariable() 78 if (res == tsBindings_[index]->end()) { in FindTSVariable() 81 return res->second; in FindTSVariable() 87 if (tsBindings_[i] && tsBindings_[i]->find(name) != tsBindings_[i]->end()) { in InTSBindings() 106 explicit ExportBindings(ArenaAllocator *allocator) in ExportBindings() argument 107 : exportBindings_(allocator->Adapter()), in ExportBindings() [all …]
|
| D | scope.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 29 if (iter->IsVariableScope()) { in EnclosingVariableScope() 30 return iter->AsVariableScope(); in EnclosingVariableScope() 33 iter = iter->Parent(); in EnclosingVariableScope() 43 if (iter->IsFunctionVariableScope()) { in EnclosingFunctionVariableScope() 44 return iter->AsFunctionVariableScope(); in EnclosingFunctionVariableScope() 47 iter = iter->Parent(); in EnclosingFunctionVariableScope() 60 return res->second; in FindLocal() 73 return res->second; in FindLocal() 79 auto *funcVariableScope = scope->GetFunctionScope(); in CalculateLevelInCorrespondingFunctionScope() [all …]
|
| /arkcompiler/runtime_core/compiler/optimizer/ir/ |
| D | dump.cpp | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 31 …::enable_if_t<std::is_integral_v<T>, ArenaString> ToArenaString(T value, ArenaAllocator *allocator) in ToArenaString() argument 33 ArenaString res(std::to_string(value), allocator->Adapter()); in ToArenaString() 37 ArenaString GetId(uint32_t id, ArenaAllocator *allocator) in GetId() argument 39 …return (id == INVALID_ID ? ArenaString("XX", allocator->Adapter()) : ToArenaString(id, allocator)); in GetId() 42 ArenaString IdToString(uint32_t id, ArenaAllocator *allocator, bool v_reg, bool is_phi) in IdToString() argument 44 ArenaString reg(v_reg ? "v" : "", allocator->Adapter()); in IdToString() 45 ArenaString phi(is_phi ? "p" : "", allocator->Adapter()); in IdToString() 46 return reg + GetId(id, allocator) + phi; in IdToString() [all …]
|
| /arkcompiler/runtime_core/static_core/compiler/code_info/ |
| D | code_info_builder.h | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 29 CodeInfoBuilder(Arch arch, ArenaAllocator *allocator) in CodeInfoBuilder() argument 31 stackMaps_(allocator), in CodeInfoBuilder() 32 inlineInfos_(allocator), in CodeInfoBuilder() 33 rootsRegMasks_(allocator), in CodeInfoBuilder() 34 rootsStackMasks_(allocator), in CodeInfoBuilder() 35 methodIds_(allocator), in CodeInfoBuilder() 36 vregsCatalogue_(allocator), in CodeInfoBuilder() 37 vregsMap_(allocator), in CodeInfoBuilder() [all …]
|
| /arkcompiler/ets_frontend/es2panda/typescript/types/ |
| D | globalTypesHolder.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 40 GlobalTypesHolder::GlobalTypesHolder(ArenaAllocator *allocator) in GlobalTypesHolder() argument 42 globalTypes_[static_cast<size_t>(GlobalTypeId::NUMBER)] = allocator->New<NumberType>(); in GlobalTypesHolder() 43 globalTypes_[static_cast<size_t>(GlobalTypeId::ANY)] = allocator->New<AnyType>(); in GlobalTypesHolder() 44 globalTypes_[static_cast<size_t>(GlobalTypeId::STRING)] = allocator->New<StringType>(); in GlobalTypesHolder() 45 globalTypes_[static_cast<size_t>(GlobalTypeId::SYMBOL)] = allocator->New<SymbolType>(); in GlobalTypesHolder() 46 globalTypes_[static_cast<size_t>(GlobalTypeId::BOOLEAN)] = allocator->New<BooleanType>(); in GlobalTypesHolder() 47 globalTypes_[static_cast<size_t>(GlobalTypeId::VOID)] = allocator->New<VoidType>(); in GlobalTypesHolder() 48 globalTypes_[static_cast<size_t>(GlobalTypeId::NULL_ID)] = allocator->New<NullType>(); in GlobalTypesHolder() 49 globalTypes_[static_cast<size_t>(GlobalTypeId::UNDEFINED)] = allocator->New<UndefinedType>(); in GlobalTypesHolder() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_ir/include/ |
| D | mir_nodes.h | 7 * http://www.apache.org/licenses/LICENSE-2.0 116 virtual BaseNode *CloneTree(MapleAllocator &allocator) const in CloneTree() argument 118 return allocator.GetMemPool()->New<BaseNode>(*this); in CloneTree() 232 UnaryNode *CloneTree(MapleAllocator &allocator) const override in CloneTree() argument 234 auto *node = allocator.GetMemPool()->New<UnaryNode>(*this); in CloneTree() 235 node->SetOpnd(uOpnd->CloneTree(allocator), 0); in CloneTree() 285 TypeCvtNode *CloneTree(MapleAllocator &allocator) const override in CloneTree() argument 287 auto *node = allocator.GetMemPool()->New<TypeCvtNode>(*this); in CloneTree() 288 node->SetOpnd(Opnd(0)->CloneTree(allocator), 0); in CloneTree() 325 RetypeNode *CloneTree(MapleAllocator &allocator) const override in CloneTree() argument [all …]
|
| /arkcompiler/ets_frontend/ets2panda/compiler/lowering/ets/ |
| D | lambdaLowering.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 58 for (ir::AstNode *curr = ast->Parent(); curr != nullptr; curr = curr->Parent()) { in FindEnclosingClassAndFunction() 59 if (curr->IsClassDeclaration()) { in FindEnclosingClassAndFunction() 60 return {curr->AsClassDeclaration(), function}; in FindEnclosingClassAndFunction() 62 if (curr->IsScriptFunction()) { in FindEnclosingClassAndFunction() 63 function = curr->AsScriptFunction(); in FindEnclosingClassAndFunction() 71 return lambda->IsAnyChild([](ir::AstNode *ast) { return ast->IsThisExpression(); }); in CheckIfNeedThis() 82 static util::StringView CreateCalleeName(ArenaAllocator *allocator) in CreateCalleeName() argument 84 auto name = util::UString(util::StringView("lambda$invoke$"), allocator); in CreateCalleeName() 97 auto *allocator = ctx->allocator; in CloneTypeParams() local [all …]
|
| D | spreadLowering.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 28 auto const refine = [](ir::AstNode *n) { n->SetRange(n->Parent()->Range()); }; in SetSourceRangesRecursively() 31 node->IterateRecursively(refine); in SetSourceRangesRecursively() 39 auto *const allocator = ctx->allocator; in CreateSpreadArrayDeclareStatements() local 40 auto *const parser = ctx->parser->AsETSParser(); in CreateSpreadArrayDeclareStatements() 41 for (auto element : array->Elements()) { in CreateSpreadArrayDeclareStatements() 42 if (element->Type() != ir::AstNodeType::SPREAD_ELEMENT) { in CreateSpreadArrayDeclareStatements() 45 ir::Identifier *const arrIdent = Gensym(allocator); in CreateSpreadArrayDeclareStatements() 46 auto *const initExpr = element->AsSpreadElement()->Argument()->Clone(allocator, nullptr); in CreateSpreadArrayDeclareStatements() 48 …statements.emplace_back(parser->CreateFormattedStatement("let @@I1 = (@@E2);", arrIdent, initExpr)… in CreateSpreadArrayDeclareStatements() [all …]
|
| /arkcompiler/runtime_core/static_core/compiler/optimizer/ir/ |
| D | dump.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 39 …::enable_if_t<std::is_integral_v<T>, ArenaString> ToArenaString(T value, ArenaAllocator *allocator) in ToArenaString() argument 41 ArenaString res(std::to_string(value), allocator->Adapter()); in ToArenaString() 45 ArenaString GetId(uint32_t id, ArenaAllocator *allocator) in GetId() argument 47 …return (id == INVALID_ID ? ArenaString("XX", allocator->Adapter()) : ToArenaString(id, allocator)); in GetId() 50 ArenaString IdToString(uint32_t id, ArenaAllocator *allocator, bool vReg, bool isPhi) in IdToString() argument 52 ArenaString reg(vReg ? "v" : "", allocator->Adapter()); in IdToString() 53 ArenaString phi(isPhi ? "p" : "", allocator->Adapter()); in IdToString() 54 return reg + GetId(id, allocator) + phi; in IdToString() [all …]
|
| /arkcompiler/ets_runtime/ecmascript/compiler/codegen/maple/maple_util/include/ |
| D | mem_reference_table.h | 7 * http://www.apache.org/licenses/LICENSE-2.0 29 …explicit MemDefUse(MapleAllocator &allocator) : defSet(allocator.Adapter()), useSet(allocator.Adap… in MemDefUse() argument 75 // The field is set TRUE to indicate that the callee-save and callee-reload instructions do not 84 MemReferenceTable(MapleAllocator &allocator, MIRFunction &func) in MemReferenceTable() argument 85 …: allocator(allocator), func(func), ostTable(allocator.Adapter()), memDefUsePart(allocator.Adapter… in MemReferenceTable() 109 return iter->second; in GetOrCreateMemDefUseFromBaseNode() 111 auto *newDefUse = allocator.New<MemDefUse>(allocator); in GetOrCreateMemDefUseFromBaseNode() 117 MapleAllocator &allocator;
|
| /arkcompiler/ets_frontend/ets2panda/evaluate/debugInfoDeserialization/ |
| D | methodBuilder.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 18 #include "libpandafile/file-inl.h" 19 #include "libpandafile/method_data_accessor-inl.h" 20 #include "libpandafile/proto_data_accessor-inl.h" 37 ArenaVector<ir::TypeNode *> parameters(checker->Allocator()->Adapter()); in GetFunctionParameters() 44 true); // true -- skip `this` parameter in GetFunctionParameters() 53 …if (type->IsETSPrimitiveType() && type->AsETSPrimitiveType()->GetPrimitiveType() == ir::PrimitiveT… in CreateTypedReturnStatement() 54 return checker->AllocNode<ir::ReturnStatement>(); in CreateTypedReturnStatement() 60 auto *allocator = checker->Allocator(); in CreateTypedReturnStatement() local 61 … auto *apiClass = checker->AllocNode<ir::Identifier>(helpers::DEBUGGER_API_CLASS_NAME, allocator); in CreateTypedReturnStatement() [all …]
|
| /arkcompiler/runtime_core/docs/ |
| D | memory-management-SW-requirements.md | 17 ## Allocator section in 2. OVERALL DESCRIPTION 20 - Bump pointer allocator 21 - Arena Allocator (objects can be deallocated at once(list of arenas, almost at once - O(number of … 22 - Freelist allocator 23 - TLAB 24 - Run of slots allocator 25 - Code allocator 29 - Code space (executable) 30 - Compiler Internal Space(linked list of arenas) 31 - Internal memory space for non-compiler part of runtime (including GC internals) [all …]
|
| /arkcompiler/runtime_core/static_core/docs/ |
| D | memory-management-SW-requirements.md | 17 ## Allocator section in 2. OVERALL DESCRIPTION 20 - Bump pointer allocator 21 - Arena Allocator (objects can be deallocated at once(list of arenas, almost at once - O(number of … 22 - Freelist allocator 23 - TLAB 24 - Run of slots allocator 25 - Code allocator 29 - Code space (executable) 30 - Compiler Internal Space(linked list of arenas) 31 - Internal memory space for non-compiler part of runtime (including GC internals) [all …]
|
| /arkcompiler/ets_frontend/ets2panda/checker/ets/ |
| D | dynamic.cpp | 2 * Copyright (c) 2021-2024 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 53 if (scope->IsGlobalScope()) { in ProcessCheckerNode() 56 scope = checker->VarBinder()->Program()->GlobalClassScope(); in ProcessCheckerNode() 59 …auto expressionCtx = varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), scope); in ProcessCheckerNode() 60 checker->VarBinder()->AsETSBinder()->ResolveReference(node); in ProcessCheckerNode() 62 if (node->IsMethodDefinition()) { in ProcessCheckerNode() 65 auto method = node->AsMethodDefinition(); in ProcessCheckerNode() 66 auto func = method->Value()->AsFunctionExpression()->Function(); in ProcessCheckerNode() 67 func->Id()->SetVariable(method->Id()->Variable()); in ProcessCheckerNode() [all …]
|