Skip to content

Commit

Permalink
Merge branch 'main' into value-array-stack-alloc
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 authored Jan 18, 2025
2 parents 7f95162 + 8a2e934 commit 1915450
Show file tree
Hide file tree
Showing 44 changed files with 1,770 additions and 1,449 deletions.
6 changes: 6 additions & 0 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
<SupportedNETCoreAppTargetFramework Include=".NETCoreApp,Version=v$(NETCoreAppMaximumVersion)" DisplayName=".NET $(NETCoreAppMaximumVersion)" Alias="net$(NETCoreAppMaximumVersion)" />
</ItemGroup>

<PropertyGroup>
<!-- Define properties that depend on the host SDK RID here. -->
<BuildHostTools Condition="'$(DotNetBuildOrchestrator)' == 'true' and '$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'">true</BuildHostTools>
<BuildHostILTools Condition="'$(BuildHostTools)' == 'true' and $([MSBuild]::IsOsPlatform(Windows))">true</BuildHostILTools>
</PropertyGroup>

<!-- The Default behavior in VS is to show files for the first target framework in TargetFrameworks property.
This is required to show all the files corresponding to all target frameworks in VS. -->
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' and
Expand Down
57 changes: 28 additions & 29 deletions THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,36 @@ License notice for Unicode data

https://www.unicode.org/license.html

Copyright © 1991-2022 Unicode, Inc. All rights reserved.
Copyright © 1991-2024 Unicode, Inc. All rights reserved.
Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

Permission is hereby granted, free of charge, to any person obtaining
a copy of the Unicode data files and any associated documentation
(the "Data Files") or Unicode software and any associated documentation
(the "Software") to deal in the Data Files or Software
without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, and/or sell copies of
the Data Files or Software, and to permit persons to whom the Data Files
or Software are furnished to do so, provided that either
(a) this copyright and permission notice appear with all copies
of the Data Files or Software, or
(b) this copyright and permission notice appear in associated
Documentation.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THE DATA FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in these Data Files or Software without prior
written authorization of the copyright holder.
Permission is hereby granted, free of charge, to any person obtaining a
copy of data files and any associated documentation (the "Data Files") or
software and any associated documentation (the "Software") to deal in the
Data Files or Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, and/or sell
copies of the Data Files or Software, and to permit persons to whom the
Data Files or Software are furnished to do so, provided that either (a)
this copyright and permission notice appear with all copies of the Data
Files or Software, or (b) this copyright and permission notice appear in
associated Documentation.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
THIRD PARTY RIGHTS.

IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA
FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall
not be used in advertising or otherwise to promote the sale, use or other
dealings in these Data Files or Software without prior written
authorization of the copyright holder.

License notice for zlib-ng
-----------------------
Expand Down
8 changes: 8 additions & 0 deletions eng/Publishing.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@
Mark assets as Vertical visibility when building in the VMR
-->
<ItemGroup Condition="'$(DotNetBuildOrchestrator)' == 'true'">
<Artifact Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'"
Update="$(ArtifactsPackagesDir)**\runtime.$(NETCoreSdkRuntimeIdentifier).Microsoft.NETCore.ILAsm.*.nupkg"
Visibility="Vertical"
IsShipping="false" />
<Artifact Condition="'$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'"
Update="$(ArtifactsPackagesDir)**\runtime.$(NETCoreSdkRuntimeIdentifier).Microsoft.NETCore.ILDAsm.*.nupkg"
Visibility="Vertical"
IsShipping="false" />
<Artifact Condition="'$(RuntimeFlavor)' != 'Mono' and '$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'"
Update="$(ArtifactsPackagesDir)**\Microsoft.NETCore.App.Crossgen2.$(NETCoreSdkRuntimeIdentifier).*.nupkg"
Visibility="Vertical"
Expand Down
26 changes: 20 additions & 6 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,24 @@
<!--
Build the CoreCLR cross tools when we're doing a cross build and either we're building any CoreCLR native tools for platforms CoreCLR fully supports or when someone explicitly requests them.
The cross tools are used as part of the build process with the downloaded build tools, so we need to build them for the host architecture and build them as unsanitized binaries.
Additionally, in a vertical orchestrated build, we need to produce an ilasm and ildasm for use by upstack repositories.
However, these repositories only build on Windows, so we can limit this to only execute on Windows to avoid additional infrastructure work when not necessary.
-->
<ItemGroup Condition="(('$(ClrRuntimeBuildSubsets)' != '' and ('$(PrimaryRuntimeFlavor)' == 'CoreCLR' or '$(TargetsMobile)' == 'true')) or $(_subset.Contains('+clr.crossarchtools+'))) and ('$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)' or '$(EnableNativeSanitizers)' != '')">
<PropertyGroup>
<_BuildAnyCrossArch Condition="'$(CrossBuild)' == 'true' or '$(BuildArchitecture)' != '$(TargetArchitecture)' or '$(EnableNativeSanitizers)' != ''">true</_BuildAnyCrossArch>
<_BuildCrossComponents Condition="$(_subset.Contains('+clr.crossarchtools+'))">true</_BuildCrossComponents>
<_BuildCrossComponents Condition="'$(ClrRuntimeBuildSubsets)' != '' and ('$(PrimaryRuntimeFlavor)' == 'CoreCLR' or '$(TargetsMobile)' == 'true')">true</_BuildCrossComponents>
</PropertyGroup>

