Lines Matching refs:node
23 void AsyncGeneratorFunctionBuilder::Prepare(const ir::ScriptFunction *node)
26 VReg callee = FunctionReg(node);
30 pg_->CreateAsyncGeneratorObj(node, callee);
31 pg_->StoreAccumulator(node, funcObj_);
33 pg_->SetLabel(node, catchTable_->LabelSet().TryBegin());
35 pg_->LoadConst(node, Constant::JS_UNDEFINED);
36 SuspendResumeExecution(node, completionType, completionValue);
39 void AsyncGeneratorFunctionBuilder::CleanUp(const ir::ScriptFunction *node) const
46 pg_->SetLabel(node, labelSet.TryEnd());
47 pg_->SetLabel(node, labelSet.CatchBegin());
48 pg_->StoreAccumulator(node, retVal);
49 pg_->GeneratorComplete(node, funcObj_);
50 pg_->LoadAccumulator(node, retVal);
51 pg_->AsyncGeneratorReject(node, funcObj_);
52 pg_->EmitReturn(node);
53 pg_->SetLabel(node, labelSet.CatchEnd());
56 void AsyncGeneratorFunctionBuilder::DirectReturn(const ir::AstNode *node) const
62 pg_->StoreAccumulator(node, retVal);
63 pg_->StoreConst(node, canSuspend, Constant::JS_TRUE);
65 pg_->GeneratorComplete(node, funcObj_);
66 pg_->AsyncGeneratorResolve(node, funcObj_, retVal, canSuspend);
68 // the DirectReturn method, the EmitReturn needs to be associated with a valid node
70 pg_->EmitReturn(node);
73 void AsyncGeneratorFunctionBuilder::ImplicitReturn(const ir::AstNode *node) const
76 pg_->LoadConst(node, Constant::JS_UNDEFINED);
77 DirectReturn(node);
80 void AsyncGeneratorFunctionBuilder::ExplicitReturn(const ir::AstNode *node) const
87 pg_->AsyncFunctionAwait(node, funcObj_);
88 SuspendResumeExecution(node, resumeType, resumeValue);
89 pg_->GeneratorComplete(node, funcObj_);
90 pg_->StoreConst(node, canSuspend, Constant::JS_TRUE);
91 pg_->AsyncGeneratorResolve(node, funcObj_, resumeValue, canSuspend);
92 pg_->EmitReturn(node);
95 void AsyncGeneratorFunctionBuilder::Yield(const ir::AstNode *node)
106 Await(node);
107 pg_->StoreAccumulator(node, value);
109 AsyncYield(node, value, resumeType, resumeValue);
112 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::RETURN));
113 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, resumeType, notReturn);
116 pg_->LoadAccumulator(node, resumeValue);
117 pg_->AsyncFunctionAwait(node, funcObj_);
118 SuspendResumeExecution(node, resumeType, resumeValue);
121 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW));
122 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, resumeType, normalCompletion);
123 pg_->LoadAccumulator(node, resumeValue);
124 pg_->EmitThrow(node);
126 pg_->SetLabel(node, normalCompletion);
130 pg_->LoadAccumulator(node, resumeValue);
131 DirectReturn(node);
133 pg_->SetLabel(node, notReturn);
135 pg_->LoadAccumulatorInt(node, static_cast<int32_t>(ResumeMode::THROW));
136 pg_->Condition(node, lexer::TokenType::PUNCTUATOR_EQUAL, resumeType, notThrowCompletion);
137 pg_->LoadAccumulator(node, resumeValue);
138 pg_->EmitThrow(node);
139 pg_->SetLabel(node, notThrowCompletion);
140 pg_->LoadAccumulator(node, resumeValue);