<FeaturePerfTracing>true</FeaturePerfTracing>
<FeatureTypeEquivalence>true</FeatureTypeEquivalence>
<FeatureBasicFreeze>true</FeatureBasicFreeze>
- <FeatureDefaultInterfaces>true</FeatureDefaultInterfaces>
<ProfilingSupportedBuild>true</ProfilingSupportedBuild>
</PropertyGroup>
<DefineConstants Condition="'$(FeaturePerfTracing)' == 'true'">$(DefineConstants);FEATURE_PERFTRACING</DefineConstants>
<DefineConstants Condition="'$(FeatureXplatEventSource)' == 'true'">$(DefineConstants);FEATURE_EVENTSOURCE_XPLAT</DefineConstants>
<DefineConstants Condition="'$(FeatureWin32Registry)' == 'true'">$(DefineConstants);FEATURE_WIN32_REGISTRY</DefineConstants>
- <DefineConstants Condition="'$(FeatureDefaultInterfaces)' == 'true'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants>
<DefineConstants Condition="'$(FeatureTypeEquivalence)' == 'true'">$(DefineConstants);FEATURE_TYPEEQUIVALENCE</DefineConstants>
<DefineConstants Condition="'$(FeatureBasicFreeze)' == 'true'">$(DefineConstants);FEATURE_BASICFREEZE</DefineConstants>
<DefineConstants Condition="'$(FeaturePortableShuffleThunks)' == 'true'">$(DefineConstants);FEATURE_PORTABLE_SHUFFLE_THUNKS</DefineConstants>
throw new ArgumentException(SR.Arg_NoStaticVirtual);
}
-#if !FEATURE_DEFAULT_INTERFACES
- if ((attributes & MethodAttributes.SpecialName) != MethodAttributes.SpecialName)
- {
- if ((type.Attributes & TypeAttributes.Interface) == TypeAttributes.Interface)
- {
- // methods on interface have to be abstract + virtual except special name methods such as type initializer
- if ((attributes & (MethodAttributes.Abstract | MethodAttributes.Virtual)) !=
- (MethodAttributes.Abstract | MethodAttributes.Virtual) &&
- (attributes & MethodAttributes.Static) == 0)
- throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod);
- }
- }
-#endif
-
m_callingConvention = callingConvention;
if (parameterTypes != null)
ThrowIfCreated();
-#if !FEATURE_DEFAULT_INTERFACES
- if (!m_isHiddenGlobalType)
- {
- if (((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface) &&
- (attributes & MethodAttributes.Abstract) == 0 && (attributes & MethodAttributes.Static) == 0)
- throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod);
- }
-#endif
-
// pass in Method attributes
MethodBuilder method = new MethodBuilder(
name, attributes, callingConvention,
#define VALIDATE_ROOT(isInterior, hCallBack, pObjRef)
-#define _ASSERTE(x) assert(x)
-
#define UINT32 UInt32
#define INT32 Int32
#define UINT16 UInt16
#define GET_CALLER_SP(pREGDISPLAY) ((TADDR)0)
+struct GCInfoToken
+{
+ PTR_VOID Info;
+ UINT32 Version;
+
+ GCInfoToken(PTR_VOID info)
+ {
+ Info = info;
+ Version = 2;
+ }
+};
+
#else // FEATURE_REDHAWK
// Stuff from cgencpu.h:
private readonly FieldLayoutAlgorithm _fallbackAlgorithm;
private readonly bool _vectorAbiIsStable;
- public VectorFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm, bool vectorAbiIsStable)
+ public VectorFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm, bool vectorAbiIsStable = true)
{
_vectorAbiIsStable = vectorAbiIsStable;
_fallbackAlgorithm = fallbackAlgorithm;
/// Stores a cached version of the canonicalized form of this method since
/// calculating it is a recursive operation
/// </summary>
- InstantiatedMethod _specificCanonCache = null;
- InstantiatedMethod _universalCanonCache = null;
+ InstantiatedMethod _specificCanonCache;
+ InstantiatedMethod _universalCanonCache;
/// <summary>
/// Returns the result of canonicalizing this method over the given kind of Canon
/// Returns a new instantiation that canonicalizes all types in <paramref name="instantiation"/>
/// if possible under the policy of '<paramref name="kind"/>'
/// </summary>
+ /// <param name="instantiation">Instantiation to canonicalize.</param>
+ /// <param name="kind">The type of cannonicalization to apply.</param>
/// <param name="changed">True if the returned instantiation is different from '<paramref name="instantiation"/>'.</param>
public static Instantiation ConvertInstantiationToCanonForm(Instantiation instantiation, CanonicalFormKind kind, out bool changed)
{
return instantiation;
}
- /// <summary>
- /// Helper API to convert a type to its canonical or universal canonical form.
- /// Note that for now, there is no mixture between specific canonical and universal canonical forms,
- /// meaning that the canonical form or Foo<string, int> can either be Foo<__Canon, int> or
- /// Foo<__UniversalCanon, __UniversalCanon>. It cannot be Foo<__Canon, __UniversalCanon> (yet)
- /// for simplicity. We can always change that rule in the futue and add support for the mixture, but
- /// for now we are keeping it simple.
- /// </summary>
+ // Helper API to convert a type to its canonical or universal canonical form.
+ // Note that for now, there is no mixture between specific canonical and universal canonical forms,
+ // meaning that the canonical form or Foo<string, int> can either be Foo<__Canon, int> or
+ // Foo<__UniversalCanon, __UniversalCanon>. It cannot be Foo<__Canon, __UniversalCanon> (yet)
+ // for simplicity. We can always change that rule in the futue and add support for the mixture, but
+ // for now we are keeping it simple.
public static TypeDesc ConvertToCanon(TypeDesc typeToConvert, CanonicalFormKind kind)
{
// Wrap the call to the version that potentially modifies the parameter. External
/// Stores a cached version of the canonicalized form of this type since
/// calculating it is a recursive operation
/// </summary>
- TypeDesc _specificCanonCache = null;
- TypeDesc _universalCanonCache = null;
+ TypeDesc _specificCanonCache;
+ TypeDesc _universalCanonCache;
TypeDesc GetCachedCanonValue(CanonicalFormKind kind)
{
switch (kind)
// Includes canonicalization objects local to a particular context
public partial class TypeSystemContext
{
- private CanonType _canonType = null;
+ private CanonType _canonType;
/// <summary>
/// Instance of System.__Canon for this context
/// </summary>
}
}
- private UniversalCanonType _universalCanonType = null;
+ private UniversalCanonType _universalCanonType;
/// <summary>
/// Instance of System.__UniversalCanon for this context
/// </summary>
/// A type can be substituted for the generic type parameter only if it is a reference type.
/// </summary>
ReferenceTypeConstraint = 0x04,
-
+
/// <summary>
- // A type can be substituted for the generic type parameter only if it is a value
- // type and is not nullable.
+ /// A type can be substituted for the generic type parameter only if it is a value
+ /// type and is not nullable.
/// </summary>
NotNullableValueTypeConstraint = 0x08,
public sealed partial class InstantiatedType : MetadataType
{
- private DefType[] _implementedInterfaces = null;
+ private DefType[] _implementedInterfaces;
private DefType[] InitializeImplementedInterfaces()
{
- return InstantiateTypeArray(_typeDef.ExplicitlyImplementedInterfaces, _instantiation, new Instantiation());
-
// TODO Add duplicate detection
+ return (_implementedInterfaces = InstantiateTypeArray(_typeDef.ExplicitlyImplementedInterfaces, _instantiation, new Instantiation()));
}
/// <summary>
private class UnificationGroup
{
private MethodDesc[] _members = MethodDesc.EmptyMethods;
- private int _memberCount = 0;
+ private int _memberCount;
private MethodDesc[] _methodsRequiringSlotUnification = MethodDesc.EmptyMethods;
- private int _methodsRequiringSlotUnificationCount = 0;
+ private int _methodsRequiringSlotUnificationCount;
/// <summary>
/// Custom enumerator struct for Unification group. Makes enumeration require 0 allocations.
/// _count is used in combination with _resizeCount to control when the
/// hashtable should expand
/// </summary>
- private volatile int _count = 0;
+ private volatile int _count;
/// <summary>
/// Represents _count plus the number of potential adds currently happening.
/// If this reaches _hashTable.Length-1, an expansion is required (because
/// one slot must always be null for seeks to complete).
/// </summary>
- private int _reserve = 0;
+ private int _reserve;
/// <summary>
/// _resizeCount represents the size at which the hashtable should resize.
public abstract class VirtualMethodAlgorithm
{
/// <summary>
- /// Resolves interface method '<paramref name="interfaceMethod"/>' to a method on '<paramref name="type"/>'
+ /// Resolves interface method '<paramref name="interfaceMethod"/>' to a method on '<paramref name="currentType"/>'
/// that implements the the method.
/// </summary>
public abstract MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, TypeDesc currentType);
private LocalVariableDefinition[] _locals;
private ILExceptionRegion[] _ilExceptionRegions;
- // TODO: Remove: Workaround for missing ClearInitLocals transforms in CoreRT CoreLib
- private readonly bool _clearInitLocals;
-
- public static EcmaMethodIL Create(EcmaMethod method, bool clearInitLocals = false)
+ public static EcmaMethodIL Create(EcmaMethod method)
{
var rva = method.MetadataReader.GetMethodDefinition(method.Handle).RelativeVirtualAddress;
if (rva == 0)
return null;
- return new EcmaMethodIL(method, rva, clearInitLocals);
+ return new EcmaMethodIL(method, rva);
}
- private EcmaMethodIL(EcmaMethod method, int rva, bool clearInitLocals)
+ private EcmaMethodIL(EcmaMethod method, int rva)
{
_method = method;
_module = method.Module;
_methodBody = _module.PEReader.GetMethodBody(rva);
-
- _clearInitLocals = clearInitLocals;
}
public EcmaModule Module
{
get
{
- return !_clearInitLocals && _methodBody.LocalVariablesInitialized;
+ return _methodBody.LocalVariablesInitialized;
}
}
codeStream.Emit(ILOpcode.brfalse, lNullArray);
// allocate memory
- // nativeParameter = (byte**)CoTaskMemAllocAndZeroMemory((IntPtr)(checked(managedParameter.Length * sizeof(byte*))));
+ // nativeParameter = AllocCoTaskMem(checked(managedParameter.Length * sizeof(NativeElementType)));
// loads the number of elements
EmitElementCount(codeStream, MarshalDirection.Forward);
private DefType _similarVectorOpenType;
private bool _vectorAbiIsStable;
- public VectorOfTFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm, FieldLayoutAlgorithm vectorFallbackAlgorithm, string similarVector, bool vectorAbiIsStable)
+ public VectorOfTFieldLayoutAlgorithm(FieldLayoutAlgorithm fallbackAlgorithm, FieldLayoutAlgorithm vectorFallbackAlgorithm, string similarVector, bool vectorAbiIsStable = true)
{
_fallbackAlgorithm = fallbackAlgorithm;
_vectorFallbackAlgorithm = vectorFallbackAlgorithm;
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-
#include "common.h"
#include "gcinfodecoder.h"
if (hasGSCookie)
{
// Note that normalization as a code offset can be different than
- // normalization as code legnth
+ // normalization as code length
UINT32 normCodeLength = NORMALIZE_CODE_OFFSET(m_CodeLength);
// Decode prolog/epilog information
if (hasReversePInvokeFrame)
{
- m_ReversePInvokeFrameStackSlot = (INT32)m_Reader.DecodeVarLengthSigned(REVERSE_PINVOKE_FRAME_ENCBASE);
+ m_ReversePInvokeFrameStackSlot = (INT32)DENORMALIZE_STACK_SLOT(m_Reader.DecodeVarLengthSigned(REVERSE_PINVOKE_FRAME_ENCBASE));
}
else
{
else if(flags & DECODE_FOR_RANGES_CALLBACK)
{
// Note that normalization as a code offset can be different than
- // normalization as code legnth
+ // normalization as code length
UINT32 normCodeLength = NORMALIZE_CODE_OFFSET(m_CodeLength);
UINT32 numBitsPerOffset = CeilOfLog2(normCodeLength);
EnumerateInterruptibleRangesCallback *pCallback,
void * hCallback)
{
- // If no info is found for the call site, we default to fully-interruptbile
+ // If no info is found for the call site, we default to fully-interruptible
LOG((LF_GCROOTS, LL_INFO1000000, "No GC info found for call site at offset %x. Defaulting to fully-interruptible information.\n", (int) m_InstructionOffset));
UINT32 lastInterruptibleRangeStopOffsetNormalized = 0;
_ASSERTE(m_NumInterruptibleRanges);
_ASSERTE(numInterruptibleLength);
- // If no info is found for the call site, we default to fully-interruptbile
+ // If no info is found for the call site, we default to fully-interruptible
LOG((LF_GCROOTS, LL_INFO1000000, "No GC info found for call site at offset %x. Defaulting to fully-interruptible information.\n", (int) m_InstructionOffset));
UINT32 numChunks = (numInterruptibleLength + NUM_NORM_CODE_OFFSETS_PER_CHUNK - 1) / NUM_NORM_CODE_OFFSETS_PER_CHUNK;
return (OBJECTREF*)*(ppRax + regNum);
}
-#ifdef TARGET_UNIX
+#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK)
OBJECTREF* GcInfoDecoder::GetCapturedRegister(
int regNum,
PREGDISPLAY pRD
return (OBJECTREF*)(pRax + regNum);
}
-#endif // TARGET_UNIX
+#endif // TARGET_UNIX && !FEATURE_REDHAWK
bool GcInfoDecoder::IsScratchRegister(int regNum, PREGDISPLAY pRD)
{
LOG((LF_GCROOTS, LL_INFO1000, "Reporting " FMT_REG, regNum ));
OBJECTREF* pObjRef = GetRegisterSlot( regNum, pRD );
-#if defined(TARGET_UNIX) && !defined(SOS_TARGET_AMD64)
+#if defined(TARGET_UNIX) && !defined(FEATURE_REDHAWK) && !defined(SOS_TARGET_AMD64)
// On PAL, we don't always have the context pointers available due to
// a limitation of an unwinding library. In such case, the context
// pointers for some nonvolatile registers are NULL.
gcFlags |= GC_CALL_PINNED;
}
-#endif // TARGET_UNIX && !SOS_TARGET_AMD64
+#endif // TARGET_UNIX && !FEATURE_REDHAWK && !SOS_TARGET_AMD64
#ifdef _DEBUG
if(IsScratchRegister(regNum, pRD))
GCINFODECODER_CONTRACT;
OBJECTREF* pObjRef = GetStackSlot(spOffset, spBase, pRD);
- _ASSERTE( IS_ALIGNED( pObjRef, sizeof( Object* ) ) );
+ _ASSERTE(IS_ALIGNED(pObjRef, sizeof(OBJECTREF*)));
#ifdef _DEBUG
LOG((LF_GCROOTS, LL_INFO1000, /* Part One */
updatedTimes[0].tv_nsec = (long)times[0].tv_nsec;
updatedTimes[1].tv_sec = (time_t)times[1].tv_sec;
- updatedTimes[1].tv_nsec = (long)times[1].tv_nsec;
+ updatedTimes[1].tv_nsec = (long)times[1].tv_nsec;
while (CheckInterrupted(result = utimensat(AT_FDCWD, path, updatedTimes, 0)));
#else
struct timeval updatedTimes[2];
updatedTimes[0].tv_sec = (long)times[0].tv_sec;
updatedTimes[0].tv_usec = (int)times[0].tv_nsec / 1000;
-
+
updatedTimes[1].tv_sec = (long)times[1].tv_sec;
updatedTimes[1].tv_usec = (int)times[1].tv_nsec / 1000;
while (CheckInterrupted(result = utimes(path, updatedTimes)));
<TargetFrameworks>$(NetCoreAppCurrent)</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
- <Compile Include="System\Diagnostics\StackFrameExtensions.cs" />
<Compile Include="System\Diagnostics\StackTraceSymbols.cs" />
<Compile Include="System\Diagnostics\SymbolStore\ISymbolBinder.cs" />
<Compile Include="System\Diagnostics\SymbolStore\ISymbolDocument.cs" />
<data name="Argument_AttributeNamesMustBeUnique" xml:space="preserve">
<value>Attribute names must be unique.</value>
</data>
- <data name="Argument_BadAttributeOnInterfaceMethod" xml:space="preserve">
- <value>Interface method must be abstract and virtual.</value>
- </data>
<data name="Argument_BadConstantValue" xml:space="preserve">
<value>Bad default value.</value>
</data>
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\DebuggerVisualizerAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\DebugProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\StackFrame.cs" />
+ <Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\StackFrameExtensions.cs" Condition="'$(TargetsCoreRT)' != 'true'" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\StackTrace.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\StackTraceHiddenAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Diagnostics\Stopwatch.cs" />
/// </summary>
public const string PortablePdb = nameof(PortablePdb);
-#if FEATURE_DEFAULT_INTERFACES
/// <summary>
/// Indicates that this version of runtime supports default interface method implementations.
/// </summary>
public const string DefaultImplementationsOfInterfaces = nameof(DefaultImplementationsOfInterfaces);
-#endif
/// <summary>
/// Indicates that this version of runtime supports the Unmanaged calling convention value.
case PortablePdb:
case CovariantReturnsOfClasses:
case UnmanagedSignatureCallingConvention:
-#if FEATURE_DEFAULT_INTERFACES
case DefaultImplementationsOfInterfaces:
-#endif
return true;
case nameof(IsDynamicCodeSupported):
return IsDynamicCodeSupported;
<FeaturePortableTimer Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableTimer>
<FeaturePortableThreadPool Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePortableThreadPool>
<FeaturePerfTracing Condition="'$(TargetsBrowser)' != 'true'">true</FeaturePerfTracing>
- <FeatureDefaultInterfaces>true</FeatureDefaultInterfaces>
</PropertyGroup>
<PropertyGroup>
<DefineConstants Condition="'$(FeatureManagedEtw)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW</DefineConstants>
<DefineConstants Condition="'$(FeatureManagedEtwChannels)' == 'true'">$(DefineConstants);FEATURE_MANAGED_ETW_CHANNELS</DefineConstants>
<DefineConstants Condition="'$(FeaturePerfTracing)' == 'true'">$(DefineConstants);FEATURE_PERFTRACING</DefineConstants>
- <DefineConstants Condition="'$(FeatureDefaultInterfaces)' == 'true'">$(DefineConstants);FEATURE_DEFAULT_INTERFACES</DefineConstants>
</PropertyGroup>
<!-- ILLinker settings -->