File tree 5 files changed +23
-14
lines changed
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)
502
502
treeLifeUpdater->UpdateLife (tree);
503
503
}
504
504
505
- bool CodeGenInterface::genUpdateLife (VARSET_VALARG_TP newLife)
505
+ void CodeGenInterface::genUpdateLife (VARSET_VALARG_TP newLife)
506
506
{
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);
508
513
}
509
514
510
515
// 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
165
165
regMaskTP genGetRegMask (GenTree* tree);
166
166
167
167
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);
169
170
170
171
TreeLifeUpdater<true >* treeLifeUpdater;
171
172
Original file line number Diff line number Diff line change @@ -192,21 +192,22 @@ void CodeGen::genCodeForBBlist()
192
192
193
193
compiler->m_pLinearScan ->recordVarLocationsAtStartOfBB (block);
194
194
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,
200
196
// emit a nop to ensure that GC info is not changing between
201
197
// "call has been made" and "call has returned" states.
202
- if (livenessChanged )
198
+ if (genWillUpdateLife (block-> bbLiveIn ) )
203
199
{
204
200
if (GetEmitter ()->emitLastInsIsCallWithGC ())
205
201
{
202
+ printf (" ####################\n " );
206
203
instGen (INS_nop);
207
204
}
208
205
}
209
206
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
+
210
211
// Even if liveness didn't change, we need to update the registers containing GC references.
211
212
// genUpdateLife will update the registers live due to liveness changes. But what about registers that didn't
212
213
// 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
8516
8516
// Update the GC's masks, register's masks and reports change on variable's homes given a set of
8517
8517
// current live variables if changes have happened since "compCurLife".
8518
8518
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
+ }
8520
8525
8521
8526
// Gets a register mask that represent the kill set for a helper call since
8522
8527
// 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
3543
3543
// The set of live variables reflects the result of only emitted code, it should not be considering the becoming
3544
3544
// live/dead of instructions that has not been emitted yet. This is requires by "compChangeLife".
3545
3545
template <bool ForCodeGen>
3546
- inline bool Compiler::compUpdateLife (VARSET_VALARG_TP newLife)
3546
+ inline void Compiler::compUpdateLife (VARSET_VALARG_TP newLife)
3547
3547
{
3548
3548
if (!VarSetOps::Equal (this , compCurLife, newLife))
3549
3549
{
3550
3550
compChangeLife<ForCodeGen>(newLife);
3551
- return true ;
3552
3551
}
3553
3552
#ifdef DEBUG
3554
3553
else
@@ -3561,8 +3560,6 @@ inline bool Compiler::compUpdateLife(VARSET_VALARG_TP newLife)
3561
3560
}
3562
3561
}
3563
3562
#endif // DEBUG
3564
-
3565
- return false ;
3566
3563
}
3567
3564
3568
3565
/* ****************************************************************************
You can’t perform that action at this time.
0 commit comments