Skip to content

Commit

Permalink
Merge branch 'main' into feature/const-generics
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 authored Aug 9, 2023
2 parents 902e196 + 7b26bfb commit 67f63bc
Show file tree
Hide file tree
Showing 901 changed files with 19,450 additions and 6,380 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
"version": "8.0.0-prerelease.23377.1",
"version": "8.0.0-prerelease.23401.3",
"commands": [
"xharness"
]
Expand Down
26 changes: 25 additions & 1 deletion .github/fabricbot.json
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
},
{
"labels": [
"area-ILVerification"
"area-Tools-ILVerification"
],
"mentionees": [
"JulieLeeMSFT"
Expand Down Expand Up @@ -2131,6 +2131,18 @@
"label": "area-Tools-ILLink"
}
},
{
"name": "hasLabel",
"parameters": {
"label": "area-Interop-coreclr"
}
},
{
"name": "hasLabel",
"parameters": {
"label": "area-System.Runtime.InteropServices"
}
},
{
"name": "labelAdded",
"parameters": {
Expand Down Expand Up @@ -2166,6 +2178,18 @@
"parameters": {
"label": "area-Tools-ILLink"
}
},
{
"name": "labelAdded",
"parameters": {
"label": "area-Interop-coreclr"
}
},
{
"name": "labelAdded",
"parameters": {
"label": "area-System.Runtime.InteropServices"
}
}
]
},
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ Vagrantfile
CMakeFiles/
cmake_install.cmake
CMakeCache.txt
CMakeUserPresets.json

