Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dnSpy
Browse files Browse the repository at this point in the history
  • Loading branch information
ElektroKill committed Dec 5, 2024
2 parents 2855a03 + 76b00ae commit 2ca661a
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<InterfaceGroup
CallOnlyWhenLoaded="true">
<NoFilter/>
<Interface Name="IDkmMetaDataPointerInvalidatedNotification"/>
<Interface Name="IDkmModuleModifiedNotification"/>
<Interface Name="IDkmModuleInstanceUnloadNotification"/>
</InterfaceGroup>
Expand Down
12 changes: 4 additions & 8 deletions CSharp/CSharpExpressionCompiler/Symbols/EELocalSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ internal sealed class EELocalSymbol : EELocalSymbolBase
private readonly bool _isCompilerGenerated;
private readonly ImmutableArray<Location> _locations;
private readonly string _nameOpt;
private readonly int _ordinal; // index in locals of containing block
private readonly bool _isPinned;
private readonly RefKind _refKind;
private readonly bool _canScheduleToStack;
Expand Down Expand Up @@ -62,7 +61,7 @@ public EELocalSymbol(
_method = method;
_locations = locations;
_nameOpt = nameOpt;
_ordinal = ordinal;
Ordinal = ordinal;
_declarationKind = declarationKind;
_type = type;
_refKind = refKind;
Expand All @@ -74,11 +73,11 @@ public EELocalSymbol(
internal override EELocalSymbolBase ToOtherMethod(MethodSymbol method, TypeMap typeMap)
{
var type = typeMap.SubstituteType(_type);
return new EELocalSymbol(method, _locations, _nameOpt, _ordinal, _declarationKind, type, _refKind, _isPinned, _isCompilerGenerated, _canScheduleToStack);
return new EELocalSymbol(method, _locations, _nameOpt, Ordinal, _declarationKind, type, _refKind, _isPinned, _isCompilerGenerated, _canScheduleToStack);
}

internal override LocalAndMethodKind LocalAndMethodKind => LocalAndMethodKind.Local;
internal override int Index => _ordinal;
internal override int Index => Ordinal;

internal override LocalDeclarationKind DeclarationKind
{
Expand All @@ -90,10 +89,7 @@ internal override bool CanScheduleToStack
get { return _canScheduleToStack; }
}

internal int Ordinal
{
get { return _ordinal; }
}
internal int Ordinal { get; }

public override string Name
{
Expand Down
4 changes: 3 additions & 1 deletion CSharp/CSharpExpressionCompiler/Symbols/EEMethodSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ internal override bool IsMetadataNewSlot(bool ignoreInterfaceImplementationChang
return false;
}

internal override bool IsMetadataVirtual(bool ignoreInterfaceImplementationChanges = false)
internal override bool IsMetadataVirtual(IsMetadataVirtualOption option = IsMetadataVirtualOption.None)
{
return false;
}
Expand Down Expand Up @@ -770,5 +770,7 @@ internal sealed override bool HasAsyncMethodBuilderAttribute(out TypeSymbol buil
builderArgument = null;
return false;
}

internal override int? TryGetOverloadResolutionPriority() => null;
}
}
14 changes: 5 additions & 9 deletions CSharp/CSharpExpressionCompiler/Symbols/EENamedTypeSymbol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ internal sealed class EENamedTypeSymbol : NamedTypeSymbol
private readonly NamedTypeSymbol _baseType;
private readonly string _name;
private readonly ImmutableArray<TypeParameterSymbol> _typeParameters;
private readonly ImmutableArray<MethodSymbol> _methods;

internal EENamedTypeSymbol(
CompilerKind compiler,
Expand Down Expand Up @@ -54,7 +53,7 @@ internal EENamedTypeSymbol(
this.SourceTypeParameters = sourceTypeParameters;
_typeParameters = getTypeParameters(currentFrame.ContainingType, this);
VerifyTypeParameters(this, _typeParameters);
_methods = getMethods(currentFrame, this);
Methods = getMethods(currentFrame, this);
}

internal EENamedTypeSymbol(
Expand Down Expand Up @@ -94,16 +93,13 @@ internal EENamedTypeSymbol(
this.SubstitutedSourceType = typeMap.SubstituteNamedType(sourceType);
TypeParameterChecker.Check(this.SubstitutedSourceType, _typeParameters);

_methods = getMethods(currentFrame, this);
Methods = getMethods(currentFrame, this);
}

protected override NamedTypeSymbol WithTupleDataCore(TupleExtraData newData)
=> throw ExceptionUtilities.Unreachable();

internal ImmutableArray<MethodSymbol> Methods
{
get { return _methods; }
}
internal ImmutableArray<MethodSymbol> Methods { get; }

internal override IEnumerable<FieldSymbol> GetFieldsToEmit()
{
Expand All @@ -112,7 +108,7 @@ internal override IEnumerable<FieldSymbol> GetFieldsToEmit()

internal override IEnumerable<MethodSymbol> GetMethodsToEmit()
{
return _methods;
return Methods;
}

internal override ImmutableArray<NamedTypeSymbol> GetInterfacesToEmit()
Expand Down Expand Up @@ -174,7 +170,7 @@ public override IEnumerable<string> MemberNames

public override ImmutableArray<Symbol> GetMembers()
{
return _methods.Cast<MethodSymbol, Symbol>();
return Methods.Cast<MethodSymbol, Symbol>();
}

public override ImmutableArray<Symbol> GetMembers(string name)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ internal override bool IsMetadataNewSlot(bool ignoreInterfaceImplementationChang
return false;
}

internal override bool IsMetadataVirtual(bool ignoreInterfaceImplementationChanges = false)
internal override bool IsMetadataVirtual(IsMetadataVirtualOption option = IsMetadataVirtualOption.None)
{
return false;
}
Expand All @@ -284,6 +284,8 @@ internal sealed override bool HasAsyncMethodBuilderAttribute(out TypeSymbol buil
builderArgument = null;
return false;
}

internal override int? TryGetOverloadResolutionPriority() => null;
}

internal partial class PlaceholderMethodSymbol :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ internal override bool IsMetadataNewSlot(bool ignoreInterfaceImplementationChang
throw ExceptionUtilities.Unreachable();
}

internal override bool IsMetadataVirtual(bool ignoreInterfaceImplementationChanges = false)
internal override bool IsMetadataVirtual(IsMetadataVirtualOption option = IsMetadataVirtualOption.None)
{
throw ExceptionUtilities.Unreachable();
}
Expand Down
7 changes: 6 additions & 1 deletion Core/ExpressionCompiler/ExpressionCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Diagnostics;
using System.IO;
using System.Threading;
using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.VisualStudio.Debugger;
using Microsoft.VisualStudio.Debugger.CallStack;
Expand All @@ -23,6 +22,7 @@ namespace Microsoft.CodeAnalysis.ExpressionEvaluator
public abstract class ExpressionCompiler :
IDkmClrExpressionCompiler,
IDkmClrExpressionCompilerCallback,
IDkmMetaDataPointerInvalidatedNotification,
IDkmModuleModifiedNotification,
IDkmModuleInstanceUnloadNotification,
IDkmLanguageFrameDecoder,
Expand Down Expand Up @@ -247,6 +247,11 @@ internal static bool ShouldTryAgainWithMoreMetadataBlocks(DkmUtilities.GetMetada
return false;
}

void IDkmMetaDataPointerInvalidatedNotification.OnMetaDataPointerInvalidated(DkmClrModuleInstance moduleInstance)
{
RemoveDataItemIfNecessary(moduleInstance);
}

void IDkmModuleModifiedNotification.OnModuleModified(DkmModuleInstance moduleInstance)
{
RemoveDataItemIfNecessary(moduleInstance);
Expand Down
1 change: 1 addition & 0 deletions Core/ExpressionCompiler/ExpressionEvaluatorFatalError.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ internal static bool CrashIfFailFastEnabled(Exception exception)
{
switch (dkmException.Code)
{
case DkmExceptionCode.E_METADATA_UPDATE_DEADLOCK: // Metadata was updated while EE had component lock
case DkmExceptionCode.E_PROCESS_DESTROYED:
case DkmExceptionCode.E_XAPI_REMOTE_CLOSED:
case DkmExceptionCode.E_XAPI_REMOTE_DISCONNECTED:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<InterfaceGroup
CallOnlyWhenLoaded="true">
<NoFilter/>
<Interface Name="IDkmMetaDataPointerInvalidatedNotification"/>
<Interface Name="IDkmModuleModifiedNotification"/>
<Interface Name="IDkmModuleInstanceUnloadNotification"/>
</InterfaceGroup>
Expand Down

0 comments on commit 2ca661a

Please sign in to comment.