-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Remove unnecessary GcInfoEncoder::DoNotTrackInPartiallyInterruptible
#113078
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 |
---|---|---|
|
@@ -909,97 +909,6 @@ void GcInfoEncoder::FinalizeSlotIds() | |
#endif | ||
} | ||
|
||
#ifdef PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED | ||
|
||
// tells whether a slot cannot contain an object reference | ||
// at call instruction or right after returning | ||
bool GcInfoEncoder::DoNotTrackInPartiallyInterruptible(GcSlotDesc &slotDesc) | ||
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. I think this was an optimization in the past to filter out volatile registers early. Now that we record everything that is alive, the filtering is pointless indeed. |
||
{ | ||
#if defined(TARGET_ARM) | ||
|
||
_ASSERTE( m_SizeOfStackOutgoingAndScratchArea != (UINT32)-1 ); | ||
if(slotDesc.IsRegister()) | ||
{ | ||
int regNum = (int) slotDesc.Slot.RegisterNumber; | ||
_ASSERTE(regNum >= 0 && regNum <= 14); | ||
_ASSERTE(regNum != 13); // sp | ||
|
||
return ((regNum <= 3) || (regNum >= 12)) // R12 is volatile and SP/LR can't contain objects around calls | ||
&& regNum != 0 // R0 can contain return value | ||
; | ||
} | ||
else if (!slotDesc.IsUntracked() && (slotDesc.Slot.Stack.Base == GC_SP_REL) && | ||
((UINT32)slotDesc.Slot.Stack.SpOffset < m_SizeOfStackOutgoingAndScratchArea)) | ||
{ | ||
return TRUE; | ||
} | ||
else | ||
return FALSE; | ||
|
||
#elif defined(TARGET_ARM64) | ||
|
||
_ASSERTE(m_SizeOfStackOutgoingAndScratchArea != (UINT32)-1); | ||
if (slotDesc.IsRegister()) | ||
{ | ||
int regNum = (int)slotDesc.Slot.RegisterNumber; | ||
_ASSERTE(regNum >= 0 && regNum <= 30); | ||
_ASSERTE(regNum != 18); | ||
|
||
return (regNum <= 17 || regNum >= 29) // X0 through X17 are scratch, FP/LR can't be used for objects around calls | ||
&& regNum != 0 // X0 can contain return value | ||
&& regNum != 1 // X1 can contain return value | ||
; | ||
} | ||
else if (!slotDesc.IsUntracked() && (slotDesc.Slot.Stack.Base == GC_SP_REL) && | ||
((UINT32)slotDesc.Slot.Stack.SpOffset < m_SizeOfStackOutgoingAndScratchArea)) | ||
{ | ||
return TRUE; | ||
} | ||
else | ||
return FALSE; | ||
|
||
#elif defined(TARGET_AMD64) | ||
|
||
_ASSERTE( m_SizeOfStackOutgoingAndScratchArea != (UINT32)-1 ); | ||
if(slotDesc.IsRegister()) | ||
{ | ||
int regNum = (int) slotDesc.Slot.RegisterNumber; | ||
_ASSERTE(regNum >= 0 && regNum <= 16); | ||
_ASSERTE(regNum != 4); // rsp | ||
|
||
UINT16 PreservedRegMask = | ||
(1 << 3) // rbx | ||
| (1 << 5) // rbp | ||
#ifndef UNIX_AMD64_ABI | ||
| (1 << 6) // rsi | ||
| (1 << 7) // rdi | ||
#endif // UNIX_AMD64_ABI | ||
| (1 << 12) // r12 | ||
| (1 << 13) // r13 | ||
| (1 << 14) // r14 | ||
| (1 << 15) // r15 | ||
| (1 << 0) // rax - may contain return value | ||
#ifdef UNIX_AMD64_ABI | ||
| (1 << 2) // rdx - may contain return value | ||
#endif | ||
; | ||
|
||
return !(PreservedRegMask & (1 << regNum)); | ||
} | ||
else if (!slotDesc.IsUntracked() && (slotDesc.Slot.Stack.Base == GC_SP_REL) && | ||
((UINT32)slotDesc.Slot.Stack.SpOffset < m_SizeOfStackOutgoingAndScratchArea)) | ||
{ | ||
return TRUE; | ||
} | ||
else | ||
return FALSE; | ||
|
||
#else | ||
return FALSE; | ||
#endif | ||
} | ||
#endif // PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED | ||
|
||
void GcInfoEncoder::Build() | ||
{ | ||
#ifdef _DEBUG | ||
|
@@ -1389,14 +1298,11 @@ void GcInfoEncoder::Build() | |
else | ||
{ | ||
UINT32 slotIndex = pCurrent->SlotId; | ||
if(!DoNotTrackInPartiallyInterruptible(m_SlotTable[slotIndex])) | ||
{ | ||
BYTE becomesLive = pCurrent->BecomesLive; | ||
_ASSERTE((liveState.ReadBit(slotIndex) && !becomesLive) | ||
|| (!liveState.ReadBit(slotIndex) && becomesLive)); | ||
BYTE becomesLive = pCurrent->BecomesLive; | ||
_ASSERTE((liveState.ReadBit(slotIndex) && !becomesLive) | ||
|| (!liveState.ReadBit(slotIndex) && becomesLive)); | ||
|
||
liveState.WriteBit(slotIndex, becomesLive); | ||
} | ||
liveState.WriteBit(slotIndex, becomesLive); | ||
pCurrent++; | ||
} | ||
} | ||
|
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.
What are these changes for? (just curious)
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.
superpmi-asmdiffs was not running for this change, even though the gcinfoencoder is statically linked into the JIT and affects its compilation results. This change is ensuring that superpmi-asmdiffs runs even on gcinfoencoder changes (so that we can see diffs).