@@ -17626,15 +17626,15 @@ bool Compiler::gtIsStaticFieldPtrToBoxedStruct(var_types fieldNodeType, CORINFO_
17626
17626
// size - Size of the store in bytes
17627
17627
// pFieldStoreOffset - [out] parameter for the store's offset relative
17628
17628
// to the field local itself
17629
- // pFileStoreSize - [out] parameter for the amount of the field's
17629
+ // pFieldStoreSize - [out] parameter for the amount of the field's
17630
17630
// local's bytes affected by the store
17631
17631
//
17632
17632
// Return Value:
17633
17633
// If the given store affects the given field local, "true, "false"
17634
17634
// otherwise.
17635
17635
//
17636
17636
bool Compiler::gtStoreDefinesField(
17637
- LclVarDsc* fieldVarDsc, ssize_t offset, unsigned size, ssize_t* pFieldStoreOffset, unsigned* pFileStoreSize )
17637
+ LclVarDsc* fieldVarDsc, ssize_t offset, unsigned size, ssize_t* pFieldStoreOffset, unsigned* pFieldStoreSize )
17638
17638
{
17639
17639
ssize_t fieldOffset = fieldVarDsc->lvFldOffset;
17640
17640
unsigned fieldSize = genTypeSize(fieldVarDsc); // No TYP_STRUCT field locals.
@@ -17644,7 +17644,7 @@ bool Compiler::gtStoreDefinesField(
17644
17644
if ((fieldOffset < storeEndOffset) && (offset < fieldEndOffset))
17645
17645
{
17646
17646
*pFieldStoreOffset = (offset < fieldOffset) ? 0 : (offset - fieldOffset);
17647
- *pFileStoreSize = static_cast<unsigned>(min(storeEndOffset, fieldEndOffset) - max(offset, fieldOffset));
17647
+ *pFieldStoreSize = static_cast<unsigned>(min(storeEndOffset, fieldEndOffset) - max(offset, fieldOffset));
17648
17648
17649
17649
return true;
17650
17650
}
@@ -23790,10 +23790,10 @@ unsigned* SsaNumInfo::GetOutlinedNumSlot(Compiler* compiler, unsigned index) con
23790
23790
return SsaNumInfo(COMPOSITE_ENCODING_BIT | ssaNumEncoded);
23791
23791
}
23792
23792
23793
- return SsaNumInfo(ssaNumEncoded | baseNum.m_value);
23793
+ return SsaNumInfo(ssaNumEncoded | ( baseNum.m_value & ~(SIMPLE_NUM_MASK << (index * BITS_PER_SIMPLE_NUM))) );
23794
23794
}
23795
23795
23796
- if (!baseNum.IsInvalid())
23796
+ if (!baseNum.IsInvalid() && !baseNum.HasCompactFormat() )
23797
23797
{
23798
23798
*baseNum.GetOutlinedNumSlot(compiler, index) = ssaNum;
23799
23799
return baseNum;
@@ -23807,11 +23807,23 @@ unsigned* SsaNumInfo::GetOutlinedNumSlot(Compiler* compiler, unsigned index) con
23807
23807
}
23808
23808
23809
23809
// Allocate a new chunk for the field numbers. Once allocated, it cannot be expanded.
23810
- int count = compiler->lvaGetDesc(parentLclNum)->lvFieldCnt;
23811
- JitExpandArrayStack<unsigned>* table = compiler->m_outlinedCompositeSsaNums;
23812
- int outIdx = table->Size();
23813
- unsigned* pLastSlot = &table->GetRef(outIdx + count - 1); // This will grow the table.
23814
- pLastSlot[-(count - 1) + static_cast<int>(index)] = ssaNum;
23810
+ int count = compiler->lvaGetDesc(parentLclNum)->lvFieldCnt;
23811
+ JitExpandArrayStack<unsigned>* table = compiler->m_outlinedCompositeSsaNums;
23812
+ int outIdx = table->Size();
23813
+ unsigned* pLastSlot = &table->GetRef(outIdx + count - 1); // This will grow the table.
23814
+ unsigned* pFirstSlot = pLastSlot - count + 1;
23815
+
23816
+ // Copy over all of the already encoded numbers.
23817
+ if (!baseNum.IsInvalid())
23818
+ {
23819
+ for (int i = 0; i < SIMPLE_NUM_COUNT; i++)
23820
+ {
23821
+ pFirstSlot[i] = baseNum.GetNum(compiler, i);
23822
+ }
23823
+ }
23824
+
23825
+ // Copy the one being set last to overwrite any previous values.
23826
+ pFirstSlot[index] = ssaNum;
23815
23827
23816
23828
// Split the index if it does not fit into a small encoding.
23817
23829
if ((outIdx & ~OUTLINED_INDEX_LOW_MASK) != 0)
0 commit comments