-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable OpHelperReg optimisation for Coroutines #6706
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3339,7 +3339,7 @@ LinearScan::KillImplicitRegs(IR::Instr *instr) | |
return; | ||
} | ||
|
||
if (instr->m_opcode == Js::OpCode::Yield) | ||
if (instr->m_opcode == Js::OpCode::GeneratorBailInLabel) | ||
{ | ||
this->bailIn.SpillRegsForBailIn(); | ||
return; | ||
|
@@ -5041,6 +5041,7 @@ IR::Instr* LinearScan::GeneratorBailIn::GenerateBailIn(IR::GeneratorBailInInstr* | |
// - We don't need to restore argObjSyms because StackArgs is currently not enabled | ||
// Commented out here in case we do want to enable it in the future: | ||
// this->InsertRestoreSymbols(bailOutInfo->capturedValues->argObjSyms, insertionPoint, saveInitializedReg); | ||
Assert(!this->func->IsStackArgsEnabled()); | ||
// | ||
// - We move all argout symbols right before the call so we don't need to restore argouts either | ||
|
||
|
@@ -5050,13 +5051,7 @@ IR::Instr* LinearScan::GeneratorBailIn::GenerateBailIn(IR::GeneratorBailInInstr* | |
bailInInstr->capturedValues | ||
); | ||
|
||
this->InsertRestoreSymbols( | ||
*bailOutInfo->byteCodeUpwardExposedUsed, | ||
bailInInstr->upwardExposedUses, | ||
bailInInstr->capturedValues, | ||
insertionPoint | ||
); | ||
Assert(!this->func->IsStackArgsEnabled()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This Assert had gone adrift from the comment that explained it - therefore moved upwards. |
||
this->InsertRestoreSymbols(insertionPoint); | ||
|
||
#ifdef ENABLE_DEBUG_CONFIG_OPTIONS | ||
if (PHASE_TRACE(Js::Phase::BailInPhase, this->func)) | ||
|
@@ -5201,12 +5196,7 @@ void LinearScan::GeneratorBailIn::BuildBailInSymbolList( | |
AssertOrFailFastMsg(unrestorableSymbols.IsEmpty(), "There are unrestorable backend-only symbols across yield points"); | ||
} | ||
|
||
void LinearScan::GeneratorBailIn::InsertRestoreSymbols( | ||
const BVSparse<JitArenaAllocator>& byteCodeUpwardExposedUses, | ||
const BVSparse<JitArenaAllocator>& upwardExposedUses, | ||
const CapturedValues& capturedValues, | ||
Comment on lines
-5205
to
-5207
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These parameters weren't used |
||
BailInInsertionPoint& insertionPoint | ||
) | ||
void LinearScan::GeneratorBailIn::InsertRestoreSymbols(BailInInsertionPoint& insertionPoint) | ||
{ | ||
FOREACH_SLISTBASE_ENTRY(BailInSymbol, bailInSymbol, this->bailInSymbols) | ||
{ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
//------------------------------------------------------------------------------------------------------- | ||
// Copyright (C) Microsoft Corporation and contributors. All rights reserved. | ||
// Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. | ||
//------------------------------------------------------------------------------------------------------- | ||
|
||
|
@@ -260,9 +261,19 @@ SCCLiveness::Build() | |
{ | ||
this->EndOpHelper(labelInstr); | ||
} | ||
if (labelInstr->isOpHelper && !PHASE_OFF(Js::OpHelperRegOptPhase, this->func)) | ||
if (labelInstr->isOpHelper) | ||
{ | ||
this->lastOpHelperLabel = labelInstr; | ||
if (!PHASE_OFF(Js::OpHelperRegOptPhase, this->func) && | ||
!this->func->GetTopFunc()->GetJITFunctionBody()->IsCoroutine()) | ||
{ | ||
this->lastOpHelperLabel = labelInstr; | ||
} | ||
#ifdef DBG | ||
else | ||
{ | ||
labelInstr->AsLabelInstr()->m_noHelperAssert = true; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's an assertion to check that helper blocks are being set correctly - with this optimisation disabled it would fire incorrectly, setting this debug only property disables it. |
||
} | ||
#endif | ||
} | ||
} | ||
else if (instr->IsBranchInstr() && !instr->AsBranchInstr()->IsMultiBranch()) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OpCode
Yield
is removed earlier in the jitting process and replaced with a number of operations - the one we're looking for here is the GeneratorBailInLabel.