/arkcompiler/ets_frontend/ets2panda/compiler/lowering/scopesInit/ |
H A D | scopesInitPhase.cpp | 22 varbinder::LexicalScope<T> LexicalScopeCreateOrEnter(varbinder::VarBinder *varBinder, ir::AstNode *ast) in LexicalScopeCreateOrEnter() 31 T *AddOrGetDecl(varbinder::VarBinder *varBinder, util::StringView name, ir::AstNode *ast, in AddOrGetDecl() 44 program->VarBinder()->InitTopScope(); in Perform() 53 auto const *const curScope = VarBinder()->GetScope(); in VisitScriptFunction() 68 auto localCtx = LexicalScopeCreateOrEnter<varbinder::LocalScopeWithTypeAlias>(VarBinder(), blockStmt); in VisitBlockStatement() 74 ImportDeclarationContext importCtx(VarBinder()); in VisitImportDeclaration() 93 auto typeParamsCtx = varbinder::LexicalScope<varbinder::LocalScope>(VarBinder()); in HandleFunctionSig() 96 auto lexicalScope = varbinder::LexicalScope<varbinder::FunctionParamScope>(VarBinder()); in HandleFunctionSig() 110 auto paramCtx = varbinder::LexicalScope<varbinder::FunctionParamScope>::Enter(VarBinder(), funcParamScope, false); in HandleFunction() 112 auto functionCtx = LexicalScopeCreateOrEnter<varbinder::FunctionScope>(VarBinder(), functio in HandleFunction() [all...] |
H A D | savedBindingsCtx.cpp | 29 for (const auto &[name, variable] : VarBinder()->GetScope()->OrderedBindings(Allocator())) { in BindImportDecl() 37 VarBinder()->GetScope()->AsModuleScope()->AddImportDecl(importDecl, std::move(declList)); in BindImportDecl() 42 if (VarBinder() == nullptr) { in BindExportDecl() 52 if (VarBinder()->GetScope()->Bindings().size() == SavedBindings().size()) { in BindExportDecl() 54 VarBinder()->AddDecl<varbinder::FunctionDecl>(rhs->Start(), VarBinder()->Allocator(), in BindExportDecl() 58 VarBinder()->AddDecl<varbinder::ConstDecl>(rhs->Start(), util::StringView(DEFAULT_EXPORT)); in BindExportDecl() 63 for (const auto &[name, variable] : VarBinder()->GetScope()->Bindings()) { in BindExportDecl() 72 VarBinder()->AddDecl<varbinder::ExportDecl>(variable->Declaration()->Node()->Start(), exportName, name); in BindExportDecl() 76 auto *moduleScope = VarBinder() in BindExportDecl() [all...] |
H A D | savedBindingsCtx.h | 25 explicit SavedBindingsContext(varbinder::VarBinder *varbinder) in SavedBindingsContext() 39 varbinder::VarBinder *VarBinder() const in VarBinder() function in ark::es2panda::compiler::SavedBindingsContext 50 varbinder::VarBinder *varbinder_; 56 explicit ExportDeclarationContext(varbinder::VarBinder *varbinder) : SavedBindingsContext(varbinder) {} in ExportDeclarationContext() 69 explicit ImportDeclarationContext(varbinder::VarBinder *varbinder) : SavedBindingsContext(varbinder) {} in ImportDeclarationContext()
|
/arkcompiler/ets_frontend/ets2panda/varbinder/ |
H A D | varbinder.cpp | 64 void VarBinder::InitTopScope() in InitTopScope() 76 std::tuple<ParameterDecl *, Variable *> VarBinder::AddParamDecl(ir::AstNode *param) in AddParamDecl() 88 void VarBinder::ThrowRedeclaration(const lexer::SourcePosition &pos, const util::StringView &name) const in ThrowRedeclaration() 95 void VarBinder::ThrowUnresolvableVariable(const lexer::SourcePosition &pos, const util::StringView &name) const in ThrowUnresolvableVariable() 102 void VarBinder::ThrowUnresolvableType(const lexer::SourcePosition &pos, const util::StringView &name) const in ThrowUnresolvableType() 109 void VarBinder::ThrowTDZ(const lexer::SourcePosition &pos, const util::StringView &name) const in ThrowTDZ() 116 void VarBinder::ThrowInvalidCapture(const lexer::SourcePosition &pos, const util::StringView &name) const in ThrowInvalidCapture() 123 void VarBinder::ThrowPrivateFieldMismatch(const lexer::SourcePosition &pos, const util::StringView &name) const in ThrowPrivateFieldMismatch() 131 void VarBinder::ThrowError(const lexer::SourcePosition &pos, const std::string_view &msg) const in ThrowError() 139 void VarBinder [all...] |
H A D | varbinder.h | 53 class VarBinder { class 55 explicit VarBinder(ArenaAllocator *allocator) : allocator_(allocator), functionScopes_(allocator_->Adapter()) {} in VarBinder() function in ark::es2panda::ark::es2panda::ark::es2panda::ark::es2panda::varbinder::VarBinder 57 NO_COPY_SEMANTIC(VarBinder); 58 NO_MOVE_SEMANTIC(VarBinder); 59 virtual ~VarBinder() = default; 281 explicit LexicalScope(VarBinder *varbinder, Args &&...args) in LexicalScope() 300 [[nodiscard]] static LexicalScope<T> Enter(VarBinder *varbinder, T *scope, bool checkEval = true) in Enter() 337 explicit LexicalScope(T *scope, VarBinder *varbinder) in LexicalScope() 343 VarBinder *varbinder_ {}; 350 void VarBinder [all...] |
H A D | JSBinder.h | 22 class JSBinder : public VarBinder { 24 explicit JSBinder(ArenaAllocator *allocator) : VarBinder(allocator) {} in JSBinder()
|
H A D | TypedBinder.h | 22 class TypedBinder : public VarBinder { 24 explicit TypedBinder(ArenaAllocator *allocator) : VarBinder(allocator) {} in TypedBinder()
|
H A D | ASBinder.h | 22 class ASBinder : public VarBinder { 24 explicit ASBinder(ArenaAllocator *allocator) : VarBinder(allocator) {} in ASBinder()
|
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/ets/ |
H A D | expandBrackets.cpp | 58 scope = checker->VarBinder()->VarScope() != nullptr ? checker->VarBinder()->VarScope() in ProcessNewArrayInstanceExpression() 59 : checker->VarBinder()->TopScope(); in ProcessNewArrayInstanceExpression() 61 auto expressionCtx = varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), scope); in ProcessNewArrayInstanceExpression() 75 InitScopesPhaseETS::RunExternalNode(blockExpression, checker->VarBinder()); in ProcessNewArrayInstanceExpression() 76 checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(blockExpression, NearestScope(blockExpression)); in ProcessNewArrayInstanceExpression() 90 scope = checker->VarBinder()->VarScope() != nullptr ? checker->VarBinder()->VarScope() in ProcessNewMultiDimArrayInstanceExpression() 91 : checker->VarBinder()->TopScope(); in ProcessNewMultiDimArrayInstanceExpression() 93 auto expressionCtx = varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), scop in ProcessNewMultiDimArrayInstanceExpression() [all...] |
H A D | partialExportClassGen.cpp | 35 if (ctx->checker->VarBinder()->IsGenStdLib()) { in Perform() 47 auto *const savedProg = ctx->checker->VarBinder()->AsETSBinder()->Program(); in Perform() 48 ctx->checker->VarBinder()->AsETSBinder()->SetProgram(program); in Perform() 50 ctx->checker->VarBinder()->AsETSBinder()->SetProgram(savedProg); in Perform()
|
H A D | stringConstructorLowering.cpp | 84 auto exprCtx = varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), scope); in ReplaceStringConstructor() 106 // Run VarBinder for new BlockExpression in ReplaceStringConstructor() 107 InitScopesPhaseETS::RunExternalNode(blockExpr, checker->VarBinder()); in ReplaceStringConstructor() 108 checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(blockExpr, NearestScope(blockExpr)); in ReplaceStringConstructor()
|
H A D | spreadLowering.cpp | 102 varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), NearestScope(node)); in Perform() 109 InitScopesPhaseETS::RunExternalNode(blockExpression, checker->VarBinder()); in Perform() 110 checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(blockExpression, in Perform()
|
H A D | opAssignment.cpp | 218 auto expressionCtx = varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), scope); in HandleOpAssignment() 219 InitScopesPhaseETS::RunExternalNode(loweringResult, ctx->parserProgram->VarBinder()); in HandleOpAssignment() 220 checker->VarBinder()->AsETSBinder()->ResolveReferencesForScopeWithContext(loweringResult, scope); in HandleOpAssignment() 308 auto expressionCtx = varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), scope); in HandleUpdate() 322 InitScopesPhaseETS::RunExternalNode(loweringResult, ctx->checker->VarBinder()); in HandleUpdate() 324 checker->VarBinder()->AsETSBinder()->ResolveReferencesForScopeWithContext(loweringResult, in HandleUpdate()
|
H A D | unionLowering.cpp | 43 static ir::ClassDefinition *GetUnionFieldClass(checker::ETSChecker *checker, varbinder::VarBinder *varbinder) in GetUnionFieldClass() 72 varbinder::VarBinder *varbinder, in CreateUnionFieldClassProperty() 108 static void HandleUnionPropertyAccess(checker::ETSChecker *checker, varbinder::VarBinder *vbind, in HandleUnionPropertyAccess() 189 HandleUnionPropertyAccess(checker, checker->VarBinder(), ast->AsMemberExpression()); in Perform()
|
H A D | stringComparison.cpp | 100 InitScopesPhaseETS::RunExternalNode(expr, ctx->checker->VarBinder()); in ProcessBinaryExpression() 101 checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(parent, NearestScope(parent)); in ProcessBinaryExpression()
|
H A D | bigintLowering.cpp | 44 InitScopesPhaseETS::RunExternalNode(loweringResult, checker->VarBinder()); in CreateBigInt() 45 checker->VarBinder()->AsETSBinder()->ResolveReferencesForScope(loweringResult, NearestScope(loweringResult)); in CreateBigInt()
|
/arkcompiler/ets_frontend/ets2panda/parser/program/ |
H A D | program.h | 35 class VarBinder; 55 Program(ArenaAllocator *allocator, varbinder::VarBinder *varbinder) in Program() 80 const varbinder::VarBinder *VarBinder() const in VarBinder() function in ark::es2panda::ark::es2panda::ark::es2panda::parser::Program 85 varbinder::VarBinder *VarBinder() in VarBinder() function in ark::es2panda::ark::es2panda::ark::es2panda::parser::Program 286 varbinder::VarBinder *varbinder_ {};
|
/arkcompiler/ets_frontend/ets2panda/checker/ets/ |
H A D | dynamic.cpp | 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() 79 scope = checker->VarBinder()->Program()->GlobalClassScope(); in ProcessScopesNode() 81 auto expressionCtx = varbinder::LexicalScope<varbinder::Scope>::Enter(checker->VarBinder(), scope); in ProcessScopesNode() 82 compiler::InitScopesPhaseETS::RunExternalNode(node, checker->VarBinder()); in ProcessScopesNode() 111 if (!DynamicCall::IsByValue(VarBinder()->AsETSBinder(), callee)) { in CreateDynamicCallIntrinsic() 187 if (DynamicCall::IsByValue(VarBinder()->AsETSBinder(), callee)) { in ResolveDynamicCallExpression() 190 const auto callNames = DynamicCall::ResolveCall(VarBinder()->AsETSBinder(), callee); in ResolveDynamicCallExpression() 207 auto prevClass = VarBinder() in ResolveDynamicCallExpression() [all...] |
H A D | utilityTypeHandlers.cpp | 90 const bool isClassDeclaredInCurrentFile = classDefProgram == VarBinder()->Program(); in HandlePartialType() 91 auto *const programToUse = isClassDeclaredInCurrentFile ? VarBinder()->Program() : classDefProgram; in HandlePartialType() 96 isClassDeclaredInCurrentFile || VarBinder()->IsGenStdLib() ? partialClassName : qualifiedClassName; in HandlePartialType() 98 SearchNamesInMultiplePrograms({programToUse, VarBinder()->Program()}, {classNameToFind, partialClassName}); in HandlePartialType() 107 ? VarBinder()->AsETSBinder()->GetGlobalRecordTable() in HandlePartialType() 108 : VarBinder()->AsETSBinder()->GetExternalRecordTable().at(programToUse); in HandlePartialType() 126 VarBinder()->Program()->GlobalScope()->InsertBinding(partialClassDef->Ident()->Name(), in HandlePartialType() 245 const auto classCtx = varbinder::LexicalScope<varbinder::ClassScope>::Enter(VarBinder(), scope); in CreateConstructorForPartialType() 253 ctorFunc->Scope()->Find(varbinder::VarBinder::MANDATORY_PARAM_THIS).variable->SetTsType(partialType); in CreateConstructorForPartialType() 268 varbinder::LexicalScope<varbinder::GlobalScope>::Enter(VarBinder(), classDeclProgra in CreateClassPrototype() [all...] |
/arkcompiler/ets_frontend/ets2panda/test/unit/dynamic/ |
H A D | dynamic_call_test.cpp | 39 program->VarBinder()->SetProgram(program); in ParseExpr() 40 program->VarBinder()->InitTopScope(); in ParseExpr() 118 auto varbinder = prog->VarBinder()->AsETSBinder(); in TEST_F() 139 auto varbinder = prog->VarBinder()->AsETSBinder(); in TEST_F() 159 auto varbinder = program->VarBinder()->AsETSBinder(); in TEST_F() 178 auto varbinder = program->VarBinder()->AsETSBinder(); in TEST_F() 188 auto varbinder = program->VarBinder()->AsETSBinder(); in TEST_F()
|
/arkcompiler/ets_frontend/ets2panda/test/unit/ |
H A D | union_normalization_test.cpp | 97 template <typename Parser, typename VarBinder, typename Checker, typename Analyzer, typename AstCompiler, 123 auto *varbinder = program->VarBinder(); in InitializeChecker() 217 auto *const baseType = FindClassType(program->VarBinder()->AsETSBinder(), "Base"); in TEST_F() 248 auto *const baseType = FindClassType(program->VarBinder()->AsETSBinder(), "Base"); in TEST_F() 304 auto *const baseType = FindClassType(program->VarBinder()->AsETSBinder(), "Base"); in TEST_F() 342 auto *const baseType = FindClassType(program->VarBinder()->AsETSBinder(), "Base"); in TEST_F() 344 auto *const derived1Type = FindClassType(program->VarBinder()->AsETSBinder(), "Derived1"); in TEST_F() 346 auto *const derived2Type = FindClassType(program->VarBinder()->AsETSBinder(), "Derived2"); in TEST_F() 419 auto *varbinder = program->VarBinder()->AsETSBinder(); in TEST_F() 422 auto *const derived1Type = FindClassType(program->VarBinder() in TEST_F() [all...] |
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/ |
H A D | checkerPhase.cpp | 23 ctx->checker->StartChecker(ctx->parserProgram->VarBinder(), ctx->config->options->CompilerOptions()); in Perform()
|
/arkcompiler/ets_frontend/ets2panda/checker/ |
H A D | ASchecker.cpp | 21 bool ASChecker::StartChecker([[maybe_unused]] varbinder::VarBinder *varbinder, const CompilerOptions &options) in StartChecker()
|
H A D | checker.h | 37 class VarBinder; 161 virtual bool StartChecker([[maybe_unused]] varbinder::VarBinder *varbinder, const CompilerOptions &options) = 0; 199 varbinder::VarBinder *VarBinder() const; 207 void Initialize(varbinder::VarBinder *varbinder); 219 varbinder::VarBinder *varbinder_ {};
|
H A D | JSchecker.cpp | 23 bool JSChecker::StartChecker([[maybe_unused]] varbinder::VarBinder *varbinder, const CompilerOptions &options) in StartChecker()
|