Lines Matching refs:node
38 void FunctionBuilder::DirectReturn(const ir::AstNode *node) const in DirectReturn()
40 pg_->NotifyConcurrentResult(node); in DirectReturn()
41 pg_->EmitReturn(node); in DirectReturn()
44 void FunctionBuilder::ImplicitReturn(const ir::AstNode *node) const in ImplicitReturn()
50 pg_->NotifyConcurrentResult(node); in ImplicitReturn()
52 pg_->EmitReturn(node); in ImplicitReturn()
55 pg_->LoadConst(node, Constant::JS_UNDEFINED); in ImplicitReturn()
56 pg_->NotifyConcurrentResult(node); in ImplicitReturn()
58 pg_->EmitReturnUndefined(node); in ImplicitReturn()
62 pg_->GetThis(node); in ImplicitReturn()
65 pg_->ThrowIfSuperNotCorrectCall(node, 0); in ImplicitReturn()
68 pg_->NotifyConcurrentResult(node); in ImplicitReturn()
70 pg_->EmitReturn(node); in ImplicitReturn()
73 void FunctionBuilder::ExplicitReturn(const ir::AstNode *node) const in ExplicitReturn()
75 DirectReturn(node); in ExplicitReturn()
78 void FunctionBuilder::AsyncYield(const ir::AstNode *node, VReg value, VReg completionType, VReg com… in AsyncYield() argument
84 pg_->GeneratorYield(node, funcObj_); in AsyncYield()
89 pg_->StoreConst(node, done, Constant::JS_FALSE); in AsyncYield()
90 pg_->AsyncGeneratorResolve(node, funcObj_, value, done); in AsyncYield()
92 resumeGenerator(node, completionType, completionValue); in AsyncYield()
95 void FunctionBuilder::SuspendResumeExecution(const ir::AstNode *node, VReg completionType, VReg com… in SuspendResumeExecution() argument
100 pg_->SuspendGenerator(node, funcObj_); // iterResult is in acc in SuspendResumeExecution()
101 resumeGenerator(node, completionType, completionValue); in SuspendResumeExecution()
104 void FunctionBuilder::resumeGenerator(const ir::AstNode *node, VReg completionType, VReg completion… in resumeGenerator() argument
109 pg_->ResumeGenerator(node, funcObj_); in resumeGenerator()
110 pg_->StoreAccumulator(node, completionValue); in resumeGenerator()
111 pg_->GetResumeMode(node, funcObj_); in resumeGenerator()
112 pg_->StoreAccumulator(node, completionType); in resumeGenerator()
115 VReg FunctionBuilder::FunctionReg(const ir::ScriptFunction *node) const in FunctionReg()
117 binder::FunctionScope *scope = node->Scope(); in FunctionReg()
123 void FunctionBuilder::Await(const ir::AstNode *node) in Await() argument
135 pg_->AsyncFunctionAwait(node, funcObj_); in Await()
136 SuspendResumeExecution(node, completionType, completionValue); in Await()
138 HandleCompletion(node, completionType, completionValue); in Await()
141 void FunctionBuilder::HandleCompletion(const ir::AstNode *node, VReg completionType, VReg completio… in HandleCompletion() argument
145 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::RETURN)); in HandleCompletion()
148 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, notRetLabel); in HandleCompletion()
155 pg_->LoadAccumulator(node, completionValue); in HandleCompletion()
156 pg_->DirectReturn(node); in HandleCompletion()
159 pg_->SetLabel(node, notRetLabel); in HandleCompletion()
162 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW)); in HandleCompletion()
165 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, completionType, not_throw_label); in HandleCompletion()
166 pg_->LoadAccumulator(node, completionValue); in HandleCompletion()
167 pg_->EmitThrow(node); in HandleCompletion()
170 pg_->SetLabel(node, not_throw_label); in HandleCompletion()
171 pg_->LoadAccumulator(node, completionValue); in HandleCompletion()
174 void FunctionBuilder::YieldStar(const ir::AstNode *node) in YieldStar() argument
188 Iterator iterator(pg_, node, GeneratorKind()); in YieldStar()
197 pg_->StoreConst(node, receivedValue, Constant::JS_UNDEFINED); in YieldStar()
198 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::NEXT)); in YieldStar()
199 pg_->StoreAccumulator(node, receivedType); in YieldStar()
200 pg_->MoveVreg(node, nextMethod, iterator.Method()); in YieldStar()
203 pg_->SetLabel(node, loopStart); in YieldStar()
204 pg_->StoreConst(node, exitReturn, Constant::JS_FALSE); in YieldStar()
207 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::NEXT)); in YieldStar()
208 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_STRICT_EQUAL, receivedType, throwCompletion); in YieldStar()
209 pg_->MoveVreg(node, iterator.Method(), nextMethod); in YieldStar()
210 pg_->Branch(node, callMethod); in YieldStar()
213 pg_->SetLabel(node, throwCompletion); in YieldStar()
214 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW)); in YieldStar()
215 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_STRICT_EQUAL, receivedType, returnCompletion); in YieldStar()
221 pg_->BranchIfNotUndefined(node, callMethod); in YieldStar()
233 pg_->ThrowThrowNotExist(node); in YieldStar()
237 pg_->SetLabel(node, returnCompletion); in YieldStar()
238 pg_->StoreConst(node, exitReturn, Constant::JS_TRUE); in YieldStar()
243 pg_->BranchIfNotUndefined(node, callMethod); in YieldStar()
247 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
250 Await(node); in YieldStar()
254 pg_->DirectReturn(node); in YieldStar()
256 pg_->SetLabel(node, callMethod); in YieldStar()
266 Await(node); in YieldStar()
269 pg_->StoreAccumulator(node, receivedValue); in YieldStar()
274 pg_->ThrowIfNotObject(node, receivedValue); in YieldStar()
280 pg_->BranchIfTrue(node, iteratorComplete); in YieldStar()
282 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
290 Await(node); in YieldStar()
292 pg_->StoreAccumulator(node, iterValue); in YieldStar()
293 AsyncYield(node, iterValue, receivedType, receivedValue); in YieldStar()
296 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::RETURN)); in YieldStar()
297 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, receivedType, loopStart); in YieldStar()
300 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
301 pg_->AsyncFunctionAwait(node, funcObj_); in YieldStar()
302 SuspendResumeExecution(node, receivedType, receivedValue); in YieldStar()
305 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW)); in YieldStar()
308 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_NOT_EQUAL, receivedType, loopStart); in YieldStar()
309 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::RETURN)); in YieldStar()
310 pg_->StoreAccumulator(node, receivedType); in YieldStar()
315 SuspendResumeExecution(node, receivedType, receivedValue); in YieldStar()
318 pg_->Branch(node, loopStart); in YieldStar()
323 pg_->SetLabel(node, iteratorComplete); in YieldStar()
325 pg_->LoadAccumulator(node, exitReturn); in YieldStar()
326 pg_->BranchIfFalse(node, normalOrThrowCompletion); in YieldStar()
332 pg_->StoreAccumulator(node, receivedValue); in YieldStar()
334 pg_->LoadAccumulator(node, receivedValue); in YieldStar()
338 pg_->DirectReturn(node); in YieldStar()
340 pg_->SetLabel(node, normalOrThrowCompletion); in YieldStar()