}
NativeFieldDescriptor::NativeFieldDescriptor()
- :m_nativeSize(1),
- m_alignmentRequirement(1),
- m_offset(0),
+ :m_offset(0),
m_flags(NATIVE_FIELD_CATEGORY_ILLEGAL),
m_isNestedType(false)
{
+ nativeSizeAndAlignment.m_nativeSize = 1;
+ nativeSizeAndAlignment.m_alignmentRequirement = 1;
m_pFD.SetValueMaybeNull(nullptr);
}
NativeFieldDescriptor::NativeFieldDescriptor(NativeFieldFlags flags, ULONG nativeSize, ULONG alignment)
- :m_nativeSize(nativeSize),
- m_alignmentRequirement(alignment),
- m_offset(0),
+ :m_offset(0),
m_flags(flags),
m_isNestedType(false)
{
+ nativeSizeAndAlignment.m_nativeSize = nativeSize;
+ nativeSizeAndAlignment.m_alignmentRequirement = alignment;
m_pFD.SetValueMaybeNull(nullptr);
}
CONTRACTL_END;
m_pFD.SetValueMaybeNull(nullptr);
- m_pNestedType.SetValue(pMT);
- m_numElements = numElements;
+ nestedTypeAndCount.m_pNestedType.SetValue(pMT);
+ nestedTypeAndCount.m_numElements = numElements;
m_flags = isBlittable ? NATIVE_FIELD_CATEGORY_NESTED_BLITTABLE : NATIVE_FIELD_CATEGORY_NESTED;
m_isNestedType = true;
}
m_pFD.SetValueMaybeNull(other.m_pFD.GetValueMaybeNull());
if (m_isNestedType)
{
- m_pNestedType.SetValueMaybeNull(other.m_pNestedType.GetValueMaybeNull());
- m_numElements = other.m_numElements;
+ nestedTypeAndCount.m_pNestedType.SetValueMaybeNull(other.nestedTypeAndCount.m_pNestedType.GetValueMaybeNull());
+ nestedTypeAndCount.m_numElements = other.nestedTypeAndCount.m_numElements;
}
else
{
- m_nativeSize = other.m_nativeSize;
- m_alignmentRequirement = other.m_alignmentRequirement;
+ nativeSizeAndAlignment.m_nativeSize = other.nativeSizeAndAlignment.m_nativeSize;
+ nativeSizeAndAlignment.m_alignmentRequirement = other.nativeSizeAndAlignment.m_alignmentRequirement;
}
}
if (m_isNestedType)
{
- m_pNestedType.SetValueMaybeNull(other.m_pNestedType.GetValueMaybeNull());
- m_numElements = other.m_numElements;
+ nestedTypeAndCount.m_pNestedType.SetValueMaybeNull(other.nestedTypeAndCount.m_pNestedType.GetValueMaybeNull());
+ nestedTypeAndCount.m_numElements = other.nestedTypeAndCount.m_numElements;
}
else
{
- m_nativeSize = other.m_nativeSize;
- m_alignmentRequirement = other.m_alignmentRequirement;
+ nativeSizeAndAlignment.m_nativeSize = other.nativeSizeAndAlignment.m_nativeSize;
+ nativeSizeAndAlignment.m_alignmentRequirement = other.nativeSizeAndAlignment.m_alignmentRequirement;
}
return *this;
}
CONTRACT_END;
- RETURN m_pNestedType.GetValue();
+ RETURN nestedTypeAndCount.m_pNestedType.GetValue();
}
PTR_FieldDesc NativeFieldDescriptor::GetFieldDesc() const
WRAPPER_NO_CONTRACT;
#ifdef FEATURE_PREJIT
- return m_pNestedType.IsNull() || (!m_pNestedType.IsTagged() && m_pNestedType.GetValue()->IsRestored());
+ return nestedTypeAndCount.m_pNestedType.IsNull() || (!nestedTypeAndCount.m_pNestedType.IsTagged() && nestedTypeAndCount.m_pNestedType.GetValue()->IsRestored());
#else // FEATURE_PREJIT
// putting the IsFullyLoaded check here is tempting but incorrect
return TRUE;
THROWS;
GC_TRIGGERS;
MODE_ANY;
- PRECONDITION(!m_isNestedType || CheckPointer(m_pNestedType.GetValue()));
+ PRECONDITION(!m_isNestedType || CheckPointer(nestedTypeAndCount.m_pNestedType.GetValue()));
}
CONTRACTL_END;
{
#ifdef FEATURE_PREJIT
- Module::RestoreMethodTablePointer(&m_pNestedType);
+ Module::RestoreMethodTablePointer(&nestedTypeAndCount.m_pNestedType);
#else // FEATURE_PREJIT
// without NGEN we only have to make sure that the type is fully loaded
- PTR_MethodTable pMT = m_pNestedType.GetValue();
+ PTR_MethodTable pMT = nestedTypeAndCount.m_pNestedType.GetValue();
if (pMT != NULL)
ClassLoader::EnsureLoaded(pMT);
#endif // FEATURE_PREJIT
if (m_isNestedType)
{
- image->FixupMethodTablePointer(this, &m_pNestedType);
+ image->FixupMethodTablePointer(this, &nestedTypeAndCount.m_pNestedType);
}
}
#endif // defined(FEATURE_PREJIT) && !defined(DACCESS_COMPILE)
}
CONTRACTL_END;
- return m_numElements;
+ return nestedTypeAndCount.m_numElements;
}
UINT32 NativeSize() const
}
else
{
- return m_nativeSize;
+ return nativeSizeAndAlignment.m_nativeSize;
}
}
}
else
{
- return m_alignmentRequirement;
+ return nativeSizeAndAlignment.m_alignmentRequirement;
}
}
{
RelativeFixupPointer<PTR_MethodTable> m_pNestedType;
ULONG m_numElements;
- };
+ } nestedTypeAndCount;
struct
{
UINT32 m_nativeSize;
UINT32 m_alignmentRequirement;
- };
+ } nativeSizeAndAlignment;
};
UINT32 m_offset;
NativeFieldFlags m_flags;