@@ -5084,7 +5084,7 @@ Lowerer::LowerNewScObjArrayNoArg(IR::Instr *newObjInstr)
50845084void
50855085Lowerer::LowerPrologEpilog()
50865086{
5087- if (m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync ())
5087+ if (m_func->GetJnFunction()->IsCoroutine ())
50885088 {
50895089 LowerGeneratorResumeJumpTable();
50905090 }
@@ -5121,7 +5121,7 @@ Lowerer::LowerPrologEpilogAsmJs()
51215121void
51225122Lowerer::LowerGeneratorResumeJumpTable()
51235123{
5124- Assert(m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync ());
5124+ Assert(m_func->GetJnFunction()->IsCoroutine ());
51255125
51265126 IR::Instr * jumpTableInstr = m_func->m_headInstr;
51275127 AssertMsg(jumpTableInstr->IsEntryInstr(), "First instr isn't an EntryInstr...");
@@ -7568,7 +7568,7 @@ Lowerer::LoadArgumentCount(IR::Instr *const instr)
75687568 instr->SetSrc1(IR::IntConstOpnd::New(instr->m_func->actualCount, TyUint32, instr->m_func, true));
75697569 LowererMD::ChangeToAssign(instr);
75707570 }
7571- else if (instr->m_func->GetJnFunction()->IsGenerator() || instr->m_func->GetJnFunction()->IsAsync ())
7571+ else if (instr->m_func->GetJnFunction()->IsCoroutine ())
75727572 {
75737573 IR::SymOpnd* symOpnd = LoadCallInfo(instr);
75747574 instr->SetSrc1(symOpnd);
@@ -9607,7 +9607,7 @@ IR::Instr *Lowerer::LowerRestParameter(IR::Opnd *formalsOpnd, IR::Opnd *dstOpnd,
96079607
96089608 LoadScriptContext(helperCallInstr);
96099609
9610- BOOL isGenerator = this->m_func->GetJnFunction()->IsGenerator() || this->m_func->GetJnFunction()->IsAsync ();
9610+ BOOL isGenerator = this->m_func->GetJnFunction()->IsCoroutine ();
96119611
96129612 // Elements pointer = ebp + (formals count + formals offset + 1)*sizeof(Var)
96139613 IR::RegOpnd *srcOpnd = isGenerator ? generatorArgsPtrOpnd : IR::Opnd::CreateFramePointerOpnd(this->m_func);
@@ -9715,7 +9715,7 @@ Lowerer::LowerArgIn(IR::Instr *instrArgIn)
97159715 // $createRestArray
97169716 instrArgIn->InsertBefore(createRestArrayLabel);
97179717
9718- if (m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync ())
9718+ if (m_func->GetJnFunction()->IsCoroutine ())
97199719 {
97209720 generatorArgsPtrOpnd = LoadGeneratorArgsPtr(instrArgIn);
97219721 }
@@ -9734,7 +9734,7 @@ Lowerer::LowerArgIn(IR::Instr *instrArgIn)
97349734 if (argIndex == 1)
97359735 {
97369736 // The "this" argument is not source-dependent and doesn't need to be checked.
9737- if (m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync ())
9737+ if (m_func->GetJnFunction()->IsCoroutine ())
97389738 {
97399739 generatorArgsPtrOpnd = LoadGeneratorArgsPtr(instrArgIn);
97409740 ConvertArgOpndIfGeneratorFunction(instrArgIn, generatorArgsPtrOpnd);
@@ -9788,7 +9788,7 @@ Lowerer::LowerArgIn(IR::Instr *instrArgIn)
97889788
97899789 // Now insert all the checks and undef-assigns.
97909790
9791- if (m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync ())
9791+ if (m_func->GetJnFunction()->IsCoroutine ())
97929792 {
97939793 generatorArgsPtrOpnd = LoadGeneratorArgsPtr(instrInsert);
97949794 }
@@ -9958,7 +9958,7 @@ Lowerer::LowerArgIn(IR::Instr *instrArgIn)
99589958void
99599959Lowerer::ConvertArgOpndIfGeneratorFunction(IR::Instr *instrArgIn, IR::RegOpnd *generatorArgsPtrOpnd)
99609960{
9961- if (this->m_func->GetJnFunction()->IsGenerator() || this->m_func->GetJnFunction()->IsAsync ())
9961+ if (this->m_func->GetJnFunction()->IsCoroutine ())
99629962 {
99639963 // Replace stack param operand with offset into arguments array held by
99649964 // the generator object.
@@ -10664,7 +10664,7 @@ Lowerer::LoadCallInfo(IR::Instr * instrInsert)
1066410664 IR::SymOpnd * srcOpnd;
1066510665 Func * func = instrInsert->m_func;
1066610666
10667- if (func->GetJnFunction()->IsGenerator() || func->GetJnFunction()->IsAsync ())
10667+ if (func->GetJnFunction()->IsCoroutine ())
1066810668 {
1066910669 // Generator function arguments and ArgumentsInfo are not on the stack. Instead they
1067010670 // are accessed off the generator object (which is prm1).
@@ -18111,7 +18111,7 @@ IR::IndirOpnd*
1811118111Lowerer::GetArgsIndirOpndForTopFunction(IR::Instr* ldElem, IR::Opnd* valueOpnd)
1811218112{
1811318113 // Load argument set dst = [ebp + index] (or grab from the generator object if m_func is a generator function).
18114- IR::RegOpnd *baseOpnd = ( m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync() ) ? LoadGeneratorArgsPtr(ldElem) : IR::Opnd::CreateFramePointerOpnd(m_func);
18114+ IR::RegOpnd *baseOpnd = m_func->GetJnFunction()->IsCoroutine( ) ? LoadGeneratorArgsPtr(ldElem) : IR::Opnd::CreateFramePointerOpnd(m_func);
1811518115 IR::IndirOpnd* argIndirOpnd = nullptr;
1811618116 // The stack looks like this:
1811718117 // ...
@@ -18125,7 +18125,7 @@ Lowerer::GetArgsIndirOpndForTopFunction(IR::Instr* ldElem, IR::Opnd* valueOpnd)
1812518125
1812618126 //actual arguments offset is LowererMD::GetFormalParamOffset() + 1 (this)
1812718127
18128- uint16 actualOffset = ( m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync() ) ? 1 : GetFormalParamOffset() + 1; //5
18128+ uint16 actualOffset = m_func->GetJnFunction()->IsCoroutine( ) ? 1 : GetFormalParamOffset() + 1; //5
1812918129 Assert(actualOffset == 5 || m_func->GetJnFunction()->IsGenerator());
1813018130 if (valueOpnd->IsIntConstOpnd())
1813118131 {
@@ -20366,7 +20366,7 @@ Lowerer::GenerateLoadNewTarget(IR::Instr* instrInsert)
2036620366
2036720367 Assert(!func->IsInlinee());
2036820368
20369- if (func->GetJnFunction()->IsGenerator() || func->GetJnFunction()->IsAsync ())
20369+ if (func->GetJnFunction()->IsCoroutine ())
2037020370 {
2037120371 instrInsert->SetSrc1(opndUndefAddress);
2037220372 LowererMD::ChangeToAssign(instrInsert);
@@ -21101,7 +21101,7 @@ void Lowerer::GenerateNullOutGeneratorFrame(IR::Instr* insertInstr)
2110121101
2110221102void Lowerer::LowerFunctionExit(IR::Instr* funcExit)
2110321103{
21104- if (m_func->GetJnFunction()->IsGenerator() || m_func->GetJnFunction()->IsAsync ())
21104+ if (m_func->GetJnFunction()->IsCoroutine ())
2110521105 {
2110621106 GenerateNullOutGeneratorFrame(funcExit->m_prev);
2110721107 }
0 commit comments