<ItemGroup>
<_CrossToolSubset Condition="'$(_BuildCrossComponents)' == 'true'" Include="ClrCrossComponentsSubset=true" />
<_CrossToolSubset Condition="'$(BuildHostILTools)' == 'true'" Include="ClrILToolsSubset=true" />
</ItemGroup>

<ItemGroup Condition="'$(_BuildAnyCrossArch)' == 'true' and '@(_CrossToolSubset)' != ''">
<ProjectToBuild
Include="$(CoreClrProjectRoot)runtime.proj"
AdditionalProperties="%(AdditionalProperties);
ClrCrossComponentsSubset=true;
AdditionalProperties="%(AdditionalProperties);@(_CrossToolSubset);
HostArchitecture=$(BuildArchitecture);
HostCrossOS=$(HostOS);
PgoInstrument=false;
Expand Down Expand Up @@ -388,11 +400,14 @@
<!-- skip the architectures that don't have LKG runtime packs -->
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_publish.csproj" Condition="'$(NativeAotSupported)' == 'true' and '$(StageOneBuild)' != 'true'" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler.Build.Tasks\ILCompiler.Build.Tasks.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true' and '$(StageOneBuild)' != 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_publish.csproj" Category="clr" Condition="'$(NativeAotSupported)' == 'true' and '$(StageOneBuild)' != 'true'" />
<ProjectToBuild Include="$(CoreClrProjectRoot)nativeaot\BuildIntegration\BuildIntegration.proj" Category="clr" Condition="'$(NativeAotSupported)' == 'true'" />

<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_inbuild.csproj" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler.csproj" Condition="'$(NativeAotSupported)' == 'true' and '$(StageOneBuild)' != 'true'" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2.csproj" Condition="'$(NativeAotSupported)' == 'true' and '$(StageOneBuild)' != 'true'" Category="clr" />

<!-- Always build the in-build variants of these tools. They run on the host machine, which we always have LKG packs for. -->
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\ILCompiler\ILCompiler_inbuild.csproj" Category="clr" />
<ProjectToBuild Include="$(CoreClrProjectRoot)tools\aot\crossgen2\crossgen2_inbuild.csproj" Category="clr" />

