@@ -879,27 +879,36 @@ void InterpCompiler::BuildGCInfo(InterpMethod *pInterpMethod)
879
879
for (int i = 0 ; i < m_varsSize; i++)
880
880
{
881
881
InterpVar *pVar = &m_pVars[i];
882
- if (pVar->interpType != InterpTypeO)
883
- continue ;
882
+ GcSlotFlags flags;
883
+ switch (pVar->interpType ) {
884
+ case InterpTypeO:
885
+ flags = (GcSlotFlags)(pVar->global ? GC_SLOT_UNTRACKED : 0 );
886
+ break ;
887
+ case InterpTypeByRef:
888
+ flags = (GcSlotFlags)(pVar->global ? GC_SLOT_UNTRACKED | GC_SLOT_INTERIOR : GC_SLOT_INTERIOR);
889
+ break ;
890
+ default :
891
+ continue ;
892
+ }
884
893
885
- // Globals are untracked and shouldn't need liveness ranges recorded in the info
886
- GcSlotFlags flags = (GcSlotFlags)(pVar->global ? GC_SLOT_UNTRACKED : 0 );
887
894
uint32_t slotIndex = pVar->offset / INTERP_STACK_SLOT_SIZE;
888
895
if (slotsByOffset[slotIndex] == ((GcSlotId)-1 ))
889
896
{
890
897
// Important to pass GC_xxx_REL, the default is broken due to GET_CALLER_SP being unimplemented
891
898
slotsByOffset[slotIndex] = gcInfoEncoder->GetStackSlotId (pVar->offset , flags, GC_FRAMEREG_REL);
892
899
INTERP_DUMP (
893
- " Allocated gcinfo slot %u for %svar #%d at offset %d\n " ,
900
+ " Allocated gcinfo slot %u for %s% svar #%d at offset %d\n " ,
894
901
slotsByOffset[slotIndex], pVar->global ? " global " : " " ,
902
+ pVar->interpType == InterpTypeByRef ? " byref " : " " ,
895
903
i, pVar->offset
896
904
);
897
905
}
898
906
else
899
907
{
900
908
INTERP_DUMP (
901
- " Reused gcinfo slot %u for %svar #%d at offset %d\n " ,
909
+ " Reused gcinfo slot %u for %s% svar #%d at offset %d\n " ,
902
910
slotsByOffset[slotIndex], pVar->global ? " global " : " " ,
911
+ pVar->interpType == InterpTypeByRef ? " byref " : " " ,
903
912
i, pVar->offset
904
913
);
905
914
assert (!pVar->global );
@@ -913,7 +922,7 @@ void InterpCompiler::BuildGCInfo(InterpMethod *pInterpMethod)
913
922
{
914
923
InterpVar *pVar = &m_pVars[i];
915
924
// Even if we have a gc slot for this offset, this var might not be an object reference
916
- if (pVar->interpType != InterpTypeO)
925
+ if (( pVar->interpType != InterpTypeO) && (pVar-> interpType != InterpTypeByRef) )
917
926
continue ;
918
927
// We don't need to report liveness ranges for untracked vars, the gc info decoder will report them
919
928
// unconditionally.
0 commit comments