Home
last modified time | relevance | path

Searched full:varbinder (Results 1 – 25 of 305) sorted by relevance

12345678910>>...13

/arkcompiler/ets_frontend/ets2panda/compiler/lowering/scopesInit/
DsavedBindingsCtx.h19 #include "varbinder/varbinder.h"
25 explicit SavedBindingsContext(varbinder::VarBinder *varbinder) in SavedBindingsContext() argument
26 : varbinder_(varbinder), savedBindings_(varbinder_->GetScope()->Bindings()) in SavedBindingsContext()
39 varbinder::VarBinder *VarBinder() const in VarBinder() function
44 const varbinder::Scope::VariableMap &SavedBindings() const in SavedBindings()
50 varbinder::VarBinder *varbinder_;
51 varbinder::Scope::VariableMap savedBindings_;
56 …explicit ExportDeclarationContext(varbinder::VarBinder *varbinder) : SavedBindingsContext(varbinde… in ExportDeclarationContext() argument
69 …explicit ImportDeclarationContext(varbinder::VarBinder *varbinder) : SavedBindingsContext(varbinde… in ImportDeclarationContext() argument
DscopesInitPhase.cpp23 varbinder::LexicalScope<T> LexicalScopeCreateOrEnter(varbinder::VarBinder *varBinder, ir::AstNode *… in LexicalScopeCreateOrEnter() argument
26 return varbinder::LexicalScope<T>::Enter(varBinder, reinterpret_cast<T *>(ast->Scope())); in LexicalScopeCreateOrEnter()
28 return varbinder::LexicalScope<T>(varBinder); in LexicalScopeCreateOrEnter()
32 T *AddOrGetDecl(varbinder::VarBinder *varBinder, util::StringView name, ir::AstNode *ast, in AddOrGetDecl() argument
39 …if (auto *var = varBinder->GetScope()->FindLocal(name, varbinder::ResolveBindingOptions::BINDINGS); in AddOrGetDecl()
44 return varBinder->AddDecl<T>(pos, args...); in AddOrGetDecl()
50 program->VarBinder()->InitTopScope(); in Perform()
59 auto const *const curScope = VarBinder()->GetScope(); in VisitScriptFunction()
62 …curScope->Find(functionName, scriptFunction->IsStatic() ? varbinder::ResolveBindingOptions::ALL_ST… in VisitScriptFunction()
63 … : varbinder::ResolveBindingOptions::ALL_NON_STATIC); in VisitScriptFunction()
[all …]
DsavedBindingsCtx.cpp27 varbinder::ModuleScope::ImportDeclList declList(Allocator()->Adapter()); in BindImportDecl()
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()
46 varbinder::ModuleScope::ExportDeclList declList(Allocator()->Adapter()); in BindExportDecl()
52 if (VarBinder()->GetScope()->Bindings().size() == SavedBindings().size()) { in BindExportDecl()
54VarBinder()->AddDecl<varbinder::FunctionDecl>(rhs->Start(), VarBinder()->Allocator(), in BindExportDecl()
58VarBinder()->AddDecl<varbinder::ConstDecl>(rhs->Start(), util::StringView(DEFAULT_EXPORT)); in BindExportDecl()
63 for (const auto &[name, variable] : VarBinder()->GetScope()->Bindings()) { in BindExportDecl()
70 variable->AddFlag(varbinder::VariableFlags::LOCAL_EXPORT); in BindExportDecl()
[all …]
DscopesInitPhase.h22 #include "varbinder/tsBinding.h"
23 #include "varbinder/ETSBinder.h"
128 varbinder::Scope *GetScope() in GetScope()
130 return VarBinder()->GetScope(); in GetScope()
153 [[nodiscard]] varbinder::VarBinder *VarBinder() const in VarBinder() function
155 return program_->VarBinder(); in VarBinder()
162 varbinder::FunctionParamScope *HandleFunctionSig(ir::TSTypeParameterDeclaration *typeParams,
169 void HandleBlockStmt(ir::BlockStatement *block, varbinder::Scope *scope);
172 …void HandleFor(varbinder::LoopDeclarationScope *declScope, varbinder::LoopScope *loopScope, ForT *… in HandleFor()
180 virtual varbinder::Decl *BindClassName(ir::ClassDefinition *classDef);
[all …]
/arkcompiler/ets_frontend/ets2panda/evaluate/
DvarbinderScopes.h20 #include "varbinder/ETSBinder.h"
21 #include "varbinder/recordTable.h"
25 // This scope must be used before running VarBinder or Checker on nodes from another Program.
28 explicit ProgramScope(varbinder::ETSBinder *varBinder, parser::Program *program) in ProgramScope() argument
29 : varBinder_(varBinder), in ProgramScope()
30 prevProgram_(varBinder->Program()), in ProgramScope()
31 prevRecordTable_(varBinder->GetRecordTable()), in ProgramScope()
32 prevTopScope_(varBinder->TopScope()), in ProgramScope()
33 prevVarScope_(varBinder->VarScope()), in ProgramScope()
34 prevScope_(varBinder->GetScope()) in ProgramScope()
[all …]
Dhelpers.h22 #include "varbinder/ETSBinder.h"
53 explicit SafeStateScope(checker::ETSChecker *checker, varbinder::ETSBinder *varBinder);
65 varbinder::ETSBinder *varBinder_ {nullptr};
66 varbinder::Scope *checkerScope_ {nullptr};
67 varbinder::GlobalScope *binderTopScope_ {nullptr};
68 varbinder::VariableScope *binderVarScope_ {nullptr};
69 varbinder::Scope *binderScope_ {nullptr};
71 varbinder::RecordTable *recordTable_ {nullptr};
131 void DoScopedAction(checker::ETSChecker *checker, varbinder::ETSBinder *varBinder, parser::Program … in DoScopedAction() argument
132 varbinder::Scope *scope, ir::AstNode *parentClass, F &&action) in DoScopedAction()
[all …]
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/
Dutil.h19 #include "varbinder/ETSBinder.h"
29 varbinder::Scope *NearestScope(const ir::AstNode *ast);
34 ArenaSet<varbinder::Variable *> FindCaptured(ArenaAllocator *allocator, ir::AstNode *scopeBearer) n…
37 // Rerun varbinder on the node.
38 varbinder::Scope *Rebind(PhaseManager *phaseManager, varbinder::ETSBinder *varBinder, ir::AstNode *…
39 // Rerun varbinder and checker on the node.
40 void Recheck(PhaseManager *phaseManager, varbinder::ETSBinder *varBinder, checker::ETSChecker *chec…
46 // Note: run varbinder and checker on the new node generated in lowering phases
47 void CheckLoweredNode(varbinder::ETSBinder *varBinder, checker::ETSChecker *checker, ir::AstNode *n…
DresolveIdentifiers.cpp18 #include "varbinder/ETSBinder.h"
25 auto *varbinder = ctx->parserProgram->VarBinder()->AsETSBinder(); in Perform() local
28 std::cout << varbinder->Program()->Dump() << std::endl; in Perform()
32 varbinder->Program()->DumpSilent(); in Perform()
39 varbinder->SetGenStdLib(options->GetCompilationMode() == CompilationMode::GEN_STD_LIB); in Perform()
40 varbinder->IdentifierAnalysis(); in Perform()
Dutil.cpp31 varbinder::Scope *NearestScope(const ir::AstNode *ast) in NearestScope()
104 ArenaSet<varbinder::Variable *> FindCaptured(ArenaAllocator *allocator, ir::AstNode *scopeBearer) n… in FindCaptured()
106 auto result = ArenaSet<varbinder::Variable *> {allocator->Adapter()}; in FindCaptured()
107 auto scopes = ArenaSet<varbinder::Scope *> {allocator->Adapter()}; in FindCaptured()
122 if (var == nullptr || !var->HasFlag(varbinder::VariableFlags::LOCAL)) { in FindCaptured()
186 // Rerun varbinder on the node. (First clear typesVariables and scopes)
187 varbinder::Scope *Rebind(PhaseManager *phaseManager, varbinder::ETSBinder *varBinder, ir::AstNode *… in Rebind() argument
203 varBinder->CleanUp(); in Rebind()
205 phase->Apply(varBinder->GetContext(), program); in Rebind()
208 return varBinder->TopScope(); in Rebind()
[all …]
/arkcompiler/ets_frontend/ets2panda/varbinder/
Dvarbinder.h20 #include "varbinder/scope.h"
51 namespace ark::es2panda::varbinder {
54 class VarBinder {
56 …explicit VarBinder(ArenaAllocator *allocator) : allocator_(allocator), functionScopes_(allocator_-… in VarBinder() function
58 VarBinder() = delete;
59 NO_COPY_SEMANTIC(VarBinder);
60 NO_MOVE_SEMANTIC(VarBinder);
61 virtual ~VarBinder() = default;
73 …std::tuple<T *, varbinder::Variable *> NewVarDecl(const lexer::SourcePosition &pos, Args &&...args…
255 void BuildForInOfLoop(varbinder::LoopScope *loopScope, ir::AstNode *left, ir::Expression *right,
[all …]
DJSBinder.h19 #include "varbinder/varbinder.h"
21 namespace ark::es2panda::varbinder {
22 class JSBinder : public VarBinder {
24 explicit JSBinder(ArenaAllocator *allocator) : VarBinder(allocator) {} in JSBinder()
31 } // namespace ark::es2panda::varbinder
DTypedBinder.h19 #include "varbinder/varbinder.h"
21 namespace ark::es2panda::varbinder {
22 class TypedBinder : public VarBinder {
24 explicit TypedBinder(ArenaAllocator *allocator) : VarBinder(allocator) {} in TypedBinder()
35 } // namespace ark::es2panda::varbinder
DASBinder.h19 #include "varbinder/varbinder.h"
21 namespace ark::es2panda::varbinder {
22 class ASBinder : public VarBinder {
24 explicit ASBinder(ArenaAllocator *allocator) : VarBinder(allocator) {} in ASBinder()
43 } // namespace ark::es2panda::varbinder
Dvarbinder.cpp16 #include "varbinder.h"
19 namespace ark::es2panda::varbinder { namespace
20 void VarBinder::InitTopScope() in InitTopScope()
31 Variable *VarBinder::AddParamDecl(ir::Expression *param) in AddParamDecl()
45 void VarBinder::ThrowRedeclaration(const lexer::SourcePosition &pos, const util::StringView &name, in ThrowRedeclaration()
61 void VarBinder::ThrowLocalRedeclaration(const lexer::SourcePosition &pos, const util::StringView &c… in ThrowLocalRedeclaration()
66 void VarBinder::ThrowUnresolvableType(const lexer::SourcePosition &pos, const util::StringView &nam… in ThrowUnresolvableType()
71 void VarBinder::ThrowTDZ(const lexer::SourcePosition &pos, const util::StringView &name) const in ThrowTDZ()
76 void VarBinder::ThrowInvalidCapture(const lexer::SourcePosition &pos, const util::StringView &name)… in ThrowInvalidCapture()
81 void VarBinder::ThrowPrivateFieldMismatch(const lexer::SourcePosition &pos, const util::StringView … in ThrowPrivateFieldMismatch()
[all …]
/arkcompiler/ets_frontend/ets2panda/checker/
DTSchecker.h20 #include "varbinder/enumMemberResult.h"
32 namespace ark::es2panda::varbinder {
33 class VarBinder; variable
40 } // namespace ark::es2panda::varbinder
259 …bool StartChecker([[maybe_unused]] varbinder::VarBinder *varbinder, const util::Options &options) …
283 bool IsVariableUsedInConditionBody(ir::AstNode *parent, varbinder::Variable *searchVar);
284 bool FindVariableInBinaryExpressionChain(ir::AstNode *parent, varbinder::Variable *searchVar);
285 bool IsVariableUsedInBinaryExpressionChain(ir::AstNode *parent, varbinder::Variable *searchVar);
294 void GetTypeVar(varbinder::Decl *decl);
295 void GetTypeParam(varbinder::Variable *var, varbinder::Decl *decl);
[all …]
DJSchecker.cpp18 #include "varbinder/varbinder.h"
24 bool JSChecker::StartChecker([[maybe_unused]] varbinder::VarBinder *varbinder, const util::Options … in StartChecker() argument
26 Initialize(varbinder); in StartChecker()
27 varbinder->IdentifierAnalysis(); in StartChecker()
/arkcompiler/ets_frontend/ets2panda/compiler/core/
DenvScope.h19 #include "varbinder/scope.h"
35 explicit ScopeContext(CodeGen *cg, varbinder::Scope *newScope);
43 varbinder::Scope *prevScope_;
78 explicit LoopEnvScope(PandaGen *pg, varbinder::LoopScope *scope, LabelTarget target) in LoopEnvScope()
81 CopyBindings(pg, scope, varbinder::VariableFlags::PER_ITERATION); in LoopEnvScope()
84 explicit LoopEnvScope(PandaGen *pg, LabelTarget target, varbinder::LoopScope *scope) in LoopEnvScope()
87 CopyBindings(pg, scope, varbinder::VariableFlags::PER_ITERATION); in LoopEnvScope()
90 explicit LoopEnvScope(PandaGen *pg, varbinder::LoopDeclarationScope *scope) in LoopEnvScope()
93 CopyBindings(pg, scope, varbinder::VariableFlags::LOOP_DECL);
96 varbinder::VariableScope *Scope() const in Scope()
[all …]
/arkcompiler/ets_frontend/ets2panda/parser/program/
Dprogram.h25 #include "varbinder/varbinder.h"
35 namespace ark::es2panda::varbinder {
36 class VarBinder; variable
38 } // namespace ark::es2panda::varbinder
75 static Program NewProgram(ArenaAllocator *allocator, varbinder::VarBinder *varBinder = nullptr)
77 if (varBinder == nullptr) {
81 return Program(allocator, varBinder);
84 Program(ArenaAllocator *allocator, varbinder::VarBinder *varbinder);
101 const varbinder::VarBinder *VarBinder() const in VarBinder() function
106 varbinder::VarBinder *VarBinder() in VarBinder() function
[all …]
Dprogram.cpp22 #include "varbinder/varbinder.h"
23 #include "varbinder/ETSBinder.h"
30 Program::Program(ArenaAllocator *allocator, varbinder::VarBinder *varbinder) in Program() argument
32 varbinder_(varbinder), in Program()
35 extension_(varbinder != nullptr ? varbinder->Extension() : ScriptExtension::INVALID), in Program()
44 return VarBinder()->GetContext()->config->options->GetCompilationMode() == in IsGenAbcForExternal()
61 varbinder::ClassScope *Program::GlobalClassScope() in GlobalClassScope()
68 const varbinder::ClassScope *Program::GlobalClassScope() const in GlobalClassScope()
75 varbinder::GlobalScope *Program::GlobalScope() in GlobalScope()
78 return static_cast<varbinder::GlobalScope *>(ast_->Scope()); in GlobalScope()
[all …]
/arkcompiler/ets_frontend/ets2panda/test/unit/dynamic/
Ddynamic_call_test.cpp40 …Allocator()->New<parser::Program>(Allocator(), Allocator()->New<varbinder::ETSBinder>(Allocator())… in ParseExpr()
41 program->VarBinder()->SetProgram(program); in ParseExpr()
42 program->VarBinder()->InitTopScope(); in ParseExpr()
85 …void AddDynImport(const char *specifierName, varbinder::ETSBinder *varbinder, ir::Identifier *node) in AddDynImport() argument
94 compiler::InitScopesPhaseETS::RunExternalNode(importDecl, varbinder); in AddDynImport()
95 varbinder->BuildImportDeclaration(importDecl); in AddDynImport()
96 auto var = varbinder->TopScope()->Find(specifierName); in AddDynImport()
119 auto varbinder = prog->VarBinder()->AsETSBinder(); in TEST_F() local
121 // With empty varbinder A is local variable in TEST_F()
122 auto [finalObj, callName] = checker::DynamicCall::ResolveCall(varbinder, obj); in TEST_F()
[all …]
/arkcompiler/ets_frontend/ets2panda/compiler/lowering/ets/
DunionLowering.cpp20 #include "varbinder/ETSBinder.h"
47 …ir::ClassDefinition *GetUnionAccessClass(public_lib::Context *ctx, varbinder::VarBinder *varbinder, in GetUnionAccessClass() argument
53 …if (auto foundVar = checker->Scope()->FindLocal(util::StringView(name), varbinder::ResolveBindingO… in GetUnionAccessClass()
59 auto [decl, var] = varbinder->NewVarDecl<varbinder::ClassDecl>(ident->Start(), ident->Name()); in GetUnionAccessClass()
62 auto classCtx = varbinder::LexicalScope<varbinder::ClassScope>(varbinder); in GetUnionAccessClass()
72 varbinder->AsETSBinder()->BuildClassDefinition(classDef); in GetUnionAccessClass()
74 auto globalBlock = varbinder->Program()->Ast(); in GetUnionAccessClass()
81 static std::tuple<varbinder::LocalVariable *, checker::Signature *> CreateNamedAccessMethod( in CreateNamedAccessMethod()
82 public_lib::Context *ctx, varbinder::VarBinder *varbinder, ir::MemberExpression *expr, in CreateNamedAccessMethod() argument
89 auto *const accessClass = GetUnionAccessClass(ctx, varbinder, GetAccessClassName(unionType)); in CreateNamedAccessMethod()
[all …]
DboxingForLocals.cpp25 static ArenaSet<varbinder::Variable *> FindCaptured(public_lib::Context *ctx, ir::ScriptFunction *f… in FindCaptured()
28 auto captured = ArenaSet<varbinder::Variable *>(allocator->Adapter()); in FindCaptured()
31 auto innermostArrowScopes = ArenaSet<varbinder::Scope *>(allocator->Adapter()); in FindCaptured()
38 auto savedScopes = ArenaSet<varbinder::Scope *>(allocator->Adapter()); in FindCaptured()
78 auto varsToBox = ArenaSet<varbinder::Variable *>(allocator->Adapter()); in FindCaptured()
82 static ArenaSet<varbinder::Variable *> FindModified(public_lib::Context *ctx, ir::ScriptFunction *f… in FindModified()
85 auto modified = ArenaSet<varbinder::Variable *>(allocator->Adapter()); in FindModified()
96 var->AddFlag(varbinder::VariableFlags::INITIALIZED); in FindModified()
105 static ArenaSet<varbinder::Variable *> FindVariablesToBox(public_lib::Context *ctx, ir::ScriptFunct… in FindVariablesToBox()
111 auto varsToBox = ArenaSet<varbinder::Variable *>(allocator->Adapter()); in FindVariablesToBox()
[all …]
/arkcompiler/ets_frontend/ets2panda/checker/types/ts/
DenumType.h22 namespace ark::es2panda::varbinder {
24 } // namespace ark::es2panda::varbinder
29 EnumType(varbinder::Variable *enumLiteralVar, varbinder::EnumVariable *enumVar) in EnumType()
34 const varbinder::Variable *EnumLiteralVar() const in EnumLiteralVar()
39 const varbinder::EnumVariable *EnumVar() const in EnumVar()
51 varbinder::Variable *enumLiteralVar_;
52 varbinder::EnumVariable *enumVar_;
/arkcompiler/ets_frontend/ets2panda/public/
DignoredAllowed.yaml30 - name: VarBinder
33 namespace: varbinder
51 - name: VarBinder
73 - name: VarBinder
75 namespace: varbinder
79 namespace: varbinder
84 namespace: varbinder
86 namespace: varbinder
88 namespace: varbinder
153 namespace: varbinder
[all …]
/arkcompiler/ets_frontend/ets2panda/compiler/base/
Dlreference.h19 #include "varbinder/scope.h"
66 varbinder::Variable *Variable() const in Variable()
76 varbinder::ConstScopeFindResult &Result() in Result()
81 const varbinder::ConstScopeFindResult &Result() const in Result()
93 … std::tuple<CodeGen *, const ir::AstNode *, ReferenceKind, varbinder::ConstScopeFindResult, bool>;
96 …explicit LReference(const ir::AstNode *node, ReferenceKind refKind, varbinder::ConstScopeFindResul… in LReference()
105 varbinder::ConstScopeFindResult res_;
111 …JSLReference(CodeGen *cg, const ir::AstNode *node, ReferenceKind refKind, varbinder::ConstScopeFin…
134 …ETSLReference(CodeGen *cg, const ir::AstNode *node, ReferenceKind refKind, varbinder::ConstScopeFi…
144 static ReferenceKind ResolveReferenceKind(const varbinder::Variable *variable);

12345678910>>...13