<ProjectToBuild Condition="'$(TargetOS)' == 'windows' or ('$(TargetOS)' == 'linux' and ('$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64')) or '$(TargetOS)' == 'osx'" Include="$(CoreClrProjectRoot)tools\SuperFileCheck\SuperFileCheck.csproj" Category="clr" />
Expand Down Expand Up @@ -576,7 +591,6 @@
<_BuildNativeAOTRuntimePack Condition="'$(BuildNativeAOTRuntimePack)' == 'true'">true</_BuildNativeAOTRuntimePack>
<_BuildHostPack Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true' and '$(BuildNativeAOTRuntimePack)' != 'true'">true</_BuildHostPack>
<_BuildBundle Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">true</_BuildBundle>
<BuildHostTools Condition="'$(DotNetBuildOrchestrator)' == 'true' and '$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'">true</BuildHostTools>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuildAllRuntimePacks)' == 'true' and '$(DotNetBuildSourceOnly)' != 'true'">
Expand Down
16 changes: 3 additions & 13 deletions github-merge-flow.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,9 @@
"MergeToBranch": "release/8.0-staging",
"ExtraSwitches": "-QuietComments"
},
// Automate merging runtime release/8.0-rc branches back to release/8.0
"release/8.0-rc":{
"MergeToBranch": "release/8.0",
"ExtraSwitches": "-QuietComments"
},
// Automate merging runtime release/9.0-rc1 branch back to release/9.0
"release/9.0-rc1":{
"MergeToBranch": "release/9.0",
"ExtraSwitches": "-QuietComments"
},
// Automate merging runtime release/9.0-rc2 branch back to release/9.0
"release/9.0-rc2":{
"MergeToBranch": "release/9.0",
// Automate merging runtime release/9.0 branch back to release/9.0-staging
"release/9.0":{
"MergeToBranch": "release/9.0-staging",
"ExtraSwitches": "-QuietComments"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
</PropertyGroup>

<ItemGroup>
<NativeBinary Include="$(RuntimeBinDir)ilasm$(ExeSuffix)" />
<NativeBinary Condition="'$(PackCrossComponent)' != 'true'" Include="$(RuntimeBinDir)ilasm$(ExeSuffix)" />
<NativeBinary Condition="'$(PackCrossComponent)' == 'true'" Include="$(RuntimeBinDir)$(BuildArchitecture)/ilasm$(ExeSuffix)" />
</ItemGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project Sdk="Microsoft.Build.Traversal">
<PropertyGroup>
<IsILToolPackage>true</IsILToolPackage>
</PropertyGroup>
<ItemGroup>
<!-- identity project, runtime specific projects are included by props above -->
<Project Include="$(MSBuildProjectName).pkgproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
</PropertyGroup>

<ItemGroup>
<NativeBinary Include="$(RuntimeBinDir)ildasm$(ExeSuffix)" />
<NativeBinary Condition="'$(PackCrossComponent)' != 'true'" Include="$(RuntimeBinDir)ildasm$(ExeSuffix)" />
<NativeBinary Condition="'$(PackCrossComponent)' == 'true'" Include="$(RuntimeBinDir)$(BuildArchitecture)/ildasm$(ExeSuffix)" />
</ItemGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.targets))" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<Project Sdk="Microsoft.Build.Traversal">
<PropertyGroup>
<IsILToolPackage>true</IsILToolPackage>
</PropertyGroup>
<ItemGroup>
<!-- identity project, runtime specific projects are included by props above -->
<Project Include="$(MSBuildProjectName).pkgproj" />
Expand Down
3 changes: 3 additions & 0 deletions src/coreclr/.nuget/builds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
<ItemGroup Condition="'$(BuildIdentityPackage)' == 'true'">
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == ''" />
</ItemGroup>
<ItemGroup Condition="'$(BuildHostILTools)' == 'true' and '$(IsILToolPackage)' == 'true'">
<_projectsToBuild Include="@(Project)" Condition="'%(Project.PackageTargetRuntime)' == '$(NETCoreSdkRuntimeIdentifier)'" AdditionalProperties="%(Project.AdditionalProperties);PackCrossComponent=true" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="@(_projectsToBuild)" />
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ endif()
# Include libraries native shims
#-------------------------------
if(NOT CLR_CROSS_COMPONENTS_BUILD)
set(STATIC_LIBS_ONLY 1)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native)
endif(NOT CLR_CROSS_COMPONENTS_BUILD)
set(STATIC_LIBS_ONLY 1)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/libs libs-native)
endif()

