Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/coreclr/vm/ceeload.inl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ TYPE LookupMap<TYPE>::GetValueAt(PTR_TADDR pValue, TADDR* pFlags, TADDR supporte
WRAPPER_NO_CONTRACT;
SUPPORTS_DAC;
#ifndef DACCESS_COMPILE
TYPE value = dac_cast<TYPE>(VolatileLoadWithoutBarrier(pValue)); // LookupMap's hold pointers, so we can use a data dependency instead of an explicit barrier here.
// LookupMap's hold pointers to data which is immutable, so normally we could use a data
// dependency instead of an explicit barrier here. However, the access pattern between
Comment on lines +21 to +22
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar: “LookupMap's hold …” reads as a possessive and is ungrammatical. Consider rephrasing to “LookupMaps hold …” (or “LookupMap holds …”) to avoid confusion in this explanatory comment.

Copilot uses AI. Check for mistakes.
// m_TypeDefToMethodTableMap and m_MethodDefToDescMap/m_FieldDefToDescMap is such that a
// data dependency is not sufficient to ensure that the MethodTable is visible when we
// access the MethodDesc/FieldDesc. Since those loads are independent, we use
// VolatileLoad here to ensure proper ordering.
TYPE value = dac_cast<TYPE>(VolatileLoad(pValue));
#else
TYPE value = dac_cast<TYPE>(*pValue);
#endif
Expand Down Expand Up @@ -51,7 +57,13 @@ SIZE_T LookupMap<SIZE_T>::GetValueAt(PTR_TADDR pValue, TADDR* pFlags, TADDR supp
{
WRAPPER_NO_CONTRACT;

TADDR value = VolatileLoadWithoutBarrier(pValue); // LookupMap's hold pointers, so we can use a data dependency instead of an explicit barrier here.
// LookupMap's hold pointers to data which is immutable, so normally we could use a data
// dependency instead of an explicit barrier here. However, the access pattern between
Comment on lines +60 to +61
Copy link

Copilot AI Feb 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar: “LookupMap's hold …” is ungrammatical (possessive). Consider changing to “LookupMaps hold …” (or “LookupMap holds …”) for clarity.

Copilot uses AI. Check for mistakes.
// m_TypeDefToMethodTableMap and m_MethodDefToDescMap/m_FieldDefToDescMap is such that a
// data dependency is not sufficient to ensure that the MethodTable is visible when we
// access the MethodDesc/FieldDesc. Since those loads are independent, we use
// VolatileLoad here to ensure proper ordering.
TADDR value = VolatileLoad(pValue);

if (pFlags)
*pFlags = value & supportedFlags;
Expand Down
Loading