Lines Matching refs:node

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