Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[automated] Merge branch 'release/8.0-rc2' => 'release/8.0' #92325

Merged
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@
<Sha>89be445dd4936157533ad96bafb95f701430653a</Sha>
<SourceBuild RepoName="cecil" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport" Version="8.0.0-rtm.23469.3">
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport" Version="8.0.0-rc.2.23469.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
<Sha>50bf805c8b5ca52abd34fde390609d8a54640246</Sha>
<Sha>ca3e8e40f417e421141638c66dd301395afee66d</Sha>
<SourceBuild RepoName="emsdk" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="8.0.0-alpha.1.23469.1">
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml
like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-8_0_100_Transport
-->
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>8.0.0-rtm.23469.3</MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>
<MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>8.0.0-rc.2.23469.1</MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenCurrentManifest80100TransportVersion)</MicrosoftNETRuntimeEmscriptenVersion>
<!-- workloads -->
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>
Expand Down
7 changes: 7 additions & 0 deletions src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5485,6 +5485,13 @@ void emitter::emitInsRMW(instruction ins, emitAttr attr, GenTreeStoreInd* storeI
{
assert(!src->isContained()); // there must be one non-contained src

if (addr->isContained() && addr->OperIs(GT_LCL_ADDR))
{
GenTreeLclVarCommon* lclVar = addr->AsLclVarCommon();
emitIns_S_R(ins, attr, src->GetRegNum(), lclVar->GetLclNum(), lclVar->GetLclOffs());
return;
}

// ind, reg
id = emitNewInstrAmd(attr, offset);
emitHandleMemOp(storeInd, id, emitInsModeFormat(ins, IF_ARD_RRD), ins);
Expand Down
9 changes: 0 additions & 9 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10807,8 +10807,6 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)
}

#if defined(TARGET_XARCH)
case NI_AVX512F_Add:
case NI_AVX512BW_Add:
case NI_AVX512F_And:
case NI_AVX512DQ_And:
case NI_AVX512F_AndNot:
Expand Down Expand Up @@ -10850,13 +10848,6 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)

switch (intrinsicId)
{
case NI_AVX512F_Add:
case NI_AVX512BW_Add:
{
maskIntrinsicId = NI_AVX512F_AddMask;
break;
}

case NI_AVX512F_And:
case NI_AVX512DQ_And:
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ private static bool TryValidateOptions(object options, string qualifiedName, Lis

foreach (PropertyInfo propertyInfo in options.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public))
{
if (propertyInfo.GetMethod is null)
// Indexers are properties which take parameters. Ignore them.
if (propertyInfo.GetMethod is null || propertyInfo.GetMethod.GetParameters().Length > 0)
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,30 @@ public void TestValidationWithEnumeration()
result2.Failures);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public void TestObjectsWithIndexerProperties()
{
DataAnnotationValidateOptions<MyDictionaryOptions> dataAnnotationValidateOptions1 = new("MyDictionaryOptions");
MyDictionaryOptionsOptionsValidator sourceGenOptionsValidator1 = new();

var options1 = new MyDictionaryOptions();
ValidateOptionsResult result1 = sourceGenOptionsValidator1.Validate("MyDictionaryOptions", options1);
ValidateOptionsResult result2 = dataAnnotationValidateOptions1.Validate("MyDictionaryOptions", options1);

Assert.True(result1.Succeeded);
Assert.True(result2.Succeeded);

DataAnnotationValidateOptions<MyListOptions<string>> dataAnnotationValidateOptions2 = new("MyListOptions");
MyListOptionsOptionsValidator sourceGenOptionsValidator2 = new();

var options2 = new MyListOptions<string>() { Prop = "test" };
result1 = sourceGenOptionsValidator2.Validate("MyListOptions", options2);
result2 = dataAnnotationValidateOptions2.Validate("MyListOptions", options2);

Assert.True(result1.Succeeded);
Assert.True(result2.Succeeded);
}

[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))]
public void TestValidationWithCyclicReferences()
{
Expand Down Expand Up @@ -302,6 +326,12 @@ public partial class MySourceGenOptionsValidator : IValidateOptions<MyOptions>
{
}

public class MyDictionaryOptions : Dictionary<string, string> { [Required] public string Prop { get; set; } = "test"; }
[OptionsValidator] public partial class MyDictionaryOptionsOptionsValidator : IValidateOptions<MyDictionaryOptions> { }

public class MyListOptions<T> : List<T> { [Required] public T Prop { get; set; } = default; }
[OptionsValidator] public partial class MyListOptionsOptionsValidator : IValidateOptions<MyListOptions<string>> { }

#if NET8_0_OR_GREATER
public class OptionsUsingNewAttributes
{
Expand Down
40 changes: 40 additions & 0 deletions src/tests/JIT/Regression/JitBlue/Runtime_92218/Runtime_92218.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Runtime.CompilerServices;
using System.Threading;
using Xunit;

public struct MutableStruct
{
private long _internalValue;

public long InternalValue
{
get => Volatile.Read(ref _internalValue);
private set => Volatile.Write(ref _internalValue, value);
}

public void Add(long value) => AddInternal(value);
private void AddInternal(long value) => InternalValue += value;
public MutableStruct(long value) => InternalValue = value;
}

public static class Runtime_92218
{
[Fact]
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public static void Problem()
{
var test = new MutableStruct(420);
var from = new MutableStruct(42);

var wrapper = -new TimeSpan(3);

while (test.InternalValue >= from.InternalValue)
{
test.Add(wrapper.Ticks);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>
Loading