# Cross compilation
cross/rootfs/*
Expand Down
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
- src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml
- src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml
- src/tasks/MobileBuildTasks/Apple/AppleProject.cs
-->
<AndroidApiLevelMin>21</AndroidApiLevelMin>
<iOSVersionMin>11.0</iOSVersionMin>
Expand Down
8 changes: 4 additions & 4 deletions docs/design/coreclr/botr/garbage-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ For the small object heap, the generation number represents the age – gen0
being the youngest generation. This doesn't mean all objects in gen0
are younger than any objects in gen1 or gen2. There are exceptions
which will be explained below. Collecting a generation means collecting
objects in that generation and all its younger generations.
objects in that generation and all of its younger generations.

In principle large objects can be handled the same way as small
objects but since compacting large objects is very expensive, they are treated differently. There is only one generation for large objects and
Expand All @@ -100,8 +100,8 @@ Allocations are made in the youngest generation – for small objects this means
Physical representation of the managed heap
-------------------------------------------

The managed heap is a set of managed heap segments. A heap segment is a contiguous block of memory that is acquired by the GC from the OS. The heap segments are
partitioned into small and large object segments, given the distinction of small and large objects. On each heap the heap segments are chained together. There is at least one small object segment and one large segment - they are reserved when CLR is loaded.
The managed heap is a set of managed heap segments. A heap segment is a contiguous block of memory that is acquired by the GC from the OS. Heap segments can be
small, large, or pinned object segments depending on what they contain. On each heap the heap segments are chained together. There is at least one small object segment and one large segment - they are reserved when CLR is loaded. There is also a NonGC heap that contains ro (readonly) segments.

There's always only one ephemeral segment in each small object heap, which is where gen0 and gen1 live. This segment may or may not include gen2
objects. In addition to the ephemeral segment, there can be zero, one or more additional segments, which will be gen2 segments since they only contain gen2 objects.
Expand Down Expand Up @@ -243,7 +243,7 @@ Physical Architecture

This section is meant to help you follow the code flow.

User thread runs out of quantum and gets a new quantum via try_allocate_more_space.
User thread runs out of space in an allocation context and gets a new one via try_allocate_more_space.

try_allocate_more_space calls GarbageCollectGeneration when it needs to trigger a GC.

Expand Down
86 changes: 86 additions & 0 deletions docs/design/features/globalization-hybrid-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,61 @@ Using `IgnoreNonSpace` for these two with `HybridGlobalization` off, also return
new CultureInfo("de-DE").CompareInfo.IndexOf("strasse", "stra\u00DFe", 0, CompareOptions.IgnoreNonSpace); // 0 or -1
```

**Calandars**

Affected public APIs:
- DateTimeFormatInfo.AbbreviatedDayNames
- DateTimeFormatInfo.GetAbbreviatedDayName()
- DateTimeFormatInfo.AbbreviatedMonthGenitiveNames
- DateTimeFormatInfo.AbbreviatedMonthNames
- DateTimeFormatInfo.GetAbbreviatedMonthName()
- DateTimeFormatInfo.AMDesignator
- DateTimeFormatInfo.CalendarWeekRule
- DateTimeFormatInfo.DayNames
- DateTimeFormatInfo.GetDayName
- DateTimeFormatInfo.GetAbbreviatedEraName()
- DateTimeFormatInfo.GetEraName()
- DateTimeFormatInfo.FirstDayOfWeek
- DateTimeFormatInfo.FullDateTimePattern
- DateTimeFormatInfo.LongDatePattern
- DateTimeFormatInfo.LongTimePattern
- DateTimeFormatInfo.MonthDayPattern
- DateTimeFormatInfo.MonthGenitiveNames
- DateTimeFormatInfo.MonthNames
- DateTimeFormatInfo.GetMonthName()
- DateTimeFormatInfo.NativeCalendarName
- DateTimeFormatInfo.PMDesignator
- DateTimeFormatInfo.ShortDatePattern
- DateTimeFormatInfo.ShortestDayNames
- DateTimeFormatInfo.GetShortestDayName()
- DateTimeFormatInfo.ShortTimePattern
- DateTimeFormatInfo.YearMonthPattern


The Hybrid responses may differ because they use Web API functions. To better ilustrate the mechanism we provide an example for each endpoint. All exceptions cannot be listed, for reference check the response of specific version of Web API on your host.
| **API** | **Functions used** | **Example of difference for locale** | **non-Hybrid** | **Hybrid** |
|:-----------------------------:|:----------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------:|:------------------:|:-----------------:|
| AbbreviatedDayNames | `Date.prototype.toLocaleDateString(locale, { weekday: "short" })` | en-CA | Sun. | Sun |
| AbbreviatedMonthGenitiveNames | `Date.prototype.toLocaleDateString(locale, { month: "short", day: "numeric"})` | kn-IN | ಆಗ | ಆಗಸ್ಟ್ |
| AbbreviatedMonthNames | `Date.prototype.toLocaleDateString(locale, { month: "short" })` | lt-LT | saus. | 01 |
| AMDesignator | `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h12"})`; `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h24"})` | sr-Cyrl-RS | пре подне | AM |
| CalendarWeekRule | `Intl.Locale.prototype.getWeekInfo().minimalDay` | none | - | - |
| DayNames | `Date.prototype.toLocaleDateString(locale, { weekday: "long" })` | none | - | - |
| GetAbbreviatedEraName() | `Date.prototype.toLocaleDateString(locale, { era: "narrow" })` | bn-IN | খৃষ্টাব্দ | খ্রিঃ |
| GetEraName() | `Date.prototype.toLocaleDateString(locale, { era: "short" })` | vi-VI | sau CN | CN |
| FirstDayOfWeek | `Intl.Locale.prototype.getWeekInfo().firstDay` | zn-CN | Sunday | Monday |
| FullDateTimePattern | `LongDatePattern` and `LongTimePattern` | - | | |
| LongDatePattern | `Intl.DateTimeFormat(locale, { weekday: "long", year: "numeric", month: "long", day: "numeric"}).format(date)` | en-BW | dddd, dd MMMM yyyy | dddd, d MMMM yyyy |
| LongTimePattern | `Intl.DateTimeFormat(locale, { timeStyle: "medium" })` | zn-CN | tth:mm:ss | HH:mm:ss |
| MonthDayPattern | `Date.prototype.toLocaleDateString(locale, { month: "long", day: "numeric"})` | en-PH | d MMMM | MMMM d |
| MonthGenitiveNames | `Date.prototype.toLocaleDateString(locale, { month: "long", day: "numeric"})` | ca-AD | de gener | gener |
| MonthNames | `Date.prototype.toLocaleDateString(locale, { month: "long" })` | el-GR | Ιανουαρίου | Ιανουάριος |
| NativeCalendarName | `Intl.Locale.prototype.getCalendars()` | for all locales it has English names | Gregorian Calendar | gregory |
| PMDesignator | `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h12"})`; `Date.prototype.toLocaleTimeString(locale, { hourCycle: "h24"})` | mr-IN | म.उ. | PM |
| ShortDatePattern | `Date.prototype.toLocaleDateString(locale, {dateStyle: "short"})` | en-CH | dd.MM.yyyy | dd/MM/yyyy |
| ShortestDayNames | `Date.prototype.toLocaleDateString(locale, { weekday: "narrow" })` | none | - | - |
| ShortTimePattern | `Intl.DateTimeFormat(locale, { timeStyle: "medium" })` | bg-BG | HH:mm | H:mm |
| YearMonthPattern | `Date.prototype.toLocaleDateString(locale, { year: "numeric", month: "long" })` | ar-SA | MMMM yyyy | MMMM yyyy g |

### OSX

Expand Down Expand Up @@ -423,3 +478,34 @@ Below function are used from apple native functions:
- [uppercaseStringWithLocale](https://developer.apple.com/documentation/foundation/nsstring/1413316-uppercasestringwithlocale?language=objc)
- [lowercaseStringWithLocale](https://developer.apple.com/documentation/foundation/nsstring/1417298-lowercasestringwithlocale?language=objc)
## Calandars

Affected public APIs:
- DateTimeFormatInfo.AbbreviatedDayNames
- DateTimeFormatInfo.GetAbbreviatedDayName()
- DateTimeFormatInfo.AbbreviatedMonthGenitiveNames
- DateTimeFormatInfo.AbbreviatedMonthNames
- DateTimeFormatInfo.GetAbbreviatedMonthName()
- DateTimeFormatInfo.AMDesignator
- DateTimeFormatInfo.CalendarWeekRule
- DateTimeFormatInfo.DayNames
- DateTimeFormatInfo.GetDayName()
- DateTimeFormatInfo.GetEraName()
- DateTimeFormatInfo.FirstDayOfWeek
- DateTimeFormatInfo.FullDateTimePattern
- DateTimeFormatInfo.LongDatePattern
- DateTimeFormatInfo.LongTimePattern
- DateTimeFormatInfo.MonthDayPattern
- DateTimeFormatInfo.MonthGenitiveNames
- DateTimeFormatInfo.MonthNames
- DateTimeFormatInfo.GetMonthName()
- DateTimeFormatInfo.NativeCalendarName
- DateTimeFormatInfo.PMDesignator
- DateTimeFormatInfo.ShortDatePattern
- DateTimeFormatInfo.ShortestDayNames
- DateTimeFormatInfo.GetShortestDayName()
- DateTimeFormatInfo.ShortTimePattern
- DateTimeFormatInfo.YearMonthPattern

Apple Native API does not have an equivalent for abbreviated era name and will return empty string
- DateTimeFormatInfo.GetAbbreviatedEraName()
21 changes: 13 additions & 8 deletions docs/design/libraries/LibraryImportGenerator/Pipeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,12 @@ The stub code generator itself will handle some initial setup and variable decla
- Call `Generate` on the marshalling generator for every parameter
1. `GuaranteedUnmarshal`: conversion of native to managed data even when an exception is thrown
- Call `Generate` on the marshalling generator for every parameter.
1. `Cleanup`: free any allocated resources
- If this stage has any statements, put them in an if statement where the condition represents whether the call succeeded
1. `CleanupCallerAllocated`: free any resources allocated by the caller
- Call `Generate` on the marshalling generator for every parameter
1. `CleanupCalleeAllocated`: if the native method succeeded, free any resources allocated by the callee (`out` parameters and return values)
- Call `Generate` on the marshalling generator for every parameter
- If this stage has any statements, put them in an if statement where the condition represents whether the call succeeded

Generated P/Invoke structure (if no code is generated for `GuaranteedUnmarshal` and `Cleanup`, the `try-finally` is omitted):
```C#
Expand All @@ -113,7 +117,8 @@ try
finally
{
<< GuaranteedUnmarshal >>
<< Cleanup >>
<< CleanupCalleeAllocated >>
<< CleanupCallerAllocated >>
}
```

Expand All @@ -138,12 +143,12 @@ Support for these features is indicated in code by the `abstract` `SingleFrameSp

The various scenarios mentioned above have different levels of support for these specialized features:

| Scenarios | Pinning and Stack allocation across the native context | Storing additional temporary state in locals |
|------|-----|-----|
| P/Invoke | supported | supported |
| Reverse P/Invoke | unsupported | supported |
| User-defined structure content marshalling | unsupported | unsupported |
| non-blittable array marshalling | unsupported | unuspported |
| Scenarios | Pinning and Stack allocation across the native context | Storing additional temporary state in locals |
|--------------------------------------------|--------------------------------------------------------|----------------------------------------------|
| P/Invoke | supported | supported |
| Reverse P/Invoke | unsupported | supported |
| User-defined structure content marshalling | unsupported | unsupported |
| non-blittable array marshalling | unsupported | unuspported |

To help enable developers to use the full model described in the [Struct Marshalling design](./StructMarshalling.md), we declare that in contexts where `AdditionalTemporaryStateLivesAcrossStages` is false, developers can still assume that state declared in the `Setup` phase is valid in any phase, but any side effects in code emitted in a phase other than `Setup` will not be guaranteed to be visible in other phases. This enables developers to still use the identifiers declared in the `Setup` phase in their other phases, but they'll need to take care to design their generators to handle these rules.

Expand Down
5 changes: 5 additions & 0 deletions docs/design/specs/Ecma-335-Augments.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ This is a list of additions and edits to be made in ECMA-335 specifications. It
- [Atomic reads and writes](#atomic-reads-and-writes)
- [Backward branch constraints](#backward-branch-constraints)
- [Transient pointers](#transient-pointers)
- [Creating arrays using newobj](#creating-arrays-using-newobj)
- [API documentation](#api-documentation)
- [Debug Interchange Format](#debug-interchange-format)

Expand Down Expand Up @@ -1056,6 +1057,10 @@ The paragraphs mentioning "transient pointers" in section "I.12.3.2.1 The evalua

Instead, note is added to sections "III.3.39 ldarga" and "III.3.44 ldloca": The arguments / local variables are stored in unmanaged memory. The address of argument / local variable can be converted to unmanaged pointer without explicit pinning.

## Creating arrays using newobj

Note about creating zero-based, one-dimensional arrays in section III.4.21 "newobj – create a new object" is replaced with "All zero-based, one-dimensional arrays *should* be created using newarr, not newobj". Rationale: All arrays have runtime provided constructors. It does not make sense to disallow one specific constructor just because there is more efficient alternative.

## API documentation

API documentation included in partition IV: Profiles and Libraries is superseded by the actively maintained API documentation in https://github.com/dotnet/dotnet-api-docs repo. The documentation is published at https://docs.microsoft.com/en-us/dotnet/api/.
Expand Down
2 changes: 1 addition & 1 deletion eng/CodeAnalysis.src.globalconfig
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ dotnet_diagnostic.CA1860.severity = warning
dotnet_diagnostic.CA1861.severity = warning

# CA1862: Prefer using 'StringComparer'/'StringComparison' to perform case-insensitive string comparisons
dotnet_diagnostic.CA1862.severity = warning
dotnet_diagnostic.CA1862.severity = info

# CA1863: Use 'CompositeFormat'
dotnet_diagnostic.CA1863.severity = suggestion
Expand Down
8 changes: 7 additions & 1 deletion eng/SourceBuildPrebuiltBaseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
<UsageData>
<IgnorePatterns>
<UsagePattern IdentityGlob="Microsoft.SourceBuild.Intermediate.*" />


<!-- Allowed due to https://github.com/dotnet/source-build-reference-packages/pull/721 -->
<UsagePattern IdentityGlob="System.Composition*/*6.*" />
<UsagePattern IdentityGlob="System.Composition*/*7.*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis*/*4.4.*" />
<UsagePattern IdentityGlob="Microsoft.CodeAnalysis*/*4.5.*" />

<!-- Allowed and pinned to major version due to https://github.com/dotnet/source-build/issues/3228 -->
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Crossgen2.linux-x64/*8.*" />
<UsagePattern IdentityGlob="Microsoft.NETCore.App.Runtime.linux-x64/*8.*" />
Expand Down
4 changes: 0 additions & 4 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,6 @@

<Choose>
<When Condition="$(_subset.Contains('+packs.product+'))">
<ItemGroup Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(RuntimeFlavor)' != 'Mono'">
<SharedFrameworkProjectToBuild Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.Composite.sfxproj" />
<SharedFrameworkProjectToBuild Include="$(InstallerProjectRoot)pkg\sfx\bundle\Microsoft.NETCore.App.Composite.Bundle.bundleproj" />
</ItemGroup>
<ItemGroup Condition="'$(PgoInstrument)' != 'true'">
<SharedFrameworkProjectToBuild Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Ref.sfxproj" />
</ItemGroup>
Expand Down
Loading

0 comments on commit 67f63bc

Please sign in to comment.