File tree Expand file tree Collapse file tree 5 files changed +23
-14
lines changed Expand file tree Collapse file tree 5 files changed +23
-14
lines changed Original file line number Diff line number Diff line change @@ -502,9 +502,14 @@ void CodeGenInterface::genUpdateLife(GenTree* tree)
502502 treeLifeUpdater->UpdateLife (tree);
503503}
504504
505- bool CodeGenInterface::genUpdateLife (VARSET_VALARG_TP newLife)
505+ void CodeGenInterface::genUpdateLife (VARSET_VALARG_TP newLife)
506506{
507- return compiler->compUpdateLife </* ForCodeGen*/ true >(newLife);
507+ compiler->compUpdateLife </* ForCodeGen*/ true >(newLife);
508+ }
509+
510+ bool CodeGenInterface::genWillUpdateLife (VARSET_VALARG_TP newLife)
511+ {
512+ return compiler->compWillUpdateLife (newLife);
508513}
509514
510515// Return the register mask for the given register variable
Original file line number Diff line number Diff line change @@ -165,7 +165,8 @@ class CodeGenInterface
165165 regMaskTP genGetRegMask (GenTree* tree);
166166
167167 void genUpdateLife (GenTree* tree);
168- bool genUpdateLife (VARSET_VALARG_TP newLife);
168+ void genUpdateLife (VARSET_VALARG_TP newLife);
169+ bool genWillUpdateLife (VARSET_VALARG_TP newLife);
169170
170171 TreeLifeUpdater<true >* treeLifeUpdater;
171172
Original file line number Diff line number Diff line change @@ -192,21 +192,22 @@ void CodeGen::genCodeForBBlist()
192192
193193 compiler->m_pLinearScan ->recordVarLocationsAtStartOfBB (block);
194194
195- // Updating variable liveness after last instruction of previous block was emitted
196- // and before first of the current block is emitted
197- bool livenessChanged = genUpdateLife (block->bbLiveIn );
198-
199- // if liveness has changed and the last block ended on emitting a call that can do GC,
195+ // if liveness is changing and the last block ended on emitting a call that can do GC,
200196 // emit a nop to ensure that GC info is not changing between
201197 // "call has been made" and "call has returned" states.
202- if (livenessChanged )
198+ if (genWillUpdateLife (block-> bbLiveIn ) )
203199 {
204200 if (GetEmitter ()->emitLastInsIsCallWithGC ())
205201 {
202+ printf (" ####################\n " );
206203 instGen (INS_nop);
207204 }
208205 }
209206
207+ // Updating variable liveness after last instruction of previous block was emitted
208+ // and before first of the current block is emitted
209+ genUpdateLife (block->bbLiveIn );
210+
210211 // Even if liveness didn't change, we need to update the registers containing GC references.
211212 // genUpdateLife will update the registers live due to liveness changes. But what about registers that didn't
212213 // change? We cleared them out above. Maybe we should just not clear them out, but update the ones that change
Original file line number Diff line number Diff line change @@ -8516,7 +8516,12 @@ class Compiler
85168516 // Update the GC's masks, register's masks and reports change on variable's homes given a set of
85178517 // current live variables if changes have happened since "compCurLife".
85188518 template <bool ForCodeGen>
8519- inline bool compUpdateLife (VARSET_VALARG_TP newLife);
8519+ inline void compUpdateLife (VARSET_VALARG_TP newLife);
8520+
8521+ inline bool compWillUpdateLife (VARSET_VALARG_TP newLife)
8522+ {
8523+ return (!VarSetOps::Equal (this , compCurLife, newLife));
8524+ }
85208525
85218526 // Gets a register mask that represent the kill set for a helper call since
85228527 // not all JIT Helper calls follow the standard ABI on the target architecture.
Original file line number Diff line number Diff line change @@ -3543,12 +3543,11 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
35433543// The set of live variables reflects the result of only emitted code, it should not be considering the becoming
35443544// live/dead of instructions that has not been emitted yet. This is requires by "compChangeLife".
35453545template <bool ForCodeGen>
3546- inline bool Compiler::compUpdateLife (VARSET_VALARG_TP newLife)
3546+ inline void Compiler::compUpdateLife (VARSET_VALARG_TP newLife)
35473547{
35483548 if (!VarSetOps::Equal (this , compCurLife, newLife))
35493549 {
35503550 compChangeLife<ForCodeGen>(newLife);
3551- return true ;
35523551 }
35533552#ifdef DEBUG
35543553 else
@@ -3561,8 +3560,6 @@ inline bool Compiler::compUpdateLife(VARSET_VALARG_TP newLife)
35613560 }
35623561 }
35633562#endif // DEBUG
3564-
3565- return false ;
35663563}
35673564
35683565/* ****************************************************************************
You can’t perform that action at this time.
0 commit comments