Lines Matching refs:node
36 void FunctionBuilder::DirectReturn(const ir::AstNode *node) const in DirectReturn()
38 pg_->EmitReturn(node); in DirectReturn()
41 void FunctionBuilder::ImplicitReturn(const ir::AstNode *node) const in ImplicitReturn()
46 pg_->EmitReturnUndefined(node); in ImplicitReturn()
52 pg_->EmitReturn(node); in ImplicitReturn()
55 void FunctionBuilder::AsyncYield(const ir::AstNode *node, VReg completionType, VReg completionValue… in AsyncYield() argument
59 pg_->GeneratorYield(node, funcObj_); in AsyncYield()
60 pg_->SuspendAsyncGenerator(node, funcObj_); in AsyncYield()
62 ResumeGenerator(node, completionType, completionValue); in AsyncYield()
65 void FunctionBuilder::SuspendResumeExecution(const ir::AstNode *node, VReg completionType, VReg com… in SuspendResumeExecution() argument
70 pg_->SuspendGenerator(node, funcObj_); in SuspendResumeExecution()
71 ResumeGenerator(node, completionType, completionValue); in SuspendResumeExecution()
74 void FunctionBuilder::ResumeGenerator(const ir::AstNode *node, VReg completionType, VReg completion… in ResumeGenerator() argument
79 pg_->ResumeGenerator(node, funcObj_); in ResumeGenerator()
80 pg_->StoreAccumulator(node, completionValue); in ResumeGenerator()
81 pg_->GetResumeMode(node, funcObj_); in ResumeGenerator()
82 pg_->StoreAccumulator(node, completionType); in ResumeGenerator()
85 VReg FunctionBuilder::FunctionReg(const ir::ScriptFunction *node) const in FunctionReg()
87 varbinder::FunctionScope *scope = node->Scope(); in FunctionReg()
93 void FunctionBuilder::Await(const ir::AstNode *node) in Await() argument
106 pg_->AsyncFunctionAwait(node, funcObj_); in Await()
107 SuspendResumeExecution(node, completionType, completionValue); in Await()
109 HandleCompletion(node, completionType, completionValue); in Await()
112 void FunctionBuilder::HandleCompletion(const ir::AstNode *node, VReg completionType, VReg completio… in HandleCompletion() argument
115 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::RETURN)); in HandleCompletion()
118 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notRetLabel); in HandleCompletion()
125 pg_->LoadAccumulator(node, completionValue); in HandleCompletion()
126 pg_->DirectReturn(node); in HandleCompletion()
129 pg_->SetLabel(node, notRetLabel); in HandleCompletion()
130 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW)); in HandleCompletion()
133 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notThrowLabel); in HandleCompletion()
134 pg_->LoadAccumulator(node, completionValue); in HandleCompletion()
135 pg_->EmitThrow(node); in HandleCompletion()
138 pg_->SetLabel(node, notThrowLabel); in HandleCompletion()
139 pg_->LoadAccumulator(node, completionValue); in HandleCompletion()
142 void FunctionBuilder::YieldStar(const ir::AstNode *node) in YieldStar() argument
156 Iterator iterator(pg_, node, GeneratorKind()); in YieldStar()
164 pg_->StoreConst(node, receivedValue, Constant::JS_UNDEFINED); in YieldStar()
165 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::NEXT)); in YieldStar()
166 pg_->StoreAccumulator(node, receivedType); in YieldStar()
167 pg_->MoveVreg(node, nextMethod, iterator.Method()); in YieldStar()
170 pg_->SetLabel(node, loopStart); in YieldStar()
171 pg_->StoreConst(node, exitReturn, Constant::JS_FALSE); in YieldStar()
174 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::NEXT)); in YieldStar()
175 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_STRICT_EQUAL, receivedType, throwCompletion); in YieldStar()
176 pg_->MoveVreg(node, iterator.Method(), nextMethod); in YieldStar()
177 pg_->Branch(node, callMethod); in YieldStar()
180 pg_->SetLabel(node, throwCompletion); in YieldStar()
181 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW)); in YieldStar()
182 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_STRICT_EQUAL, receivedType, returnCompletion); in YieldStar()
188 pg_->BranchIfNotUndefined(node, callMethod); in YieldStar()
200 pg_->ThrowThrowNotExist(node); in YieldStar()
204 pg_->SetLabel(node, returnCompletion); in YieldStar()
205 pg_->StoreConst(node, exitReturn, Constant::JS_TRUE); in YieldStar()
210 pg_->BranchIfNotUndefined(node, callMethod); in YieldStar()
214 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
217 Await(node); in YieldStar()
221 pg_->DirectReturn(node); in YieldStar()
223 pg_->SetLabel(node, callMethod); in YieldStar()
233 Await(node); in YieldStar()
236 pg_->StoreAccumulator(node, receivedValue); in YieldStar()
241 pg_->ThrowIfNotObject(node); in YieldStar()
247 pg_->BranchIfTrue(node, iteratorComplete); in YieldStar()
256 Await(node); in YieldStar()
258 AsyncYield(node, receivedType, receivedValue); in YieldStar()
261 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::RETURN)); in YieldStar()
262 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, receivedType, loopStart); in YieldStar()
265 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
266 pg_->AsyncFunctionAwait(node, funcObj_); in YieldStar()
267 SuspendResumeExecution(node, receivedType, receivedValue); in YieldStar()
270 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW)); in YieldStar()
273 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, receivedType, returnCompletion); in YieldStar()
278 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
279 pg_->GeneratorYield(node, funcObj_); in YieldStar()
280 SuspendResumeExecution(node, receivedType, receivedValue); in YieldStar()
283 pg_->Branch(node, loopStart); in YieldStar()
288 pg_->SetLabel(node, iteratorComplete); in YieldStar()
290 pg_->LoadAccumulator(node, exitReturn); in YieldStar()
291 pg_->BranchIfFalse(node, normalOrThrowCompletion); in YieldStar()
297 pg_->StoreAccumulator(node, receivedValue); in YieldStar()
299 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
303 pg_->DirectReturn(node); in YieldStar()
305 pg_->SetLabel(node, normalOrThrowCompletion); in YieldStar()