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