Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -1011,20 +1011,28 @@ private void getFieldInfo(ref CORINFO_RESOLVED_TOKEN pResolvedToken, CORINFO_MET
}
else
{
if ((flags & CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_ADDRESS) != 0)
{
throw new RequiresRuntimeJitException("https://github.com/dotnet/runtime/issues/32663: CORINFO_FIELD_STATIC_ADDRESS");
}

helperId = field.HasGCStaticBase ?
ReadyToRunHelperId.GetGCStaticBase :
ReadyToRunHelperId.GetNonGCStaticBase;

//
// Currently, we only do this optimization for regular statics, but it
// looks like it may be permissible to do this optimization for
// thread statics as well.
//
// thread statics as well. Currently there's no reason to do this
// as this code is not reachable until we implement CORINFO_FIELD_STATIC_ADDRESS
// which is something Crossgen1 doesn't do (cf. the above GitHub issue 32663).
/*
if ((flags & CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_ADDRESS) != 0 &&
(fieldAccessor != CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_STATIC_TLS))
{
fieldFlags |= CORINFO_FIELD_FLAGS.CORINFO_FLG_FIELD_SAFESTATIC_BYREF_RETURN;
}
*/
}

if (!_compilation.NodeFactory.CompilationModuleGroup.VersionsWithType(field.OwningType) &&
Expand Down Expand Up @@ -2053,8 +2061,7 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult,
{
if (pMT.IsValueType)
{
// ENCODE_CHECK_FIELD_OFFSET
// TODO: root field check import
throw new NotImplementedException("https://github.com/dotnet/runtime/issues/32630: ENCODE_CHECK_FIELD_OFFSET: root field check import");
}
else
{
Expand Down Expand Up @@ -2090,6 +2097,7 @@ private void EncodeFieldBaseOffset(FieldDesc field, CORINFO_FIELD_INFO* pResult,
PreventRecursiveFieldInlinesOutsideVersionBubble(field, callerMethod);

// ENCODE_FIELD_BASE_OFFSET
Debug.Assert(pResult->offset >= (uint)pMT.BaseType.InstanceByteCount.AsInt);
pResult->offset -= (uint)pMT.BaseType.InstanceByteCount.AsInt;
pResult->fieldAccessor = CORINFO_FIELD_ACCESSOR.CORINFO_FIELD_INSTANCE_WITH_BASE;
pResult->fieldLookup = CreateConstLookupToSymbol(_compilation.SymbolNodeFactory.FieldBaseOffset(field.OwningType));
Expand Down