Home
last modified time | relevance | path

Searched refs:pg (Results 1 – 25 of 360) sorted by relevance

12345678910>>...15

/arkcompiler/ets_frontend/es2panda/compiler/core/
Dfunction.cpp46 static void CompileSourceBlock(PandaGen *pg, const ir::BlockStatement *block) in CompileSourceBlock() argument
51 pg->SetFirstStmt(statements.empty() ? block : statements.front()); in CompileSourceBlock()
54 stmt->Compile(pg); in CompileSourceBlock()
69 pg->ImplicitReturn(associatedNode); in CompileSourceBlock()
72 static void CompileFunctionParameterDeclaration(PandaGen *pg, const ir::ScriptFunction *func) in CompileFunctionParameterDeclaration() argument
74 ScopeContext scopeCtx(pg, func->Scope()->ParamScope()); in CompileFunctionParameterDeclaration()
83 LReference ref = LReference::CreateLRef(pg, param, true); in CompileFunctionParameterDeclaration()
88 util::StringView name = util::Helpers::ToStringView(pg->Allocator(), index); in CompileFunctionParameterDeclaration()
89 paramVar = pg->Scope()->FindLocal(name, binder::ResolveBindingOptions::BINDINGS); in CompileFunctionParameterDeclaration()
99 RegScope rs(pg); in CompileFunctionParameterDeclaration()
[all …]
/arkcompiler/ets_frontend/ts2panda/src/function/
DasyncGeneratorFunctionBuilder.ts59 let pg = this.pg;
62 pg.createAsyncGeneratorObj(node, getVregisterCache(pg, CacheList.FUNC));
63 pg.storeAccumulator(node, this.funcObj);
65 pg.label(node, this.beginLabel);
66 pg.loadAccumulator(node, getVregisterCache(pg, CacheList.UNDEFINED));
67 pg.suspendGenerator(node, this.funcObj);
68 pg.resumeGenerator(node, this.funcObj);
69 pg.storeAccumulator(node, this.resumeVal);
79 let pg = this.pg;
80 pg.storeAccumulator(node, this.resumeVal);
[all …]
DfunctionBuilder.ts34 protected pg: PandaGen | undefined = undefined; property in FunctionBuilder
41 constructor(pg: PandaGen) {
42 this.pg = pg;
54 let pg = this.pg;
57 pg.asyncFunctionAwaitUncaught(node, this.funcObj);
58 pg.suspendGenerator(node, this.funcObj);
60 pg.resumeGenerator(node, this.funcObj);
61 pg.storeAccumulator(node, this.resumeVal);
65 let pg = this.pg;
66 pg.resumeGenerator(node, this.funcObj);
[all …]
/arkcompiler/ets_frontend/es2panda/compiler/base/
Ddestructuring.cpp32 static void GenRestElement(PandaGen *pg, const ir::SpreadElement *restElement, in GenRestElement() argument
35 VReg array = pg->AllocReg(); in GenRestElement()
36 VReg index = pg->AllocReg(); in GenRestElement()
38 auto *next = pg->AllocLabel(); in GenRestElement()
39 auto *done = pg->AllocLabel(); in GenRestElement()
44 LReference lref = LReference::CreateLRef(pg, restElement, isDeclaration); in GenRestElement()
47 pg->CreateEmptyArray(restElement); in GenRestElement()
48 pg->StoreAccumulator(restElement, array); in GenRestElement()
51 pg->LoadAccumulatorInt(restElement, 0); in GenRestElement()
52 pg->StoreAccumulator(restElement, index); in GenRestElement()
[all …]
Dliterals.cpp27 void Literals::GetTemplateObject(PandaGen *pg, const ir::TaggedTemplateExpression *lit) in GetTemplateObject() argument
29 RegScope rs(pg); in GetTemplateObject()
30 VReg templateArg = pg->AllocReg(); in GetTemplateObject()
31 VReg indexReg = pg->AllocReg(); in GetTemplateObject()
32 VReg rawArr = pg->AllocReg(); in GetTemplateObject()
33 VReg cookedArr = pg->AllocReg(); in GetTemplateObject()
37 pg->CreateEmptyArray(templateLit); in GetTemplateObject()
38 pg->StoreAccumulator(templateLit, rawArr); in GetTemplateObject()
40 pg->CreateEmptyArray(templateLit); in GetTemplateObject()
41 pg->StoreAccumulator(templateLit, cookedArr); in GetTemplateObject()
[all …]
Dcondition.cpp24 void Condition::Compile(PandaGen *pg, const ir::Expression *expr, Label *falseLabel) in Compile() argument
43 RegScope rs(pg); in Compile()
44 VReg lhs = pg->AllocReg(); in Compile()
46 binExpr->Left()->Compile(pg); in Compile()
47 pg->StoreAccumulator(binExpr, lhs); in Compile()
48 binExpr->Right()->Compile(pg); in Compile()
49 pg->Condition(binExpr, binExpr->OperatorType(), lhs, falseLabel); in Compile()
53 binExpr->Left()->Compile(pg); in Compile()
54 pg->BranchIfFalse(binExpr, falseLabel); in Compile()
56 binExpr->Right()->Compile(pg); in Compile()
[all …]
Dlexenv.cpp34 static void CheckConstAssignment(PandaGen *pg, const ir::AstNode *node, binder::Variable *variable) in CheckConstAssignment() argument
40 pg->ThrowConstAssignment(node, variable->Name()); in CheckConstAssignment()
45 static void ExpandLoadLexVar(PandaGen *pg, const ir::AstNode *node, const binder::ScopeFindResult &… in ExpandLoadLexVar() argument
47pg->LoadLexicalVar(node, result.lexLevel, result.variable->AsLocalVariable()->LexIdx(), result.var… in ExpandLoadLexVar()
50 pg->ThrowUndefinedIfHole(node, result.variable->Name()); in ExpandLoadLexVar()
54 static void ExpandLoadNormalVar(PandaGen *pg, const ir::AstNode *node, const binder::ScopeFindResul… in ExpandLoadNormalVar() argument
59 pg->LoadConst(node, Constant::JS_HOLE); in ExpandLoadNormalVar()
60 pg->ThrowUndefinedIfHole(node, local->Name()); in ExpandLoadNormalVar()
62 pg->LoadAccumulator(node, local->Vreg()); in ExpandLoadNormalVar()
66 void VirtualLoadVar::Expand(PandaGen *pg, const ir::AstNode *node, const binder::ScopeFindResult &r… in Expand() argument
[all …]
Dhoisting.cpp27 static void StoreModuleVarOrLocalVar(PandaGen *pg, binder::ScopeFindResult &result, const binder::D… in StoreModuleVarOrLocalVar() argument
30 ASSERT(pg->Scope()->IsModuleScope()); in StoreModuleVarOrLocalVar()
31 auto *var = pg->Scope()->FindLocal(decl->Name()); in StoreModuleVarOrLocalVar()
33 pg->StoreModuleVariable(decl->Node(), var->AsModuleVariable()); in StoreModuleVarOrLocalVar()
35 pg->StoreAccToLexEnv(decl->Node(), result, true); in StoreModuleVarOrLocalVar()
39 static void HoistVar(PandaGen *pg, binder::Variable *var, const binder::VarDecl *decl) in HoistVar() argument
45 auto *scope = pg->Scope(); in HoistVar()
47 pg->LoadConst(decl->Node(), Constant::JS_UNDEFINED); in HoistVar()
48 pg->StoreGlobalVar(decl->Node(), decl->Name()); in HoistVar()
59 pg->LoadConst(decl->Node(), Constant::JS_UNDEFINED); in HoistVar()
[all …]
Dlreference.cpp34 LReference::LReference(const ir::AstNode *node, PandaGen *pg, bool isDeclaration, ReferenceKind ref… in LReference() argument
36 : node_(node), pg_(pg), refKind_(refKind), res_(res), isDeclaration_(isDeclaration) in LReference()
99 LReference LReference::CreateLRef(PandaGen *pg, const ir::AstNode *node, bool isDeclaration) in CreateLRef() argument
104 binder::ScopeFindResult res = pg->Scope()->Find(name); in CreateLRef()
106 return {node, pg, isDeclaration, ReferenceKind::VAR_OR_GLOBAL, res}; in CreateLRef()
109 return {node, pg, false, ReferenceKind::MEMBER, {}}; in CreateLRef()
113 … return LReference::CreateLRef(pg, node->AsVariableDeclaration()->Declarators()[0]->Id(), true); in CreateLRef()
116 return LReference::CreateLRef(pg, node->AsVariableDeclarator()->Id(), true); in CreateLRef()
122 return {node, pg, isDeclaration, ReferenceKind::DESTRUCTURING, {}}; in CreateLRef()
125 return LReference::CreateLRef(pg, node->AsAssignmentPattern()->Left(), true); in CreateLRef()
[all …]
/arkcompiler/ets_frontend/es2panda/ir/statements/
DtryStatement.cpp48 void TryStatement::CompileFinally(compiler::PandaGen *pg, compiler::TryContext *tryCtx, in CompileFinally() argument
51 compiler::RegScope rs(pg); in CompileFinally()
52 compiler::VReg exception = pg->AllocReg(); in CompileFinally()
53 pg->StoreConst(this, exception, compiler::Constant::JS_HOLE); in CompileFinally()
54 pg->Branch(this, labelSet.CatchEnd()); in CompileFinally()
56 pg->SetLabel(this, labelSet.CatchBegin()); in CompileFinally()
57 pg->StoreAccumulator(this, exception); in CompileFinally()
59 pg->SetLabel(this, labelSet.CatchEnd()); in CompileFinally()
61 compiler::Label *label = pg->AllocLabel(); in CompileFinally()
62 pg->LoadAccumulator(this, tryCtx->FinalizerRun()); in CompileFinally()
[all …]
DforInStatement.cpp43 void ForInStatement::Compile(compiler::PandaGen *pg) const in Compile()
46 pg->NewLexEnv(this, scope_->LexicalSlots()); in Compile()
49 compiler::LocalRegScope loopRegScope(pg, scope_); in Compile()
50 compiler::VReg iter = pg->AllocReg(); in Compile()
51 compiler::VReg propName = pg->AllocReg(); in Compile()
55 compiler::TryContext enumeratorInitTryCtx(pg); in Compile()
57 pg->SetLabel(right_, labelSet.TryBegin()); in Compile()
58 right_->Compile(pg); in Compile()
59 pg->GetPropIterator(this); in Compile()
60 pg->StoreAccumulator(this, iter); in Compile()
[all …]
DforOfStatement.cpp43 void ForOfStatement::Compile(compiler::PandaGen *pg) const in Compile()
45 compiler::LocalRegScope regScope(pg, scope_); in Compile()
48 pg->NewLexEnv(this, scope_->LexicalSlots()); in Compile()
52 compiler::TryContext iterInitTryCtx(pg); in Compile()
54 pg->SetLabel(right_, labelSet.TryBegin()); in Compile()
55 right_->Compile(pg); in Compile()
56 pg->SetLabel(right_, labelSet.TryEnd()); in Compile()
57 pg->Branch(right_, labelSet.CatchEnd()); in Compile()
59 pg->SetLabel(right_, labelSet.CatchBegin()); in Compile()
60 compiler::VReg exception = pg->AllocReg(); in Compile()
[all …]
DforUpdateStatement.cpp55 void ForUpdateStatement::Compile(compiler::PandaGen *pg) const in Compile()
57 compiler::LocalRegScope loopRegScope(pg, scope_); in Compile()
58 compiler::LabelTarget labelTarget(pg); in Compile()
59 compiler::LoopEnvScope envScope(pg, labelTarget, scope_); in Compile()
63 init_->Compile(pg); in Compile()
66 auto *startLabel = pg->AllocLabel(); in Compile()
67 pg->SetLabel(this, startLabel); in Compile()
71 compiler::Condition::Compile(pg, test_, labelTarget.BreakTarget()); in Compile()
74 body_->Compile(pg); in Compile()
75 pg->SetLabel(this, labelTarget.ContinueTarget()); in Compile()
[all …]
DreturnStatement.cpp41 void ReturnStatement::Compile(compiler::PandaGen *pg) const in Compile()
44 argument_->Compile(pg); in Compile()
46 pg->LoadConst(this, compiler::Constant::JS_UNDEFINED); in Compile()
49 if (pg->CheckControlFlowChange()) { in Compile()
50 compiler::RegScope rs(pg); in Compile()
51 compiler::VReg res = pg->AllocReg(); in Compile()
53 pg->StoreAccumulator(this, res); in Compile()
54 pg->ControlFlowChangeReturn(); in Compile()
55 pg->LoadAccumulator(this, res); in Compile()
59 pg->ValidateClassDirectReturn(this); in Compile()
[all …]
DdoWhileStatement.cpp40 void DoWhileStatement::Compile(compiler::PandaGen *pg) const in Compile()
42 auto *startLabel = pg->AllocLabel(); in Compile()
43 compiler::LabelTarget labelTarget(pg); in Compile()
45 pg->SetLabel(this, startLabel); in Compile()
47 compiler::LoopEnvScope envScope(pg, labelTarget, scope_); in Compile()
48 body_->Compile(pg); in Compile()
50 pg->SetLabel(this, labelTarget.ContinueTarget()); in Compile()
51 compiler::Condition::Compile(pg, this->Test(), labelTarget.BreakTarget()); in Compile()
54 pg->Branch(this, startLabel); in Compile()
55 pg->SetLabel(this, labelTarget.BreakTarget()); in Compile()
/arkcompiler/ets_frontend/es2panda/ir/expressions/
DcallExpression.cpp57 compiler::VReg CallExpression::CreateSpreadArguments(compiler::PandaGen *pg) const in CreateSpreadArguments()
59 compiler::VReg argsObj = pg->AllocReg(); in CreateSpreadArguments()
60 pg->CreateArray(this, arguments_, argsObj); in CreateSpreadArguments()
65 void CallExpression::Compile(compiler::PandaGen *pg) const in Compile()
79 if (pg->TryCompileFunctionCallOrNewExpression(realCallee)) { in Compile()
84 compiler::RegScope rs(pg); in Compile()
89 compiler::RegScope paramScope(pg); in Compile()
90 compiler::VReg argsObj = CreateSpreadArguments(pg); in Compile()
92 pg->GetFunctionObject(this); in Compile()
93 pg->SuperCallSpread(this, argsObj); in Compile()
[all …]
DunaryExpression.cpp39 void UnaryExpression::Compile(compiler::PandaGen *pg) const in Compile()
44 … binder::ScopeFindResult result = pg->Scope()->Find(argument_->AsIdentifier()->Name()); in Compile()
46 compiler::RegScope rs(pg); in Compile()
47 compiler::VReg variable = pg->AllocReg(); in Compile()
48 compiler::VReg global = pg->AllocReg(); in Compile()
50 pg->LoadConst(this, compiler::Constant::JS_GLOBAL); in Compile()
51 pg->StoreAccumulator(this, global); in Compile()
53 pg->LoadAccumulatorString(this, argument_->AsIdentifier()->Name()); in Compile()
54 pg->StoreAccumulator(this, variable); in Compile()
56 pg->DeleteObjProperty(this, global, variable); in Compile()
[all …]
DbinaryExpression.cpp41 void BinaryExpression::CompileLogical(compiler::PandaGen *pg) const in CompileLogical()
43 compiler::RegScope rs(pg); in CompileLogical()
44 compiler::VReg lhs = pg->AllocReg(); in CompileLogical()
49 auto *skipRight = pg->AllocLabel(); in CompileLogical()
50 auto *endLabel = pg->AllocLabel(); in CompileLogical()
53 left_->Compile(pg); in CompileLogical()
54 pg->StoreAccumulator(this, lhs); in CompileLogical()
57 pg->BranchIfFalse(this, skipRight); in CompileLogical()
59 pg->BranchIfTrue(this, skipRight); in CompileLogical()
62 auto *nullish = pg->AllocLabel(); in CompileLogical()
[all …]
DtaggedTemplateExpression.cpp48 void TaggedTemplateExpression::Compile(compiler::PandaGen *pg) const in Compile()
50 compiler::RegScope rs(pg); in Compile()
51 compiler::VReg callee = pg->AllocReg(); in Compile()
56 compiler::VReg thisReg = pg->AllocReg(); in Compile()
58 compiler::RegScope mrs(pg); in Compile()
59 tag_->AsMemberExpression()->Compile(pg, thisReg); in Compile()
61 tag_->Compile(pg); in Compile()
64 pg->StoreAccumulator(this, callee); in Compile()
66 compiler::Literals::GetTemplateObject(pg, this); in Compile()
67 compiler::VReg arg0 = pg->AllocReg(); in Compile()
[all …]
DassignmentExpression.cpp111 void AssignmentExpression::Compile(compiler::PandaGen *pg) const in Compile()
113 compiler::RegScope rs(pg); in Compile()
114 compiler::LReference lref = compiler::LReference::CreateLRef(pg, left_, false); in Compile()
119 auto *skipRight = pg->AllocLabel(); in Compile()
120 auto *endLabel = pg->AllocLabel(); in Compile()
121 compiler::VReg lhsReg = pg->AllocReg(); in Compile()
124 pg->StoreAccumulator(left_, lhsReg); in Compile()
126 pg->BranchIfFalse(left_, skipRight); in Compile()
128 pg->BranchIfTrue(left_, skipRight); in Compile()
131 auto *nullish = pg->AllocLabel(); in Compile()
[all …]
DnewExpression.cpp46 void NewExpression::Compile(compiler::PandaGen *pg) const in Compile()
48 compiler::RegScope rs(pg); in Compile()
49 compiler::VReg ctor = pg->AllocReg(); in Compile()
51 callee_->Compile(pg); in Compile()
52 pg->StoreAccumulator(this, ctor); in Compile()
56 compiler::VReg arg = pg->AllocReg(); in Compile()
57 it->Compile(pg); in Compile()
58 pg->StoreAccumulator(this, arg); in Compile()
61 pg->NewObject(this, ctor, arguments_.size() + 1); in Compile()
63 compiler::VReg argsObj = pg->AllocReg(); in Compile()
[all …]
/arkcompiler/ets_frontend/ts2panda/src/base/
Diterator.ts101 let pg = this.pandaGen;
103 pg.closeIterator(this.node, this.iterRecord.iterator);
107 let completion = pg.getTemp();
108 let res = pg.getTemp();
109 let exception = pg.getTemp();
117 pg,
122 pg.storeAccumulator(this.node, completion);
123 pg.storeConst(this.node, exception, CacheList.HOLE);
126 pg.label(this.node, tryBeginLabel);
134 pg.branchIfUndefined(this.node, noReturn);
[all …]
/arkcompiler/ets_frontend/es2panda/ir/base/
DclassDefinition.cpp108 compiler::VReg ClassDefinition::CompileHeritageClause(compiler::PandaGen *pg) const in CompileHeritageClause()
110 compiler::VReg baseReg = pg->AllocReg(); in CompileHeritageClause()
113 superClass_->Compile(pg); in CompileHeritageClause()
115 pg->LoadConst(this, compiler::Constant::JS_HOLE); in CompileHeritageClause()
118 pg->StoreAccumulator(this, baseReg); in CompileHeritageClause()
122 void ClassDefinition::InitializeClassName(compiler::PandaGen *pg) const in InitializeClassName()
128 compiler::LReference lref = compiler::LReference::CreateLRef(pg, ident_, true); in InitializeClassName()
133 int32_t ClassDefinition::CreateClassStaticProperties(compiler::PandaGen *pg, util::BitSet &compiled… in CreateClassStaticProperties() argument
135 auto *buf = pg->NewLiteralBuffer(); in CreateClassStaticProperties()
136 compiler::LiteralBuffer staticBuf(pg->Allocator()); in CreateClassStaticProperties()
[all …]
/arkcompiler/ets_frontend/es2panda/ir/expressions/literals/
DregExpLiteral.cpp33 void RegExpLiteral::Compile(compiler::PandaGen *pg) const in Compile()
35 compiler::RegScope rs(pg); in Compile()
37 compiler::VReg ctor = pg->AllocReg(); in Compile()
38 compiler::VReg pattern = pg->AllocReg(); in Compile()
41 pg->TryLoadGlobalByName(this, "RegExp"); in Compile()
42 pg->StoreAccumulator(this, ctor); in Compile()
44 pg->LoadAccumulatorString(this, pattern_); in Compile()
45 pg->StoreAccumulator(this, pattern); in Compile()
48 compiler::VReg flag = pg->AllocReg(); in Compile()
49 pg->LoadAccumulatorString(this, flags_); in Compile()
[all …]
/arkcompiler/ets_frontend/ts2panda/tests/expression/
DfunctionExpression.test.ts58 IRNode.pg = new PandaGen("", creatAstFromSnippet(``), 0, undefined);
73 pandaGens.forEach((pg) => {
74 if (pg.internalName === "UnitTest.test") {
75 … expect(checkInstructions(pg.getInsns(), expectedFunc), "check func insns").to.be.true;
91 pandaGens.forEach((pg) => {
92 if (pg.internalName === "UnitTest.a") {
96 if (pg.internalName === "UnitTest.func_main_0") {
98 pg.getInsns().forEach((insns) => {
119 pandaGens.forEach((pg) => {
120 if (pg.internalName === "UnitTest.a") {
[all …]

12345678910>>...15