#-----------------------------------------
# Add Projects
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,18 @@ public override MethodDesc ResolveVariantInterfaceMethodToStaticVirtualMethodOnT
// function returns null if the interface method implementation is not defined by the current type in
// the hierarchy.For variance to work correctly, this requires that interfaces be queried in correct order.
// See current interface call resolution for details on how that happens.
private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, MetadataType currentType)
//
// The returnRecursive parameter is solely intended to optimize the recursion through
// the ResolveInterfaceMethodToVirtualMethodOnTypeRecursive helper method and should not
// be used for anything else. ResolveInterfaceMethodToVirtualMethodOnTypeRecursive walks
// up the type hierarchy, calls ResolveInterfaceMethodToVirtualMethodOnType on each base
// type, and bails out on a first successful match. Since we perform the same expansion in
// the last branch of this method by calling ResolveInterfaceMethodToVirtualMethodOnTypeRecursive
// for the base type, we allow the caller to specify that such computed value should be
// returned instead of discarded. This allows short-circuiting the outer loop over type
// hierarchy and avoids unnecessary exponential algorithmic complexity of the resolution
// algorithm.
private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc interfaceMethod, MetadataType currentType, bool returnRecursive = false)
{
Debug.Assert(!interfaceMethod.Signature.IsStatic);

Expand Down Expand Up @@ -684,7 +695,7 @@ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnType(MethodDesc
MethodDesc baseClassImplementationOfInterfaceMethod = ResolveInterfaceMethodToVirtualMethodOnTypeRecursive(interfaceMethod, baseType);
if (baseClassImplementationOfInterfaceMethod != null)
{
return null;
return returnRecursive ? baseClassImplementationOfInterfaceMethod : null;
}
else
{
Expand Down Expand Up @@ -748,7 +759,7 @@ private static MethodDesc ResolveInterfaceMethodToVirtualMethodOnTypeRecursive(M
return null;
}

MethodDesc currentTypeInterfaceResolution = ResolveInterfaceMethodToVirtualMethodOnType(interfaceMethod, currentType);
MethodDesc currentTypeInterfaceResolution = ResolveInterfaceMethodToVirtualMethodOnType(interfaceMethod, currentType, returnRecursive: true);
if (currentTypeInterfaceResolution != null)
return currentTypeInterfaceResolution;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static bool MightHaveInterfaceDispatchMap(TypeDesc type, NodeFactory fact

DefType declType = type.GetClosestDefType();

for (int interfaceIndex = 0; interfaceIndex < declType.RuntimeInterfaces.Length; interfaceIndex++)
for (int interfaceIndex = declType.RuntimeInterfaces.Length - 1; interfaceIndex >= 0; interfaceIndex--)
{
DefType interfaceType = declType.RuntimeInterfaces[interfaceIndex];
InstantiatedType interfaceOnDefinitionType = interfaceType.IsTypeDefinition ?
Expand Down
10 changes: 0 additions & 10 deletions src/coreclr/tools/aot/ILCompiler/ILCompiler.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,4 @@
</PropertyGroup>

<Import Project="ILCompiler.props" />

<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
<PublishDir>$(RuntimeBinDir)ilc-published/</PublishDir>
</PropertyGroup>

<Target Name="PublishCompiler"
Condition="'$(BuildingInsideVisualStudio)' != 'true'"
AfterTargets="Build"
DependsOnTargets="Publish" />

</Project>
5 changes: 4 additions & 1 deletion src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,10 @@ CorInfoInitClassResult MethodContext::repInitClass(CORINFO_FIELD_HANDLE field,
key.method = CastHandle(method);
key.context = CastHandle(context);

DWORD value = InitClass->Get(key);
DWORD value =
LookupByKeyOrMiss(InitClass, key, ": fld-%016" PRIX64 " meth-%016" PRIX64 " con-%016" PRIX64,
key.field, key.method, key.context);

DEBUG_REP(dmpInitClass(key, value));
CorInfoInitClassResult result = (CorInfoInitClassResult)value;
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,9 @@ public enum CodePointFlags : ulong
Unified_Ideograph = 1ul << 31,
Variation_Selector = 1ul << 32,
White_Space = 1ul << 33,
IDS_Unary_Operator = 1ul << 34,
ID_Compat_Math_Continue = 1ul << 35,
ID_Compat_Math_Start = 1ul << 36,
Modifier_Combining_Mark = 1ul << 37,
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,21 @@ private static Dictionary<int, string> ProcessDerivedNameFile()
{
if (value.IsSingleCodePoint)
{
// Single code point of format "XXXX ; <Name>" (name shouldn't end with '*')
// Single code point of format "XXXX ; <Name>"
// It is possible to get a * at the end of the line, to add one codepoint to previously added range.
// example:
// 18B00..18CD5 ; KHITAN SMALL SCRIPT CHARACTER-* <<<< IsSingleCodePoint is false
// 18CFF ; KHITAN SMALL SCRIPT CHARACTER-* <<<< IsSingleCodePoint is true

Assert.False(value.PropName.EndsWith('*'));
dict.Add(value.FirstCodePoint, value.PropName);
if (value.PropName.EndsWith('*'))
{
string baseName = value.PropName[..^1];
dict.Add(value.FirstCodePoint, $"{baseName}{value.FirstCodePoint:X4}");
}
else
{
dict.Add(value.FirstCodePoint, value.PropName);
}
}
else
{
Expand Down
Loading

0 comments on commit 1915450

Please sign in to comment.