Lines Matching refs:allocator
56 explicit TSBindings(ArenaAllocator *allocator) : allocator_(allocator) {}
106 explicit ExportBindings(ArenaAllocator *allocator)
107 : exportBindings_(allocator->Adapter()),
108 exportTSBindings_(allocator)
309 bool AddDecl(ArenaAllocator *allocator, Decl *decl, [[maybe_unused]] ScriptExtension extension)
313 return AddBinding(allocator, FindLocal(decl->Name()), decl, extension);
316 bool AddTsDecl(ArenaAllocator *allocator, Decl *decl, [[maybe_unused]] ScriptExtension extension)
319 return AddBinding(allocator, FindLocal(decl->Name(), ResolveBindingOptions::ALL), decl, extension);
328 T *NewDecl(ArenaAllocator *allocator, Args &&... args);
331 VariableType *AddDecl(ArenaAllocator *allocator, util::StringView name, VariableFlags flags);
334 static VariableType *CreateVar(ArenaAllocator *allocator, util::StringView name, VariableFlags flags,
338 void PropagateBinding(ArenaAllocator *allocator, util::StringView name, Args &&... args);
350 virtual bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
432 explicit Scope(ArenaAllocator *allocator, Scope *parent)
434 decls_(allocator->Adapter()),
435 bindings_(allocator->Adapter()),
436 tsBindings_(allocator),
437 scopesIndex_(allocator->Adapter()),
438 scopeNames_(allocator->Adapter()),
439 allocator_(allocator)
456 bool AddLocal(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
589 explicit VariableScope(ArenaAllocator *allocator, Scope *parent) : Scope(allocator, parent),
590 lexicalVarNameAndTypes_(allocator->Adapter()) {}
595 bool AddVar(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl);
598 bool AddFunction(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
602 bool AddClass(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl);
605 bool AddTSBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, VariableFlags flags);
608 bool AddTSBinding(ArenaAllocator *allocator, Decl *newDecl, VariableFlags flags);
611 bool AddLexical(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl);
647 std::tuple<ParameterDecl *, const ir::AstNode *> AddParamDecl(ArenaAllocator *allocator, const ir::AstNode *param);
650 explicit ParamScope(ArenaAllocator *allocator, Scope *parent)
651 : Scope(allocator, parent), params_(allocator->Adapter())
655 bool AddParam(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl, VariableFlags flags);
664 explicit FunctionParamScope(ArenaAllocator *allocator, Scope *parent) : ParamScope(allocator, parent) {}
681 void BindName(ArenaAllocator *allocator, util::StringView name);
688 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
712 explicit ScopeWithParamScope(ArenaAllocator *allocator, Scope *parent) : E(allocator, parent) {}
756 explicit FunctionScope(ArenaAllocator *allocator, Scope *parent) : ScopeWithParamScope(allocator, parent) {}
791 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
839 explicit LocalScope(ArenaAllocator *allocator, Scope *parent) : Scope(allocator, parent) {}
846 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
852 explicit ClassScope(ArenaAllocator *allocator, Scope *parent)
853 : VariableScope(allocator, parent),
854 computedNames_(allocator->Adapter()),
855 privateNames_(allocator->Adapter()),
856 privateGetters_(allocator->Adapter()),
857 privateSetters_(allocator->Adapter())
881 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
884 return AddLocal(allocator, currentVariable, newDecl, extension);
944 explicit CatchParamScope(ArenaAllocator *allocator, Scope *parent) : ParamScope(allocator, parent) {}
951 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
959 explicit CatchScope(ArenaAllocator *allocator, Scope *parent) : ScopeWithParamScope(allocator, parent) {}
966 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
972 explicit LoopScope(ArenaAllocator *allocator, Scope *parent) : VariableScope(allocator, parent) {}
981 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
984 return AddLocal(allocator, currentVariable, newDecl, extension);
993 explicit StaticBlockScope(ArenaAllocator *allocator, Scope *parent) : VariableScope(allocator, parent) {}
1000 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
1003 return AddLocal(allocator, currentVariable, newDecl, extension);
1012 explicit GlobalScope(ArenaAllocator *allocator) : FunctionScope(allocator, nullptr)
1014 paramScope_ = allocator->New<FunctionParamScope>(allocator, this);
1022 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
1044 explicit ModuleScope(ArenaAllocator *allocator, parser::Program *program) : FunctionScope(allocator, nullptr)
1046 paramScope_ = allocator->New<FunctionParamScope>(allocator, this);
1062 void ConvertLocalVariableToModuleVariable(ArenaAllocator *allocator, util::StringView localName);
1064 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
1089 explicit TSModuleScope(ArenaAllocator *allocator, Scope *parent, ExportBindings *exportBindings)
1090 : FunctionScope(allocator, nullptr), exportBindings_(exportBindings), variableNames_(allocator->Adapter())
1092 paramScope_ = allocator->New<FunctionParamScope>(allocator, parent);
1157 explicit TSEnumScope(ArenaAllocator *allocator, Scope *parent, VariableMap *enumMemberBindings) : FunctionScope(
1158 allocator, nullptr), enumMemberBindings_(enumMemberBindings), variableNames_(allocator->Adapter())
1160 paramScope_ = allocator->New<FunctionParamScope>(allocator, parent);
1191 bool AddBinding(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
1218 bool VariableScope::AddVar(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl)
1224 bindings_.insert({newDecl->Name(), allocator->New<T>(newDecl, flags)});
1246 bool VariableScope::AddFunction(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl,
1253 bindings_.insert({newDecl->Name(), allocator->New<T>(newDecl, flags)});
1260 bindings_[newDecl->Name()] = allocator->New<T>(newDecl, flags);
1283 bool VariableScope::AddClass(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl)
1290 bindings_.insert({newDecl->Name(), allocator->New<T>(newDecl, flags)});
1304 bool VariableScope::AddTSBinding(ArenaAllocator *allocator, [[maybe_unused]] Variable *currentVariable, Decl *newDecl,
1309 bindings_.insert({newDecl->Name(), allocator->New<T>(newDecl, flags)});
1314 bool VariableScope::AddTSBinding(ArenaAllocator *allocator, Decl *newDecl, VariableFlags flags)
1319 newDecl->Name(), allocator->New<T>(newDecl, flags));
1323 newDecl->Name(), allocator->New<T>(newDecl, flags));
1327 newDecl->Name(), allocator->New<T>(newDecl, flags));
1331 newDecl->Name(), allocator->New<T>(newDecl, flags));
1341 bool VariableScope::AddLexical(ArenaAllocator *allocator, Variable *currentVariable, Decl *newDecl)
1349 bindings_.insert({newDecl->Name(), allocator->New<T>(newDecl, flags)});
1354 T *Scope::NewDecl(ArenaAllocator *allocator, Args &&... args)
1356 T *decl = allocator->New<T>(std::forward<Args>(args)...);
1363 VariableType *Scope::AddDecl(ArenaAllocator *allocator, util::StringView name, VariableFlags flags)
1369 auto *decl = allocator->New<DeclType>(name);
1370 auto *variable = allocator->New<VariableType>(decl, flags);
1381 VariableType *Scope::CreateVar(ArenaAllocator *allocator, util::StringView name, VariableFlags flags,
1384 auto *decl = allocator->New<DeclType>(name);
1386 auto *variable = allocator->New<VariableType>(decl, flags);
1393 void Scope::PropagateBinding(ArenaAllocator *allocator, util::StringView name, Args &&... args)
1397 bindings_.insert({name, allocator->New<T>(std::forward<Args>(args)...)});