Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
637 commits
Select commit Hold shift + click to select a range
06c2dba
Add Maui iOS and MacCatalyst build steps (#61068)
LoopedBard3 Nov 2, 2021
7160079
disable sending NT Authority in TLS handshake if specific trust was s…
wfurt Nov 2, 2021
df5b118
Seed the unified System.Security.Cryptography.dll
bartonjs Nov 2, 2021
10eb1a9
[main] Update dependencies from 6 repositories (#61033)
dotnet-maestro[bot] Nov 2, 2021
b3c8fe8
[arm64] JIT: Fix IsContainableImmed for arm64 v8.1 or higher (#61035)
EgorBo Nov 2, 2021
c690d27
Fix typo in profiler method (#60999)
davmason Nov 2, 2021
4e7cf80
Some VN refactoring (#61034)
SingleAccretion Nov 2, 2021
8c6aeea
Bring up full library test CI runs on iOS / tvOS devices (#59503)
steveisok Nov 2, 2021
5ddf662
Temporarily disable scaled index on arm64 (#61090)
EgorBo Nov 2, 2021
daf28a1
revert 58594 CacheCredential change (#61069)
wfurt Nov 2, 2021
594f32e
Avoid bogus cred scanning hits (#61070)
danmoseley Nov 2, 2021
577a70a
Fix gcc warnings during mono linux-x64 build (#60675)
am11 Nov 2, 2021
176e393
HTTP2 loopback server WaitForCancellationAsync should validate error …
pedrobsaila Nov 2, 2021
a3f31e9
Throwing `FormatException` when a required property from `Microsoft.E…
filipjelic Nov 2, 2021
5c8ea45
Removed two unused packages from .vsconfig (#60798)
SteveDunn Nov 2, 2021
0691c75
[arm64] JIT: Fold "A * B + C" to MADD/MSUB (#61037)
EgorBo Nov 2, 2021
5a078b5
[wasm] Re-enable source generator tests failing due to OOM (#60701)
radical Nov 2, 2021
02b9e72
Disable couple of randomly failing PerformanceCounter tests (#61101)
krwq Nov 2, 2021
e815a97
[wasm] Disable failing System.Security.Cryptography tests due to http…
radical Nov 2, 2021
f981785
Fix: Incorrect order of checks for TypeBuilder `GetConstructor` and `…
BartoszKlonowski Nov 2, 2021
ec12194
Switch to run only smoke tests per PR for apple mobile configurations…
steveisok Nov 2, 2021
c87e932
Add back SoD Blazor Pizza Aot test (#61118)
DrewScoggins Nov 2, 2021
24e7a4a
Make QCalls respect the EntryPoint property (#60992)
jkoritzinsky Nov 2, 2021
12222d4
Fix refcount when a composite r2r image is loaded from a bundle (#61066)
VSadov Nov 3, 2021
49807bc
Remove dead code in src/coreclr/jit (#61129)
echesakov Nov 3, 2021
62148b6
Remove setting CallingConvention field on GeneratedDllImport (#61130)
elinor-fung Nov 3, 2021
6527f54
Add TFM and version support query to marshaller interface. (#61064)
AaronRobinsonMSFT Nov 3, 2021
3950381
[wasm] simplify startup configuration (#61072)
pavelsavara Nov 3, 2021
6aaee16
Skip sys/sysctl.h on linux in mono (#61110)
am11 Nov 3, 2021
1486f66
Allow nfloat to be in the ObjCRuntime namespace, and make it work for…
rolfbjarne Nov 3, 2021
39f3470
[wasm][debugger]Add hidden attribute support (#61143)
ilonatommy Nov 3, 2021
65c9433
Credential fixes (#61114)
Nov 3, 2021
c23bc3b
Fix invalid optimization of (-1 * -A) + A (#61091)
jakobbotsch Nov 3, 2021
ab56392
Deduplicate runtime tests using the class name 'Test' (#61125)
trylek Nov 3, 2021
932e3bd
Deduplicate tests with class name 'BringUpTest' (#61128)
trylek Nov 3, 2021
ed7cc17
Remove _validator field from ObjectCollection (#59589)
am11 Nov 3, 2021
0113832
Update SDK to 6.0 RC2 (#60256)
ViktorHofer Nov 3, 2021
7308c4f
JIT: limited version of forward substitution for some relops (#61023)
AndyAyersMS Nov 3, 2021
f7be57f
Make System.Security.Cryptography.X509Certificates compliant with int…
pedrobsaila Nov 3, 2021
1e48eca
lock protect nullability cache of symbolic regex node (#60942)
veanes Nov 3, 2021
22f0683
[DllImportGenerator] Fix stub generation for char array marshalling (…
elinor-fung Nov 4, 2021
bfc5ebc
[arm64] JIT: Recognize sbfiz/ubfiz idioms (#61045)
EgorBo Nov 4, 2021
cebe877
Set IL offsets for calls created during devirtualization (#61189)
jakobbotsch Nov 4, 2021
1902063
Fix Assertion failed 'ins == INS_add' for madd/msub (#61171)
EgorBo Nov 4, 2021
d216c7c
Applied @marek-safar review to exit the loop once the condition is fu…
ilonatommy Nov 4, 2021
c02a37c
[mono][interp] Fix GetType called on ptr constrained to Nullable` (#6…
BrzVlad Nov 4, 2021
b67f978
improved BDD Unicode table representation in NonBacktracking engine (…
veanes Nov 4, 2021
0c8baa2
Use constant ids for RoArrayType GetMethodsCore (#61177)
buyaa-n Nov 4, 2021
82d667c
[DllImportGenerator] Use ElementMarshallingGeneratorFactory to create…
jkoritzinsky Nov 4, 2021
8fbf206
Fold S.S.C.Encoding into new System.Security.Cryptography library
bartonjs Nov 4, 2021
e7c1bc8
Fix bug in iterator test, modify attempt count, make more robust (#61…
kg Nov 5, 2021
ef85e2f
JIT: Fold "shift-by-zero" in lower (#61222)
EgorBo Nov 5, 2021
c7be76d
Fix comment typo (#61246)
JamesNK Nov 5, 2021
39a4a70
[wasm] Revert back to eval in wasm InvokeJS with modularization supp…
maraf Nov 5, 2021
fd07214
Fix UnobservedTaskException from SemaphoreSlim.WaitAsync (#60890)
stephentoub Nov 5, 2021
852405c
JIT: don't bother with GDV for an abstract class (#61191)
AndyAyersMS Nov 5, 2021
1c7100b
Fix build options for native test lib to not enable avx-512 (#61229)
AndyAyersMS Nov 5, 2021
d2415c4
1388 xml serializer assembly load context awareness (#58932)
StephenMolloy Nov 5, 2021
17fa0c8
fix unexpected TimeSeriesLimitReached after HistogramLimitReached(#60…
itn3000 Nov 5, 2021
ed66b28
[wasm] Add test for blazor/sdk fix for lazy loaded assemblies (#60673)
radical Nov 5, 2021
215ff0b
Simplify minterm generation in Regex NonBacktracking engine (#61232)
olsaarik Nov 5, 2021
f080744
Convert to OleDb assembly and last Cryptography DllImport to Generate…
AaronRobinsonMSFT Nov 6, 2021
b344bb5
Update area-owners.md (#61269)
agocke Nov 6, 2021
8273939
Implement `GT_AND_NOT` for ARM/ARM64 (#59881)
SingleAccretion Nov 6, 2021
9dc08dd
Remove BestFitMapping, CallingConvention, and ThrowOnUnmappableChar f…
elinor-fung Nov 6, 2021
6547b55
use GenTreeFlags for better debugging (#61272)
sandreenko Nov 6, 2021
7f4eb85
Make JitPrintInlinedMethods less verbose (#61208)
EgorBo Nov 6, 2021
dee4c0c
ensure the AcceptSocket is cleared when AcceptAsync completes (#61258)
geoffkizer Nov 6, 2021
aefb0fc
Don't create a COM weak reference if the object is an aggregated COMW…
jkoritzinsky Nov 6, 2021
544532a
Use the Xunit assert library instead of CoreCLRTestLibrary for most a…
jkoritzinsky Nov 6, 2021
d40f560
Fix build failure due to conflicting PR merge (#61286)
jkoritzinsky Nov 7, 2021
70dd2db
[mono][interp] Implement tailcalls (#59799)
BrzVlad Nov 8, 2021
a8ac67a
[wasm] Add console version of browser-bench sample (#60733)
radekdoulik Nov 8, 2021
b9a2c48
Clean up the documentation for the library testing (#59401)
MaximLipnin Nov 8, 2021
9e5bb65
Enable global constant propagation for GT_LCL_FLD (#61209)
SingleAccretion Nov 8, 2021
3c67145
[main] Update dependencies from 10 repositories (#61087)
dotnet-maestro[bot] Nov 8, 2021
ff361bd
[main] Update dependencies from dotnet/runtime dotnet/xharness (#61309)
dotnet-maestro[bot] Nov 8, 2021
39ece73
Fix value numbering of field assignments (#61113)
SingleAccretion Nov 8, 2021
2266376
Removing `m_hostAssemblyMap` and ceremony around it (#61292)
VSadov Nov 8, 2021
97ce13d
Type key hash tweaks. (#61234)
VSadov Nov 8, 2021
704f023
Fix incorrect CCW decoding in GetObjectForCCW (#61193)
tommcdon Nov 8, 2021
b665721
Remove sorting requirement for interface lists (#60541)
MichalStrehovsky Nov 8, 2021
768f200
Fix: add missed open curly (#61320)
annchous Nov 8, 2021
be2b009
Fix format.py to use jit-format.exe, not jit-format.bat (#61334)
BruceForstall Nov 9, 2021
0797038
JIT: extend redundant relop to handle side effects (#61275)
AndyAyersMS Nov 9, 2021
3dfdcb9
Add instructions for using Codespaces (#60996)
eerhardt Nov 9, 2021
dfb8c90
Adding Regex source generator to Microsoft.netcore.app.ref pack (#61329)
joperezr Nov 9, 2021
3447b9e
Use UTC throughout certificate request tests
vcsjones Nov 9, 2021
920a4a3
Fix binplacing for (impl) System.Security.Cryptography.Encoding.dll
bartonjs Nov 9, 2021
d39d805
Provide PEM implementations for AsymmetricAlgorithm.
vcsjones Nov 9, 2021
2924d19
[wasm][aot] Disable (again) `Microsoft.Extensions.Logging.Generators.…
krwq Nov 9, 2021
08aff10
Convert concatenation string to interpolation for System.Private.Xml …
kronic Nov 9, 2021
19a55ca
[wasm] Remove WasmBuildTemplate (#61315)
radekdoulik Nov 9, 2021
057e34d
Add additional steps in gcc validation leg (#61241)
am11 Nov 9, 2021
61d603f
Ensure MaxBy/MinBy return first element if all keys are null. (#61364)
eiriktsarpalis Nov 9, 2021
985cb83
Add System.Diagnostics.StackFrame.GetMethodFromNativeIP API for VS4Ma…
Nov 9, 2021
9c37cdc
SPMI: Use diffed bytes for jit-analyze and print more info (#61254)
jakobbotsch Nov 9, 2021
8d93078
Proper VNs for zeroed structs (#61285)
SingleAccretion Nov 9, 2021
731364d
Start tracking debug info for inlined statements (#61220)
jakobbotsch Nov 9, 2021
26c045b
Implement WebRequest CachePolicy (#60913)
pedrobsaila Nov 9, 2021
6d5f59b
Add unit test for variable length encoding HTTP/3 (#60766)
pedrobsaila Nov 9, 2021
60b7ea5
Remove unnecessary DLLIMPORTGENERATOR_ENABLED ifdefs (#61345)
elinor-fung Nov 9, 2021
603aedf
Delete unused test projects (#61348)
elinor-fung Nov 9, 2021
3076586
InstallWorkload: Use the repo's `nuget.config` as the base for instal…
radical Nov 9, 2021
a8cc1d0
[wasm] Allow enums in unmanaged callbacks. (#61377)
vargaz Nov 10, 2021
e5eafc9
[arm64] JIT: Enable CSE/hoisting for "arrayBase + elementOffset" (#61…
EgorBo Nov 10, 2021
3dce93b
Change WASM direct heap access to use helper functions (#61355)
kg Nov 10, 2021
e64cce6
[wasm] Add task marshaling tests. (#61324)
maraf Nov 10, 2021
45543cc
[wasm][debugger] Correct the endian swapping and string implementatio…
lewing Nov 10, 2021
4952db9
[wasm] Build improvements (#61276)
radical Nov 10, 2021
b07b26d
Delete unused mono_unbox_int (#61384)
am11 Nov 10, 2021
1d352fc
fix lint issue (#61433)
pavelsavara Nov 10, 2021
4cd689a
Fix common workflow issues (#61027)
am11 Nov 10, 2021
f9e0256
Update timeout for sourcebuild (#61436)
hoyosjs Nov 10, 2021
4e3eed5
Baseline two failing tests to make outerloop green again (#61280)
trylek Nov 10, 2021
213020c
Fix inconsistency in p/invoke arguments introduced when switching som…
elinor-fung Nov 10, 2021
8fe767f
Create superpmi-asmdiffs pipeline (#61194)
BruceForstall Nov 10, 2021
d15f391
[main] Update dependencies from dotnet/arcade dotnet/icu dotnet/emsdk…
dotnet-maestro[bot] Nov 10, 2021
4f43e82
[DllImportGenerator] Initialize by-value out array to default (#61431)
elinor-fung Nov 10, 2021
9a883b5
Remove dead code (#61427)
lewing Nov 10, 2021
fd64e64
Explicitly mark tests with CLRTestKind=SharedLibrary (#61235)
trylek Nov 11, 2021
ff82b6d
Fix Array ctor integer widening and add Reflection tests (#61347)
AaronRobinsonMSFT Nov 11, 2021
b837efa
Fix CI trigger of superpmi-asmdiffs pipeline (#61444)
BruceForstall Nov 11, 2021
b82dc92
JIT: slightly more aggressive tail duplication (#61179)
AndyAyersMS Nov 11, 2021
2ed526e
Clean up tests under Interop/PInvoke/BestFitMapping (#61390)
elinor-fung Nov 11, 2021
6f5de0b
Include the "TargetingPack" folder in the mobile apps. (#61432)
jkoritzinsky Nov 11, 2021
a761b9f
Some more precise debug info improvements (#61419)
jakobbotsch Nov 11, 2021
8ad84e8
[Mono] Skip flaky android tests (#61460)
simonrozsival Nov 11, 2021
4b90e80
Fix bug where we reference the entry #0 in the pinned plug queue (#60…
PeterSolMS Nov 11, 2021
108fb82
[main] Update dependencies from 5 repositories (#61463)
dotnet-maestro[bot] Nov 11, 2021
2da44f3
Use DllImportGenerator in System.Diagnostics.PerformanceCounter (#61389)
elinor-fung Nov 11, 2021
0ad6cdc
Refine superpmi-replay trigger (#61469)
BruceForstall Nov 11, 2021
775873f
Enable sourcelink in source-build for '.version' file (#60944)
dagood Nov 11, 2021
8684c21
Add tests for metricseventsource HistogramLimitReached(#60752, #61199…
itn3000 Nov 11, 2021
2099752
Add PEM PKCS#8 and SPKI exports for AsymmetricAlgorithm
vcsjones Nov 11, 2021
c737141
Updating src/tests/Interop/PInvoke/Generics/GenericsNative.Vector* to…
tannergooding Nov 11, 2021
99dd33b
XARCH: Remove redudant tests for GT_LT/GT_GE relops. (#61152)
anthonycanino Nov 12, 2021
5fa6dd3
Implement Narrow and Widen using SIMDAsHWIntrinsic (#60094)
tannergooding Nov 12, 2021
35704e4
[wasm] Add AppStart task to the bench Sample (#61481)
radekdoulik Nov 12, 2021
87a44c3
System.IO files cleanup (#61413)
adamsitnik Nov 12, 2021
5781948
Remove explicit '.exe' extension from assembly names in ilproj tests …
trylek Nov 12, 2021
b396034
Lock non localizable strings on regex resources (#61489)
safern Nov 12, 2021
e7600e0
Remove all DLLIMPORTGENERATOR_ENABLED usage. (#61476)
AaronRobinsonMSFT Nov 12, 2021
8574ce9
[mono][jit] Optimize constrained calls to object.GetHashCode () where…
vargaz Nov 12, 2021
c580f49
[mono][jit] Optimize calls to Type:get_IsValueType () on gshared cons…
vargaz Nov 12, 2021
16b970a
Fix optIsLoopEntry to skip removed loops (#61527)
BruceForstall Nov 12, 2021
aae8f51
Update exception docs (#61278)
gewarren Nov 12, 2021
0818df1
[DllImportGenerator] Treat pointer fields in structs as blittable reg…
elinor-fung Nov 13, 2021
a4bb83a
[mini] Allow MONO_VERBOSE_METHOD='*:*' (#61520)
lambdageek Nov 13, 2021
26a6f55
Update how OSR and PGO interact (#61453)
AndyAyersMS Nov 13, 2021
aa06797
[mono] Add a 'inline_method' profiler event. (#61454)
vargaz Nov 13, 2021
edd6467
[mono] Disable partial generic sharing for gparams with non-enum cons…
vargaz Nov 14, 2021
a3b186b
Enable new analyzers in global configs (#60914)
stephentoub Nov 14, 2021
b68328a
Add [Fact] attributes on TypeGeneratorTests (#61534)
trylek Nov 14, 2021
5da8f31
Completely lock-free ClassLoader::LookupTypeKey (#61346)
VSadov Nov 14, 2021
d722224
Add [Fact] attributes to methodical JIT tests (#61536)
trylek Nov 14, 2021
d3a8a27
Add [Fact] attributes to JIT regression tests (#61540)
trylek Nov 14, 2021
233c65d
Enable 54910 tests (#61564)
am11 Nov 14, 2021
17d8fe5
Alternative fix of #60182 (#60298)
sakno Nov 15, 2021
0681dd6
[main] Update dependencies from dotnet/linker (#61094)
dotnet-maestro[bot] Nov 15, 2021
89d967b
Add JsonSerializerOptions.Default (#61434)
eiriktsarpalis Nov 15, 2021
ebf4451
Delete `__DoCrossgen2` (#61582)
MichalStrehovsky Nov 15, 2021
a66a9d8
[main] Update dependencies from 3 repositories (#61568)
dotnet-maestro[bot] Nov 15, 2021
bb3bdf8
Rewrite selection for fields (#61370)
SingleAccretion Nov 15, 2021
21f9b73
Disable poisoning for large structs (#61589)
jakobbotsch Nov 15, 2021
4cf86c2
SortedList<TKey, TValue> added GetKeyAtIndex, GetValueAtIndex, and Se…
rhaokiel Nov 15, 2021
3d7e89c
Remove the "anything + null => null" optimization (#61518)
SingleAccretion Nov 15, 2021
31dd708
Use Span.Fill in String(Char, Int32) constructor (#60269)
SteveDunn Nov 15, 2021
4438760
Use GeneratedDllImport for blittable p/invokes in System.Diagnostics.…
elinor-fung Nov 15, 2021
a888829
Update workflow docs to indicate ARM64 macOS works (#61575)
vcsjones Nov 15, 2021
9b83294
FileSystem.Unix: improve CopyFile. (#59695)
tmds Nov 15, 2021
a53e489
Exclude the managed code around libproc on iOS/tvOS (#61590)
MaximLipnin Nov 15, 2021
e85de53
Fix CharInClass reference in regex emitter (#61559)
stephentoub Nov 15, 2021
f9d05bd
Fix LastWriteTime and LastAccessTime of a symlink on Windows and Unix…
hamarb123 Nov 15, 2021
072e876
Improve System.Speech trimmability (#61566)
kant2002 Nov 15, 2021
f01cd8d
Delete dead code (#61533)
SingleAccretion Nov 15, 2021
f3228da
There shouldn't be a 'lib' prefix on Windows .lib files (#61618)
directhex Nov 15, 2021
fb6cf5c
Loop refactoring and commenting improvements (#61496)
BruceForstall Nov 15, 2021
9fceaa0
Give write access to backport action explicitly (#61626)
hoyosjs Nov 15, 2021
a93e0d2
Create runtime staging clone to manually kick off full test runs (#61…
steveisok Nov 15, 2021
fdafc7c
Adding support for X86Base.Pause() and ArmBase.Yield() (#61065)
tannergooding Nov 15, 2021
5d3e70a
[wasm] parallel asset loading (#61610)
pavelsavara Nov 15, 2021
2e97ac4
Delete impCheckForNullPointer (#61576)
SingleAccretion Nov 15, 2021
3b71d3b
Enable SymbolicRegexNode.IsNullableFor fast path to inline (#61605)
stephentoub Nov 15, 2021
d471a03
Use GeneratedDllImport in Microsoft.Win32.SystemEvents (#61609)
elinor-fung Nov 15, 2021
6401f33
Restrict GITHUB_TOKEN in markdownlint action (#61622)
vcsjones Nov 15, 2021
1c76754
Allow for backport to report progress to PR (#61637)
hoyosjs Nov 15, 2021
25da88c
Only run JIT formatting job if there are JIT changes (#61632)
BruceForstall Nov 16, 2021
e10532a
Obsolete thumbtacked AssemblyName properties (#59522)
i3arnon Nov 16, 2021
56acd2e
Add tests for CNG symmetric key algorithm mismatches
vcsjones Nov 16, 2021
4d82463
XArch: Trim the code block to match the actual code length (#61523)
kunalspathak Nov 16, 2021
a89debf
Provide locations for src-gen diagnostic output (#61430)
layomia Nov 16, 2021
0d11ae8
Fix SuperPMI Python script Azure usage (#61650)
BruceForstall Nov 16, 2021
c566e25
Give create codespaces prebuild action right permissions (#61651)
safern Nov 16, 2021
c397327
[arm64] JIT: Make 0.0 containable for fcmp (#61617)
EgorBo Nov 16, 2021
bd0c543
Disable fgMorphCastedBitwiseOp opt for floats (#61657)
EgorBo Nov 16, 2021
9a9a4f3
Fix poisoning for very large structs (#61521)
jakobbotsch Nov 16, 2021
2b1f420
[wasm] Rework fetch (#61639)
lewing Nov 16, 2021
7b74a7e
[wasm][debugger] Improvement of memory consumption while Evaluating E…
thaystg Nov 16, 2021
293e5ed
[wasm][debugger] View multidimensional array when debugging (#60983)
thaystg Nov 16, 2021
0749730
Update WASM README.md (#61681)
AaronRobinsonMSFT Nov 16, 2021
3806e15
Use GeneratedDllImport for blittable p/invokes in System.IO.Compressi…
elinor-fung Nov 16, 2021
9e11006
Localized file check-in by OneLocBuild Task: Build definition ID 679:…
dotnet-bot Nov 16, 2021
8076522
[DllImportGenerator] Stop ignoring QCalls when looking for methods to…
elinor-fung Nov 16, 2021
c66fa99
Add .runsettings file to be able to run and debug tests on vscode in …
safern Nov 16, 2021
d459c65
Add [Fact] attributes to all remaining ilproj tests (#61625)
trylek Nov 17, 2021
628a084
JIT: don't import IL for partial compilation blocks (#61572)
AndyAyersMS Nov 17, 2021
a1b391b
Update SPCL to use GeneratedDllImport where possible. (#61640)
AaronRobinsonMSFT Nov 17, 2021
da0e0f7
[wasm] renames and cleanup before modularization (#61596)
pavelsavara Nov 17, 2021
0666ebc
[mono][aot] Fix the inclusion of generic instances when doing profile…
vargaz Nov 17, 2021
10e107d
[wasm][debugger] Fix evaluation of a static class attribute; using cu…
ilonatommy Nov 17, 2021
d1b3816
Minor File.ReadAllBytes* improvements (#61519)
adamsitnik Nov 17, 2021
44d28bf
Extend RegexCharClass.Canonicalize range inversion optimization (#61562)
stephentoub Nov 17, 2021
83661ff
Remove some unnecessary slicing from generated Regex code (#61701)
stephentoub Nov 17, 2021
5331f21
Ignore missing data result from superpmi-replay run (#61699)
kunalspathak Nov 17, 2021
c03f4ec
refactoring (#60074)
kronic Nov 17, 2021
de883e3
Remove XUnit reference metadata from tests I switched over last week …
trylek Nov 17, 2021
a508fb5
[DllImportGenerator] Enable on projects without System.Memory and Sys…
elinor-fung Nov 17, 2021
25237fa
Factor out and improve the vectorization of RegexInterpreter.FindFirs…
stephentoub Nov 17, 2021
8cf0b19
A few follow up changes to LookupTypeKey change (#61718)
VSadov Nov 17, 2021
13024af
HostFactoryResolver - Increase default timeout to thirty seconds (#61…
maryamariyan Nov 17, 2021
899bf97
Merge System.Security.Cryptography.Algorithms to System.Security.Cryp…
bartonjs Nov 17, 2021
16300e0
Skip HardwareIntrinsics/x86base/Pause tests on Mono (#61743)
agocke Nov 17, 2021
f9e3e28
Update docker image (#61217)
DrewScoggins Nov 17, 2021
9962c10
src/tests tree test xunit-based source generated runner (#60846)
jkoritzinsky Nov 17, 2021
30550d6
Remove `DisableImplicitNamespaceImports_DotNet` (#61656)
MichalStrehovsky Nov 18, 2021
66b31ca
Upload dasm files as artifacts for "asmdiffs pipeline" (#61700)
kunalspathak Nov 18, 2021
0d25969
[wasm][debugger] Tie sdb agent lifetime to the ExecutionContext and s…
lewing Nov 18, 2021
7f874ee
Remove race condition from DllImportGenerator build (#61695)
jkoritzinsky Nov 18, 2021
581d4d2
Hide 'align' instruction behind jmp (#60787)
kunalspathak Nov 18, 2021
95e3144
Create runtime clone to manually kick off full test runs (#61641)
steveisok Nov 18, 2021
8275c37
Update DNNE version (#61738)
elinor-fung Nov 18, 2021
f6e2377
Convert Crypto P/Invokes to GeneratedDllImport. (#61742)
AaronRobinsonMSFT Nov 18, 2021
23c386a
Use GeneratedDllImport in System.Data.Odbc, System.IO.Ports, System.S…
elinor-fung Nov 18, 2021
d9afc1e
Reduce the output from tests. (#61593)
maraf Nov 18, 2021
37bf145
CreateDirectory: eliminate some syscalls. (#58799)
tmds Nov 18, 2021
5181d12
FileSystemEntry.Unix: ensure properties are available when file is de…
tmds Nov 18, 2021
80ca504
FileStatus.Unix/Process.Unix: align caching of user identity. (#60160)
tmds Nov 18, 2021
4db3531
Add support for dumping and using precise debug info (#61735)
jakobbotsch Nov 18, 2021
9e986b5
Add single char lazy loop support to simplified Regex code gen (#61698)
stephentoub Nov 18, 2021
513d38c
Update Area Owners for System.Data (#61748)
cheenamalhotra Nov 18, 2021
2b23bfa
Remove duplicate checks (#61766)
kant2002 Nov 18, 2021
62c29ff
[iOS] Follow up changes for 61590 (#61670)
MaximLipnin Nov 18, 2021
c0dabb5
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Confi…
maxkoshevoi Nov 18, 2021
6ff57f1
Actually use TargetOS=AnyOS in the build-test-job. (#61745)
jkoritzinsky Nov 18, 2021
b11bda2
Add ThrowIfNull overload for pointers (#61633)
stephentoub Nov 18, 2021
ecdb7d2
Add tests verifying fast-path semantics for nullable structs (#61711)
layomia Nov 18, 2021
ca24ab0
Revert "Actually use TargetOS=AnyOS in the build-test-job. (#61745)" …
jkoritzinsky Nov 18, 2021
9d81462
Fix the only ilproj test that uses multiple command-line variants (#6…
trylek Nov 18, 2021
bd63cfc
Fix building DllImportGeneratorSample (#61806)
elinor-fung Nov 18, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
System.IO files cleanup (dotnet#61413)
* Environment.SystemPageSize returns cached value

* we are no longer shipping MS.IO.Redist, so we can use Array.MaxLength directly

* we are no longer shipping MS.IO.Redist, there is no need for File to be partial

* we are no longer shipping MS.IO.Redist, there is no need for FileInfo to be partial

* there is no need for .Win32.cs and .Windows.cs file anymore
  • Loading branch information
adamsitnik authored Nov 12, 2021
commit 87a44c3d91dcf230dfdcbf6ee1b9465f5bb5f583
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,9 @@
<Compile Include="$(MSBuildThisFileDirectory)System\IO\EnumerationOptions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\EndOfStreamException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\File.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\File.netcoreapp.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileAccess.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileAttributes.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileInfo.netcoreapp.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileLoadException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileMode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileNotFoundException.cs" />
Expand Down Expand Up @@ -1840,7 +1838,6 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Guid.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\DisableMediaInsertionPrompt.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\DriveInfoInternal.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileSystem.Win32.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileSystem.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\FileSystemInfo.Windows.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IO\Path.Windows.cs" />
Expand Down
224 changes: 219 additions & 5 deletions src/libraries/System.Private.CoreLib/src/System/IO/File.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ namespace System.IO
{
// Class for creating FileStream objects, and some basic file management
// routines such as Delete, etc.
public static partial class File
public static class File
{
// Don't use Array.MaxLength. MS.IO.Redist targets .NET Framework.
private const int MaxByteArrayLength = 0x7FFFFFC7;
private const int ChunkSize = 8192;
private static Encoding? s_UTF8NoBOM;

// UTF-8 without BOM and with error detection. Same as the default encoding for StreamWriter.
Expand Down Expand Up @@ -121,6 +120,12 @@ public static bool Exists([NotNullWhen(true)] string? path)
return false;
}

/// <summary>
/// Initializes a new instance of the <see cref="FileStream" /> class with the specified path, creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, additional file options and the allocation size.
/// </summary>
/// <remarks><see cref="FileStream(string,System.IO.FileStreamOptions)"/> for information about exceptions.</remarks>
public static FileStream Open(string path, FileStreamOptions options) => new FileStream(path, options);

public static FileStream Open(string path, FileMode mode)
=> Open(path, mode, (mode == FileMode.Append ? FileAccess.Write : FileAccess.ReadWrite), FileShare.None);

Expand All @@ -130,6 +135,44 @@ public static FileStream Open(string path, FileMode mode, FileAccess access)
public static FileStream Open(string path, FileMode mode, FileAccess access, FileShare share)
=> new FileStream(path, mode, access, share);

/// <summary>
/// Initializes a new instance of the <see cref="Microsoft.Win32.SafeHandles.SafeFileHandle" /> class with the specified path, creation mode, read/write and sharing permission, the access other SafeFileHandles can have to the same file, additional file options and the allocation size.
/// </summary>
/// <param name="path">A relative or absolute path for the file that the current <see cref="Microsoft.Win32.SafeHandles.SafeFileHandle" /> instance will encapsulate.</param>
/// <param name="mode">One of the enumeration values that determines how to open or create the file. The default value is <see cref="FileMode.Open" /></param>
/// <param name="access">A bitwise combination of the enumeration values that determines how the file can be accessed. The default value is <see cref="FileAccess.Read" /></param>
/// <param name="share">A bitwise combination of the enumeration values that determines how the file will be shared by processes. The default value is <see cref="FileShare.Read" />.</param>
/// <param name="preallocationSize">The initial allocation size in bytes for the file. A positive value is effective only when a regular file is being created, overwritten, or replaced.
/// Negative values are not allowed. In other cases (including the default 0 value), it's ignored.</param>
/// <param name="options">An object that describes optional <see cref="Microsoft.Win32.SafeHandles.SafeFileHandle" /> parameters to use.</param>
/// <exception cref="T:System.ArgumentNullException"><paramref name="path" /> is <see langword="null" />.</exception>
/// <exception cref="T:System.ArgumentException"><paramref name="path" /> is an empty string (""), contains only white space, or contains one or more invalid characters.
/// -or-
/// <paramref name="path" /> refers to a non-file device, such as <c>CON:</c>, <c>COM1:</c>, <c>LPT1:</c>, etc. in an NTFS environment.</exception>
/// <exception cref="T:System.NotSupportedException"><paramref name="path" /> refers to a non-file device, such as <c>CON:</c>, <c>COM1:</c>, <c>LPT1:</c>, etc. in a non-NTFS environment.</exception>
/// <exception cref="T:System.ArgumentOutOfRangeException"><paramref name="preallocationSize" /> is negative.
/// -or-
/// <paramref name="mode" />, <paramref name="access" />, or <paramref name="share" /> contain an invalid value.</exception>
/// <exception cref="T:System.IO.FileNotFoundException">The file cannot be found, such as when <paramref name="mode" /> is <see cref="FileMode.Truncate" /> or <see cref="FileMode.Open" />, and the file specified by <paramref name="path" /> does not exist. The file must already exist in these modes.</exception>
/// <exception cref="T:System.IO.IOException">An I/O error, such as specifying <see cref="FileMode.CreateNew" /> when the file specified by <paramref name="path" /> already exists, occurred.
/// -or-
/// The disk was full (when <paramref name="preallocationSize" /> was provided and <paramref name="path" /> was pointing to a regular file).
/// -or-
/// The file was too large (when <paramref name="preallocationSize" /> was provided and <paramref name="path" /> was pointing to a regular file).</exception>
/// <exception cref="T:System.Security.SecurityException">The caller does not have the required permission.</exception>
/// <exception cref="T:System.IO.DirectoryNotFoundException">The specified path is invalid, such as being on an unmapped drive.</exception>
/// <exception cref="T:System.UnauthorizedAccessException">The <paramref name="access" /> requested is not permitted by the operating system for the specified <paramref name="path" />, such as when <paramref name="access" /> is <see cref="FileAccess.Write" /> or <see cref="FileAccess.ReadWrite" /> and the file or directory is set for read-only access.
/// -or-
/// <see cref="F:System.IO.FileOptions.Encrypted" /> is specified for <paramref name="options" />, but file encryption is not supported on the current platform.</exception>
/// <exception cref="T:System.IO.PathTooLongException">The specified path, file name, or both exceed the system-defined maximum length. </exception>
public static SafeFileHandle OpenHandle(string path, FileMode mode = FileMode.Open, FileAccess access = FileAccess.Read,
FileShare share = FileShare.Read, FileOptions options = FileOptions.None, long preallocationSize = 0)
{
Strategies.FileStreamHelpers.ValidateArguments(path, mode, access, share, bufferSize: 0, options, preallocationSize);

return SafeFileHandle.Open(Path.GetFullPath(path), mode, access, share, options, preallocationSize);
}

// File and Directory UTC APIs treat a DateTimeKind.Unspecified as UTC whereas
// ToUniversalTime treats this as local.
internal static DateTimeOffset GetUtcDateTimeOffset(DateTime dateTime)
Expand Down Expand Up @@ -537,9 +580,9 @@ private static async Task<byte[]> InternalReadAllBytesUnknownLengthAsync(FileStr
if (bytesRead == rentedArray.Length)
{
uint newLength = (uint)rentedArray.Length * 2;
if (newLength > MaxByteArrayLength)
if (newLength > Array.MaxLength)
{
newLength = (uint)Math.Max(MaxByteArrayLength, rentedArray.Length + 1);
newLength = (uint)Math.Max(Array.MaxLength, rentedArray.Length + 1);
}

byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength);
Expand Down Expand Up @@ -731,5 +774,176 @@ private static void Validate(string path, Encoding encoding)
if (path.Length == 0)
throw new ArgumentException(SR.Argument_EmptyPath, nameof(path));
}

private static byte[] ReadAllBytesUnknownLength(FileStream fs)
{
byte[]? rentedArray = null;
Span<byte> buffer = stackalloc byte[512];
try
{
int bytesRead = 0;
while (true)
{
if (bytesRead == buffer.Length)
{
uint newLength = (uint)buffer.Length * 2;
if (newLength > Array.MaxLength)
{
newLength = (uint)Math.Max(Array.MaxLength, buffer.Length + 1);
}

byte[] tmp = ArrayPool<byte>.Shared.Rent((int)newLength);
buffer.CopyTo(tmp);
byte[]? oldRentedArray = rentedArray;
buffer = rentedArray = tmp;
if (oldRentedArray != null)
{
ArrayPool<byte>.Shared.Return(oldRentedArray);
}
}

Debug.Assert(bytesRead < buffer.Length);
int n = fs.Read(buffer.Slice(bytesRead));
if (n == 0)
{
return buffer.Slice(0, bytesRead).ToArray();
}
bytesRead += n;
}
}
finally
{
if (rentedArray != null)
{
ArrayPool<byte>.Shared.Return(rentedArray);
}
}
}

private static void WriteToFile(string path, FileMode mode, string? contents, Encoding encoding)
{
ReadOnlySpan<byte> preamble = encoding.GetPreamble();
int preambleSize = preamble.Length;

using SafeFileHandle fileHandle = OpenHandle(path, mode, FileAccess.Write, FileShare.Read, FileOptions.None, GetPreallocationSize(mode, contents, encoding, preambleSize));
long fileOffset = mode == FileMode.Append && fileHandle.CanSeek ? RandomAccess.GetLength(fileHandle) : 0;

if (string.IsNullOrEmpty(contents))
{
if (preambleSize > 0 // even if the content is empty, we want to store the preamble
&& fileOffset == 0) // if we're appending to a file that already has data, don't write the preamble.
{
RandomAccess.WriteAtOffset(fileHandle, preamble, fileOffset);
}
return;
}

int bytesNeeded = preambleSize + encoding.GetMaxByteCount(Math.Min(contents.Length, ChunkSize));
byte[]? rentedBytes = null;
Span<byte> bytes = bytesNeeded <= 1024 ? stackalloc byte[1024] : (rentedBytes = ArrayPool<byte>.Shared.Rent(bytesNeeded));

try
{
if (fileOffset == 0)
{
preamble.CopyTo(bytes);
}
else
{
preambleSize = 0; // don't append preamble to a non-empty file
}

Encoder encoder = encoding.GetEncoder();
ReadOnlySpan<char> remaining = contents;
while (!remaining.IsEmpty)
{
ReadOnlySpan<char> toEncode = remaining.Slice(0, Math.Min(remaining.Length, ChunkSize));
remaining = remaining.Slice(toEncode.Length);
int encoded = encoder.GetBytes(toEncode, bytes.Slice(preambleSize), flush: remaining.IsEmpty);
Span<byte> toStore = bytes.Slice(0, preambleSize + encoded);

RandomAccess.WriteAtOffset(fileHandle, toStore, fileOffset);

fileOffset += toStore.Length;
preambleSize = 0;
}
}
finally
{
if (rentedBytes is not null)
{
ArrayPool<byte>.Shared.Return(rentedBytes);
}
}
}

private static async Task WriteToFileAsync(string path, FileMode mode, string? contents, Encoding encoding, CancellationToken cancellationToken)
{
ReadOnlyMemory<byte> preamble = encoding.GetPreamble();
int preambleSize = preamble.Length;

using SafeFileHandle fileHandle = OpenHandle(path, mode, FileAccess.Write, FileShare.Read, FileOptions.Asynchronous, GetPreallocationSize(mode, contents, encoding, preambleSize));
long fileOffset = mode == FileMode.Append && fileHandle.CanSeek ? RandomAccess.GetLength(fileHandle) : 0;

if (string.IsNullOrEmpty(contents))
{
if (preambleSize > 0 // even if the content is empty, we want to store the preamble
&& fileOffset == 0) // if we're appending to a file that already has data, don't write the preamble.
{
await RandomAccess.WriteAtOffsetAsync(fileHandle, preamble, fileOffset, cancellationToken).ConfigureAwait(false);
}
return;
}

byte[] bytes = ArrayPool<byte>.Shared.Rent(preambleSize + encoding.GetMaxByteCount(Math.Min(contents.Length, ChunkSize)));

try
{
if (fileOffset == 0)
{
preamble.CopyTo(bytes);
}
else
{
preambleSize = 0; // don't append preamble to a non-empty file
}

Encoder encoder = encoding.GetEncoder();
ReadOnlyMemory<char> remaining = contents.AsMemory();
while (!remaining.IsEmpty)
{
ReadOnlyMemory<char> toEncode = remaining.Slice(0, Math.Min(remaining.Length, ChunkSize));
remaining = remaining.Slice(toEncode.Length);
int encoded = encoder.GetBytes(toEncode.Span, bytes.AsSpan(preambleSize), flush: remaining.IsEmpty);
ReadOnlyMemory<byte> toStore = new ReadOnlyMemory<byte>(bytes, 0, preambleSize + encoded);

await RandomAccess.WriteAtOffsetAsync(fileHandle, toStore, fileOffset, cancellationToken).ConfigureAwait(false);

fileOffset += toStore.Length;
preambleSize = 0;
}
}
finally
{
ArrayPool<byte>.Shared.Return(bytes);
}
}

private static long GetPreallocationSize(FileMode mode, string? contents, Encoding encoding, int preambleSize)
{
// for a single write operation, setting preallocationSize has no perf benefit, as it requires an additional sys-call
if (contents is null || contents.Length < ChunkSize)
{
return 0;
}

// preallocationSize is ignored for Append mode, there is no need to spend cycles on GetByteCount
if (mode == FileMode.Append)
{
return 0;
}

return preambleSize + encoding.GetByteCount(contents);
}
}
}
Loading