/arkcompiler/ets_frontend/ets2panda/compiler/core/ |
D | pandagen.h | 38 class AstNode; variable 71 void StoreAccumulator(const ir::AstNode *node, VReg vreg); 72 void LoadAccumulator(const ir::AstNode *node, VReg reg); 74 [[nodiscard]] IRNode *AllocMov(const ir::AstNode *node, VReg vd, VReg vs) override; 75 [[nodiscard]] IRNode *AllocMov(const ir::AstNode *node, OutVReg vd, VReg vs) override; 76 void MoveVreg(const ir::AstNode *node, VReg vd, VReg vs); 78 void LoadAccumulatorDouble(const ir::AstNode *node, double num); 79 void LoadAccumulatorInt(const ir::AstNode *node, size_t num); 81 void LoadConst(const ir::AstNode *node, Constant id); 82 void StoreConst(const ir::AstNode *node, VReg reg, Constant id); [all …]
|
D | ETSGen.h | 46 [[nodiscard]] VReg StoreException(const ir::AstNode *node); 47 …void ApplyConversionAndStoreAccumulator(const ir::AstNode *node, VReg vreg, const checker::Type *t… 48 void StoreAccumulator(const ir::AstNode *node, VReg vreg); 49 void LoadAccumulator(const ir::AstNode *node, VReg vreg); 50 [[nodiscard]] IRNode *AllocMov(const ir::AstNode *node, VReg vd, VReg vs) override; 51 [[nodiscard]] IRNode *AllocMov(const ir::AstNode *node, OutVReg vd, VReg vs) override; 52 void MoveVreg(const ir::AstNode *node, VReg vd, VReg vs); 56 void LoadVar(const ir::AstNode *node, varbinder::Variable const *var); 57 void LoadDynamicModuleVariable(const ir::AstNode *node, varbinder::Variable const *var); 58 void LoadDynamicNamespaceVariable(const ir::AstNode *node, varbinder::Variable const *var); [all …]
|
D | pandagen.cpp | 49 explicit EcmaDisabled(const ir::AstNode *node, [[maybe_unused]] Args &&...args) : IRNode(node) in EcmaDisabled() 332 void PandaGen::StoreAccumulator(const ir::AstNode *node, VReg vreg) in StoreAccumulator() 337 void PandaGen::LoadAccumulator(const ir::AstNode *node, VReg reg) in LoadAccumulator() 342 IRNode *PandaGen::AllocMov(const ir::AstNode *node, const VReg vd, const VReg vs) in AllocMov() 347 IRNode *PandaGen::AllocMov(const ir::AstNode *node, OutVReg vd, const VReg vs) in AllocMov() 353 void PandaGen::MoveVreg(const ir::AstNode *node, VReg vd, VReg vs) in MoveVreg() 358 void PandaGen::LoadAccumulatorDouble(const ir::AstNode *node, double num) in LoadAccumulatorDouble() 363 void PandaGen::LoadAccumulatorInt(const ir::AstNode *node, size_t num) in LoadAccumulatorInt() 368 void PandaGen::StoreConst(const ir::AstNode *node, VReg reg, Constant id) in StoreConst() 374 void PandaGen::LoadConst(const ir::AstNode *node, Constant id) in LoadConst() [all …]
|
/arkcompiler/ets_frontend/es2panda/compiler/core/ |
D | pandagen.h | 39 class AstNode; variable 130 const ir::AstNode *RootNode() const in RootNode() 286 void InitializeLexEnv(const ir::AstNode *node); 287 void CopyFunctionArguments(const ir::AstNode *node); 288 void GetFunctionObject(const ir::AstNode *node); 289 void GetNewTarget(const ir::AstNode *node); 290 void GetThis(const ir::AstNode *node); 291 void SetThis(const ir::AstNode *node); 293 … void StoreVar(const ir::AstNode *node, const binder::ScopeFindResult &result, bool isDeclaration); 295 void StLetOrClassToGlobalRecord(const ir::AstNode *node, const util::StringView &name); [all …]
|
D | pandagen.cpp | 243 void PandaGen::InitializeLexEnv(const ir::AstNode *node) in InitializeLexEnv() 252 void PandaGen::CopyFunctionArguments(const ir::AstNode *node) in CopyFunctionArguments() 265 auto fn = [this](const ir::AstNode *node) { in CopyFunctionArguments() 314 void PandaGen::GetFunctionObject(const ir::AstNode *node) in GetFunctionObject() 319 void PandaGen::GetNewTarget(const ir::AstNode *node) in GetNewTarget() 324 void PandaGen::GetThis(const ir::AstNode *node) in GetThis() 329 void PandaGen::SetThis(const ir::AstNode *node) in SetThis() 367 void PandaGen::StoreVar(const ir::AstNode *node, const binder::ScopeFindResult &result, bool isDecl… in StoreVar() 418 void PandaGen::StoreAccumulator(const ir::AstNode *node, VReg vreg) in StoreAccumulator() 423 void PandaGen::StoreAccumulatorWithType(const ir::AstNode *node, int64_t typeIndex, VReg vreg) in StoreAccumulatorWithType() [all …]
|
/arkcompiler/ets_frontend/ets2panda/ir/ |
D | astNode.cpp | 23 AstNode::AstNode(AstNode const &other) in AstNode() function in panda::es2panda::ir::AstNode 46 ir::BlockStatement *AstNode::GetTopStatement() in GetTopStatement() 51 const ir::BlockStatement *AstNode::GetTopStatement() const in GetTopStatement() 56 void AstNode::TransformChildrenRecursively(const NodeTransformer &cb) in TransformChildrenRecursively() 58 TransformChildren([=](AstNode *child) { in TransformChildrenRecursively() 64 void AstNode::IterateRecursively(const NodeTraverser &cb) const in IterateRecursively() 66 Iterate([=](AstNode *child) { in IterateRecursively() 72 void AnyChildHelper(bool *found, const NodePredicate &cb, AstNode *ast) in AnyChildHelper() 83 ast->Iterate([=](AstNode *child) { AnyChildHelper(found, cb, child); }); in AnyChildHelper() 86 bool AstNode::IsAnyChild(const NodePredicate &cb) const in IsAnyChild() [all …]
|
D | astDump.h | 33 explicit Nullish(const ir::AstNode *node) : node_(node) {} in Nullish() 35 const ir::AstNode *Node() const in Node() 41 const ir::AstNode *node_; 46 using Val = std::variant<const char *, const AstNode *, bool, std::vector<const AstNode *>>; 47 explicit Optional(const ir::AstNode *node) : value_(node) {} in Optional() 54 std::vector<const AstNode *> nodes; in Optional() 87 … bool, char16_t, lexer::Number, const ir::AstNode *, std::vector<const ir::AstNode *>, 97 …Property(const char *key, const ir::AstNode *node) : key_(key), value_(const_cast<ir::AstNode *>(n… in Property() 112 if (std::holds_alternative<const ir::AstNode *>(value) && in Property() 113 (std::get<const ir::AstNode *>(value) != nullptr)) { in Property() [all …]
|
D | astNode.h | 49 class AstNode; variable 52 using NodeTransformer = std::function<AstNode *(AstNode *)>; 53 using NodeTraverser = std::function<void(AstNode *)>; 54 using NodePredicate = std::function<bool(AstNode *)>; 92 class AstNode { in AST_NODE_REINTERPRET_MAPPING() 94 explicit AstNode(AstNodeType type) : type_(type) {}; in AST_NODE_REINTERPRET_MAPPING() 95 explicit AstNode(AstNodeType type, ModifierFlags flags) : type_(type), flags_(flags) {}; in AST_NODE_REINTERPRET_MAPPING() 96 virtual ~AstNode() = default; in AST_NODE_REINTERPRET_MAPPING() 98 AstNode() = delete; in AST_NODE_REINTERPRET_MAPPING() 99 NO_COPY_OPERATOR(AstNode); in AST_NODE_REINTERPRET_MAPPING() [all …]
|
/arkcompiler/ets_frontend/es2panda/typescript/extractor/ |
D | typeExtractor.h | 27 using Getter = std::function<int64_t(const ir::AstNode *, bool isNewInstance)>; 28 using Handler = std::function<void(const ir::AstNode *)>; 45 …const ir::AstNode *GetDeclNodeFromIdentifier(const ir::Identifier *identifier, const ir::Identifie… 49 int64_t GetTypeIndexFromClassInst(int64_t typeIndex, const ir::AstNode *node, 95 void ExtractNodesType(const ir::AstNode *parent); 96 void ExtractNodeType(const ir::AstNode *parent, const ir::AstNode *childNode); 102 …const ir::AstNode *GetDeclNodeFromInitializer(const ir::Expression *initializer, const ir::Identif… 104 int64_t GetTypeIndexFromDeclNode(const ir::AstNode *node, bool isNewInstance); 105 int64_t GetTypeIndexFromIdentifierNode(const ir::AstNode *node, bool isNewInstance); 106 int64_t GetTypeIndexFromClassExpression(const ir::AstNode *node, bool isNewInstance); [all …]
|
/arkcompiler/ets_frontend/ets2panda/public/ |
D | es2panda_lib.cpp | 781 auto *node = reinterpret_cast<ir::AstNode *>(ast); in AstNodeType() 791 auto *node = reinterpret_cast<ir::AstNode *>(ast); in AstNodeDecorators() 803 auto *node = reinterpret_cast<ir::AstNode *>(ast); in AstNodeModifierFlags() 812 auto *node = reinterpret_cast<ir::AstNode *>(ast); in AstNodeSetDecorators() 817 decoratorsVector.push_back(reinterpret_cast<ir::AstNode *>(decorators[i])->AsDecorator()); in AstNodeSetDecorators() 824 auto *node = reinterpret_cast<ir::AstNode *>(ast); in AstNodeSetType() 836 auto *node = reinterpret_cast<ir::AstNode *>(ast); in AstNodeForEach() 838 …node->IterateRecursively([=](ir::AstNode *child) { func(reinterpret_cast<es2panda_AstNode *>(child… in AstNodeForEach() 845 auto *node = reinterpret_cast<ir::AstNode *>(ast); \ 897 auto *func = reinterpret_cast<ir::AstNode *>(scriptFunction)->AsScriptFunction(); in IS() [all …]
|
/arkcompiler/ets_frontend/es2panda/compiler/function/ |
D | functionBuilder.h | 55 virtual void DirectReturn(const ir::AstNode *node) const; 56 virtual void ImplicitReturn(const ir::AstNode *node) const; 57 virtual void ExplicitReturn(const ir::AstNode *node) const; 59 virtual void Await(const ir::AstNode *node); 60 virtual void YieldStar(const ir::AstNode *node); 62 virtual void Yield([[maybe_unused]] const ir::AstNode *node) in Yield() 75 …void SuspendResumeExecution(const ir::AstNode *node, VReg completionType, VReg completionValue) co… 76 …void AsyncYield(const ir::AstNode *node, VReg value, VReg completionType, VReg completionValue) co… 79 void HandleCompletion(const ir::AstNode *node, VReg completionType, VReg completionValue); 87 void resumeGenerator(const ir::AstNode *node, VReg completionType, VReg completionValue) const;
|
/arkcompiler/ets_frontend/ets2panda/checker/ets/ |
D | baseAnalyzer.h | 23 class AstNode; variable 39 const ir::AstNode *node, JumpResolver jumpResolver = [] {}) in DEFINE_BITOPS() 53 const ir::AstNode *Node() const in DEFINE_BITOPS() 59 const ir::AstNode *node_; in DEFINE_BITOPS() 82 LivenessStatus ResolveJump(const ir::AstNode *node, ir::AstNodeType jumpKind); 83 LivenessStatus ResolveContinues(const ir::AstNode *node); 84 LivenessStatus ResolveBreaks(const ir::AstNode *node); 85 const ir::AstNode *GetJumpTarget(const ir::AstNode *node) const;
|
/arkcompiler/ets_frontend/es2panda/ir/ |
D | astDump.h | 33 explicit Nullable(const ir::AstNode *node) : node_(node) {} in Nullable() 35 const ir::AstNode *Node() const in Node() 41 const ir::AstNode *node_; 46 using Val = std::variant<const char *, const ir::AstNode *, bool>; 47 explicit Optional(const ir::AstNode *node) : value_(node) {} in Optional() 74 … double, const ir::AstNode *, std::vector<const ir::AstNode *>, Constant, Nullable, Ignore>; 82 …Property(const char *key, const ir::AstNode *node) : key_(key), value_(const_cast<ir::AstNode *>(n… in Property() 97 … if (std::holds_alternative<const ir::AstNode *>(value) && std::get<const ir::AstNode *>(value)) { in Property() 98 value_ = std::get<const ir::AstNode *>(value); in Property() 123 std::vector<const ir::AstNode *> nodes; in Property() [all …]
|
D | astNode.h | 39 class AstNode; variable 41 using NodeTraverser = std::function<void(AstNode *)>; 43 using UpdateNodes = std::variant<AstNode *, std::vector<AstNode *>>; 44 using NodeUpdater = std::function<UpdateNodes(AstNode *)>; 117 class AstNode { in AST_NODE_REINTERPRET_MAPPING() 119 explicit AstNode(AstNodeType type) : type_(type) {}; in AST_NODE_REINTERPRET_MAPPING() 120 virtual ~AstNode() = default; in AST_NODE_REINTERPRET_MAPPING() 121 NO_COPY_SEMANTIC(AstNode); in AST_NODE_REINTERPRET_MAPPING() 122 NO_MOVE_SEMANTIC(AstNode); in AST_NODE_REINTERPRET_MAPPING() 256 const AstNode *Parent() in AST_NODE_REINTERPRET_MAPPING() [all …]
|
/arkcompiler/ets_frontend/ets2panda/compiler/function/ |
D | functionBuilder.h | 54 virtual void DirectReturn(const ir::AstNode *node) const; 55 virtual void ImplicitReturn(const ir::AstNode *node) const; 57 virtual void Await(const ir::AstNode *node); 58 virtual void YieldStar(const ir::AstNode *node); 60 virtual void Yield([[maybe_unused]] const ir::AstNode *node) in Yield() 73 …void SuspendResumeExecution(const ir::AstNode *node, VReg completionType, VReg completionValue) co… 74 void AsyncYield(const ir::AstNode *node, VReg completionType, VReg completionValue) const; 77 void HandleCompletion(const ir::AstNode *node, VReg completionType, VReg completionValue); 87 void ResumeGenerator(const ir::AstNode *node, VReg completionType, VReg completionValue) const;
|
/arkcompiler/ets_frontend/ets2panda/compiler/base/ |
D | lreference.h | 23 class AstNode; variable 71 const ir::AstNode *Node() const in Node() 93 … std::tuple<CodeGen *, const ir::AstNode *, ReferenceKind, varbinder::ConstScopeFindResult, bool>; 94 static LReferenceBase CreateBase(CodeGen *cg, const ir::AstNode *node, bool isDeclaration); 96 …explicit LReference(const ir::AstNode *node, ReferenceKind refKind, varbinder::ConstScopeFindResul… in LReference() 103 const ir::AstNode *node_; 111 …JSLReference(CodeGen *cg, const ir::AstNode *node, ReferenceKind refKind, varbinder::ConstScopeFin… 120 static JSLReference Create(CodeGen *cg, const ir::AstNode *node, bool isDeclaration) in Create() 134 …ETSLReference(CodeGen *cg, const ir::AstNode *node, ReferenceKind refKind, varbinder::ConstScopeFi… 143 static ETSLReference Create(CodeGen *cg, const ir::AstNode *node, bool isDeclaration);
|
D | lexenv.cpp | 27 static bool CheckTdz(const ir::AstNode *node) in CheckTdz() 32 static void CheckConstAssignment(PandaGen *pg, const ir::AstNode *node, varbinder::Variable *variab… in CheckConstAssignment() 43 static void ExpandLoadLexVar(PandaGen *pg, const ir::AstNode *node, const varbinder::ConstScopeFind… in ExpandLoadLexVar() 52 static void ExpandLoadNormalVar(PandaGen *pg, const ir::AstNode *node, const varbinder::ConstScopeF… in ExpandLoadNormalVar() 63 void VirtualLoadVar::Expand(PandaGen *pg, const ir::AstNode *node, const varbinder::ConstScopeFindR… in Expand() 74 static void StoreLocalExport(PandaGen *pg, const ir::AstNode *node, varbinder::Variable *variable) in StoreLocalExport() 89 static void ExpandStoreLexVar(PandaGen *pg, const ir::AstNode *node, const varbinder::ConstScopeFin… in ExpandStoreLexVar() 109 static void ExpandStoreNormalVar(PandaGen *pg, const ir::AstNode *node, const varbinder::ConstScope… in ExpandStoreNormalVar() 127 void VirtualStoreVar::Expand(PandaGen *pg, const ir::AstNode *node, const varbinder::ConstScopeFind… in Expand()
|
/arkcompiler/ets_frontend/ets2panda/util/ |
D | helpers.h | 47 class AstNode; variable 87 static const ir::ScriptFunction *GetContainingConstructor(const ir::AstNode *node); 92 … std::is_convertible_v<std::remove_const_t<std::remove_pointer_t<T>> *, ir::AstNode *>, 93 …std::conditional_t<std::is_const_v<std::remove_pointer_t<T>>, const ir::AstNode *, ir::AstNode *>>> 110 static const checker::ETSObjectType *GetContainingObjectType(const ir::AstNode *node); 111 static const ir::TSEnumDeclaration *GetContainingEnumDeclaration(const ir::AstNode *node); 112 static const ir::ClassDefinition *GetContainingClassDefinition(const ir::AstNode *node); 113 …static const ir::TSInterfaceDeclaration *GetContainingInterfaceDeclaration(const ir::AstNode *node… 114 static const ir::MethodDefinition *GetContainingClassMethodDefinition(const ir::AstNode *node); 115 static const ir::ClassStaticBlock *GetContainingClassStaticBlock(const ir::AstNode *node); [all …]
|
/arkcompiler/ets_frontend/es2panda/parser/transformer/ |
D | transformer.h | 114 ir::AstNode *VisitTSNodes(ir::AstNode *parent); 115 ir::UpdateNodes VisitTSNode(ir::AstNode *childNode); 117 std::vector<ir::AstNode *> VisitExportNamedVariable(ir::Statement *decl); 118 ir::AstNode *VisitTsImportEqualsDeclaration(ir::TSImportEqualsDeclaration *node); 146 void FindSuperCall(const ir::AstNode *parent, bool *hasSuperCall); 147 void FindSuperCallInCtorChildNode(const ir::AstNode *childNode, bool *hasSuperCall); 151 ir::AstNode *node, 161 std::vector<ir::AstNode *> CreateClassDecorators(ir::ClassDeclaration *node, 162 … const std::vector<ir::AstNode *> &variableDeclarations); 163 std::vector<ir::AstNode *> CreateMethodDecorators(util::StringView className, [all …]
|
/arkcompiler/ets_frontend/ets2panda/parser/ |
D | TypedParser.h | 39 ArenaVector<ir::AstNode *> ParseTypeLiteralOrInterface(); 40 …void CheckObjectTypeForDuplicatedProperties(ir::Expression *key, ArenaVector<ir::AstNode *> &membe… 64 …ir::AstNode *ParseClassElement(const ArenaVector<ir::AstNode *> &properties, ir::ClassDefinitionMo… 68 …static bool CheckClassElementInterfaceBody(ir::AstNode *property, ArenaVector<ir::AstNode *> &prop… 69 bool CheckClassElement(ir::AstNode *property, ir::MethodDefinition *&ctor, 70 ArenaVector<ir::AstNode *> &properties) override; 105 virtual ir::AstNode *ParseTypeLiteralOrInterfaceMember() in ParseTypeLiteralOrInterfaceMember() 115 …virtual ir::AstNode *ParsePropertyOrMethodSignature([[maybe_unused]] const lexer::SourcePosition &… in ParsePropertyOrMethodSignature() 132 virtual void AddDecorators([[maybe_unused]] ir::AstNode *node, in AddDecorators() 149 virtual void CreateCCtor([[maybe_unused]] ArenaVector<ir::AstNode *> &properties,
|
D | ETSparser.h | 67 …ir::Expression *CreateFormattedExpression(std::string_view sourceCode, std::vector<ir::AstNode *> … 74 std::vector<ir::AstNode *> insertingNodes {}; in CreateFormattedExpression() 84 … std::vector<ir::AstNode *> &insertingNodes, 91 std::vector<ir::AstNode *> insertingNodes {}; in CreateFormattedStatements() 103 std::map<util::StringView, ir::AstNode *> fieldMap_; 108 ArenaVector<ir::AstNode *> ParseTopLevelStatements(ArenaVector<ir::Statement *> &statements); 111 …void ParseTopLevelNextToken(ArenaVector<ir::Statement *> &statements, ArenaVector<ir::AstNode *> &… 117 … ArenaVector<ir::AstNode *> &globalProperties, 122 ArenaVector<ir::AstNode *> &globalProperties); 137 void ParseNamedSpecifiers(ArenaVector<ir::AstNode *> *specifiers, bool isExport = false); [all …]
|
/arkcompiler/ets_frontend/ets2panda/varbinder/ |
D | ETSBinder.h | 26 using ComputedLambdaObjects = ArenaMap<const ir::AstNode *, std::pair<ir::ClassDefinition *, checke… 30 const ir::AstNode *specifier; 108 void HandleCustomNodes(ir::AstNode *childNode) override; 124 void AddSpecifiersToTopBindings(ir::AstNode *specifier, const ir::ETSImportDeclaration *import); 127 bool AddImportNamespaceSpecifiersToTopBindings(ir::AstNode *specifier, 132 …bool AddImportSpecifiersToTopBindings(ir::AstNode *specifier, const varbinder::Scope::VariableMap … 141 ir::AstNode *specifier, const ir::ETSImportDeclaration *import, ir::StringLiteral *path, 143 …void AddDynamicSpecifiersToTopBindings(ir::AstNode *specifier, const ir::ETSImportDeclaration *imp… 156 …void BuildLambdaObject(ir::AstNode *refNode, ir::ClassDefinition *lambdaObject, checker::Signature… 159 void BuildLambdaObjectName(const ir::AstNode *refNode); [all …]
|
D | declaration.h | 24 class AstNode; variable 53 ir::AstNode *Node() in DECLARATION_KINDS() 58 const ir::AstNode *Node() const in DECLARATION_KINDS() 82 void BindNode(ir::AstNode *node) in DECLARATION_KINDS() 99 explicit Decl(util::StringView name, ir::AstNode *declNode) : name_(name), node_(declNode) {} in DECLARATION_KINDS() 103 ir::AstNode *node_ {}; in DECLARATION_KINDS() 115 explicit MultiDecl(ArenaAllocator *allocator, util::StringView name, ir::AstNode *declNode) in MultiDecl() 137 explicit EnumLiteralDecl(util::StringView name, ir::AstNode *declNode, bool isConst) in EnumLiteralDecl() 170 explicit InterfaceDecl(ArenaAllocator *allocator, util::StringView name, ir::AstNode *declNode) in InterfaceDecl() 184 explicit ClassDecl(util::StringView name, ir::AstNode *node) : Decl(name, node) {} in ClassDecl() [all …]
|
/arkcompiler/ets_frontend/es2panda/ir/module/ |
D | exportDefaultDeclaration.h | 34 explicit ExportDefaultDeclaration(AstNode *decl, bool exportEquals) in ExportDefaultDeclaration() 39 const AstNode *Decl() const in Decl() 44 AstNode *Decl() in Decl() 49 void SetDecl(AstNode *decl) in SetDecl() 66 AstNode *decl_;
|
/arkcompiler/ets_frontend/ets2panda/ir/ts/ |
D | tsInterfaceBody.h | 24 explicit TSInterfaceBody(ArenaVector<AstNode *> &&body) in TSInterfaceBody() 29 ArenaVector<AstNode *> *BodyPtr() in BodyPtr() 34 ArenaVector<AstNode *> &Body() in Body() 39 const ArenaVector<AstNode *> &Body() const in Body() 59 ArenaVector<AstNode *> body_;
|