• Home
  • Raw
  • Download

Lines Matching +full:allocator +full:-

2  * Copyright (c) 2021-2025 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
57 // NOLINTBEGIN(misc-non-private-member-variables-in-classes) in SCOPE_TYPES()
63 // NOLINTEND(misc-non-private-member-variables-in-classes) in SCOPE_TYPES()
81 // CC-OFFNXT(G.PRE.06) solid logic
82 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
86 /* CC-OFFNXT(G.PRE.05) The macro is used to generate a function. Return is needed*/ \
87 return Type() == ScopeType::scopeType; /* CC-OFF(G.PRE.02) name part */ \
89 /* CC-OFFNXT(G.PRE.02) name part */ \
93 /* CC-OFFNXT(G.PRE.05) The macro is used to generate a function. Return is needed*/ \
94 return reinterpret_cast<className *>(this); /* CC-OFF(G.PRE.02) name part */ \
99 /* CC-OFFNXT(G.PRE.05) The macro is used to generate a function. Return is needed */ \
217 Variable *AddDecl(ArenaAllocator *allocator, Decl *decl, ScriptExtension extension) in AddDecl() argument
221 …AddBinding(allocator, FindLocal(decl->Name(), varbinder::ResolveBindingOptions::BINDINGS), decl, e… in AddDecl()
228 Variable *AddTsDecl(ArenaAllocator *allocator, Decl *decl, ScriptExtension extension) in AddTsDecl() argument
231 …return AddBinding(allocator, FindLocal(decl->Name(), ResolveBindingOptions::ALL), decl, extension); in AddTsDecl()
235 T *NewDecl(ArenaAllocator *allocator, Args &&...args);
238 std::pair<varbinder::Variable *, bool> AddDecl(ArenaAllocator *allocator, util::StringView name,
242 …static VariableType *CreateVar(ArenaAllocator *allocator, util::StringView name, VariableFlags fla…
246 Variable *PropagateBinding(ArenaAllocator *allocator, util::StringView name, Args &&...args);
260 …[[nodiscard]] ArenaMap<util::StringView, Variable *> OrderedBindings(ArenaAllocator *allocator) co… in OrderedBindings() argument
262 ArenaMap<util::StringView, Variable *> result(allocator->Adapter()); in OrderedBindings()
267 … virtual Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
288 explicit Scope(ArenaAllocator *allocator, Scope *parent) in Scope() argument
289 : parent_(parent), decls_(allocator->Adapter()), bindings_(allocator->Adapter()) in Scope()
293 explicit Scope(ArenaAllocator *allocator, Scope *parent, ScopeFlags flags) in Scope() argument
294 … : parent_(parent), decls_(allocator->Adapter()), bindings_(allocator->Adapter()), flags_(flags) in Scope()
299 * @return true - if the variable is shadowed
300 * false - otherwise
305 * @return true - if the variable is shadowed
306 * false - otherwise
310 Variable *AddLocal(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
313 Variable *AddLocalVar(ArenaAllocator *allocator, Decl *newDecl);
314 Variable *AddLocalInterfaceVariable(ArenaAllocator *allocator, Decl *newDecl);
315 Variable *AddLocalTypeAliasVariable(ArenaAllocator *allocator, Decl *newDecl);
316 Variable *AddLocalClassVariable(ArenaAllocator *allocator, Decl *newDecl);
329 // iter will be the EXACT type of scope with cv-qualifiers in FindImpl()
332 if (iter->IsFunctionParamScope()) { in FindImpl()
333 auto *const v = iter->FindLocal(name, options); in FindImpl()
340 const auto *const funcVariableScope = iter->AsFunctionParamScope()->GetFunctionScope(); in FindImpl()
342 if (funcVariableScope != nullptr && funcVariableScope->NeedLexEnv()) { in FindImpl()
346 iter = iter->Parent(); in FindImpl()
350 auto *const v = iter->FindLocal(name, options); in FindImpl()
356 if (iter->IsVariableScope()) { in FindImpl()
359 if (iter->AsVariableScope()->NeedLexEnv()) { in FindImpl()
364 iter = iter->Parent(); in FindImpl()
408 explicit VariableScope(ArenaAllocator *allocator, Scope *parent) : Scope(allocator, parent) {} in VariableScope() argument
411 …Variable *AddVar(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, ScriptExtens…
414 Variable *AddFunction(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
418 …Variable *AddTSBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, Variab…
421 Variable *AddLexical(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl);
423 // NOLINTBEGIN(misc-non-private-member-variables-in-classes)
426 // NOLINTEND(misc-non-private-member-variables-in-classes)
446 …std::tuple<Variable *, ir::Expression *> AddParamDecl(ArenaAllocator *allocator, varbinder::VarBin…
450 explicit ParamScope(ArenaAllocator *allocator, Scope *parent) in ParamScope() argument
451 : Scope(allocator, parent), params_(allocator->Adapter()) in ParamScope()
455 Variable *AddParameter(ArenaAllocator *allocator, Decl *newDecl, VariableFlags flags);
457 // NOLINTNEXTLINE(misc-non-private-member-variables-in-classes)
465 …explicit FunctionParamScope(ArenaAllocator *allocator, Scope *parent) : ParamScope(allocator, pare… in FunctionParamScope() argument
482 void BindName(ArenaAllocator *allocator, util::StringView name);
489 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
504 …explicit ScopeWithParamScope(ArenaAllocator *allocator, Scope *parent) : E(allocator, parent), par… in ScopeWithParamScope() argument
511 this->MergeBindings(paramScope->Bindings()); in BindParamScope()
516 ES2PANDA_ASSERT(this->Parent() == paramScope); in AssignParamScope()
531 // NOLINTNEXTLINE(misc-non-private-member-variables-in-classes)
537 explicit LocalScope(ArenaAllocator *allocator, Scope *parent) : Scope(allocator, parent) {} in LocalScope() argument
538 …explicit LocalScope(ArenaAllocator *allocator, Scope *parent, ScopeFlags flags) : Scope(allocator,… in LocalScope() argument
545 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
551 …explicit FunctionScope(ArenaAllocator *allocator, Scope *parent) : ScopeWithParamScope(allocator, … in FunctionScope() argument
588 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
590 …Variable *InsertBindingIfAbsentInScope(ArenaAllocator *allocator, Variable *currentVariable, Decl …
601 explicit ClassScope(ArenaAllocator *allocator, Scope *parent) in ClassScope() argument
602 : LocalScope(allocator, parent), in ClassScope()
603 typeAliasScope_(allocator->New<LocalScope>(allocator, this, ScopeFlags::TYPE_ALIAS)), in ClassScope()
604 …staticDeclScope_(allocator->New<LocalScope>(allocator, typeAliasScope_, ScopeFlags::STATIC_DECL_SC… in ClassScope()
605 …staticFieldScope_(allocator->New<LocalScope>(allocator, staticDeclScope_, ScopeFlags::STATIC_FIELD… in ClassScope()
606 …staticMethodScope_(allocator->New<LocalScope>(allocator, staticFieldScope_, ScopeFlags::STATIC_MET… in ClassScope()
607 …instanceDeclScope_(allocator->New<LocalScope>(allocator, staticMethodScope_, ScopeFlags::DECL_SCOP… in ClassScope()
608 …instanceFieldScope_(allocator->New<LocalScope>(allocator, instanceDeclScope_, ScopeFlags::FIELD_SC… in ClassScope()
609 …instanceMethodScope_(allocator->New<LocalScope>(allocator, instanceFieldScope_, ScopeFlags::METHOD… in ClassScope()
695 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
746 …explicit AnnotationScope(ArenaAllocator *allocator, Scope *parent) : ClassScope(allocator, parent)… in AnnotationScope() argument
756 …explicit AnnotationParamScope(ArenaAllocator *allocator, Scope *parent) : ParamScope(allocator, pa… in AnnotationParamScope() argument
763 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
769 …explicit CatchParamScope(ArenaAllocator *allocator, Scope *parent) : ParamScope(allocator, parent)… in CatchParamScope() argument
776 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
784 …explicit CatchScope(ArenaAllocator *allocator, Scope *parent) : ScopeWithParamScope(allocator, par… in CatchScope() argument
791 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
800 …explicit LoopDeclarationScope(ArenaAllocator *allocator, Scope *parent) : VariableScope(allocator,… in LoopDeclarationScope() argument
807 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
810 return AddLocal(allocator, currentVariable, newDecl, extension); in AddBinding()
822 void ConvertToVariableScope(ArenaAllocator *allocator);
833 explicit LoopScope(ArenaAllocator *allocator, Scope *parent) : VariableScope(allocator, parent) in LoopScope() argument
849 declScope_->loopScope_ = this; in BindDecls()
857 void ConvertToVariableScope(ArenaAllocator *allocator);
859 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, in AddBinding() argument
862 return AddLocal(allocator, currentVariable, newDecl, extension); in AddBinding()
866 // NOLINTBEGIN(misc-non-private-member-variables-in-classes)
869 // NOLINTEND(misc-non-private-member-variables-in-classes)
874 explicit GlobalScope(ArenaAllocator *allocator) in GlobalScope() argument
875 : FunctionScope(allocator, nullptr), foreignBindings_(allocator->Adapter()) in GlobalScope()
877 auto *paramScope = allocator->New<FunctionParamScope>(allocator, this); in GlobalScope()
880 paramScope_->BindFunctionScope(this); in GlobalScope()
888 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
918 explicit ModuleScope(ArenaAllocator *allocator) in ModuleScope() argument
919 : GlobalScope(allocator), in ModuleScope()
920 allocator_(allocator), in ModuleScope()
921 imports_(allocator_->Adapter()), in ModuleScope()
922 exports_(allocator_->Adapter()), in ModuleScope()
923 localExports_(allocator_->Adapter()) in ModuleScope()
953 Variable *AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
959 Variable *AddImport(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl);
968 T *Scope::NewDecl(ArenaAllocator *allocator, Args &&...args) in NewDecl() argument
970 T *decl = allocator->New<T>(std::forward<Args>(args)...); in NewDecl()
977 std::pair<varbinder::Variable *, bool> Scope::AddDecl(ArenaAllocator *allocator, util::StringView n… in AddDecl() argument
985 auto *decl = allocator->New<DeclType>(name); in AddDecl()
986 variable = allocator->New<VariableType>(decl, flags); in AddDecl()
989 bindings_.insert({decl->Name(), variable}); in AddDecl()
990 variable->SetScope(this); in AddDecl()
996 VariableType *Scope::CreateVar(ArenaAllocator *allocator, util::StringView name, VariableFlags flag… in CreateVar() argument
998 auto *decl = allocator->New<DeclType>(name); in CreateVar()
999 auto *variable = allocator->New<VariableType>(decl, flags); in CreateVar()
1000 decl->BindNode(node); in CreateVar()