Bruce Forstall [Fri, 22 Jan 2021 18:56:18 +0000 (08:56 -1000)]
Fix crash in SuperPMI PGO apis (#47305)
The real fix is a trivial fix in the linked list handling
of AllocJitTempBuffer.
The rest of the changes are making the code conform more to SuperPMI
conventions, adding comments, and improving SPMI dumping.
Günther Foidl [Fri, 22 Jan 2021 18:08:02 +0000 (19:08 +0100)]
NameResolutionPal.Unix: fixed loss of address family information in async lookup (#47171)
* Removed dead code from SystemNative_GetHostEntryForNameAsync
* Fixed loss of address-family
Vladimir Sadov [Fri, 22 Jan 2021 17:53:12 +0000 (09:53 -0800)]
Capture AVX context when redirecting threads for suspension (#47212)
* Save avx regs during SuspendThread
* few more changes and comments
* fix build on windows arm
* fix build on Unix
* Use new[] instead of malloc
* fix for Unix
* Use InitializeContext2 to enable context compaction.
* PR feedback
* Reverted CONTEXT_COMPLETE change.
* Use `CopyContext` in RedirectCurrentThreadAtHandledJITCase
Co-authored-by: Manish Godse <61718172+mangod9@users.noreply.github.com>
Ben Adams [Fri, 22 Jan 2021 17:37:26 +0000 (17:37 +0000)]
Faster EventSource attribute lookup (#45621)
* Use faster single attribute lookup for Eventsource
* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* Add debug assert for type
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Tarek Mahmoud Sayed [Fri, 22 Jan 2021 17:23:12 +0000 (09:23 -0800)]
Add ActivitySource.StartActivity overload and support CallerMemberNameAttribute for name parameter (#47192)
Eric Erhardt [Fri, 22 Jan 2021 17:17:03 +0000 (11:17 -0600)]
Resolve ILLink warnings in System.Security.Cryptography.Algorithms
Viktor Hofer [Fri, 22 Jan 2021 16:27:39 +0000 (17:27 +0100)]
Disable sourcelink locally consistently (#47297)
Alexander Köplinger [Fri, 22 Jan 2021 14:30:12 +0000 (15:30 +0100)]
Revert "Re-enable RunThreadLocalTest8_Values on Mono (#47277)" (#47324)
This reverts commit
f3cd4c6af763d35b9633dc01729a3c02942f941d.
Ryan Lucia [Fri, 22 Jan 2021 14:27:45 +0000 (09:27 -0500)]
Move some Threading classes over from NativeAOT (#47327)
This PR intentionally does not include any of the modifications on top of them or other files that will be needed to wire them up to the build.
Michal Strehovský [Fri, 22 Jan 2021 14:26:12 +0000 (15:26 +0100)]
Misc changes from runtimelab:NativeAOT (#47323)
* Improved logger for the AOT compiler. The logic is mostly taken from IL Linker where prople spent a bunch of time on it.
* Bunch of other changes.
Stephen Toub [Fri, 22 Jan 2021 12:28:11 +0000 (07:28 -0500)]
Delete extraneous nullable suppression in CertificatePal.Import.cs (#47311)
Tomáš Rylek [Fri, 22 Jan 2021 11:37:13 +0000 (12:37 +0100)]
Supply file version info for the jitinterface native library (#47300)
During my work on switching over framework library crossgenning
to use Crossgen2 I noticed that jitinterface is missing the
file version information. This change fixes the issue.
Thanks
Tomas
Steve Pfister [Fri, 22 Jan 2021 11:14:29 +0000 (06:14 -0500)]
Resolves error in initNonPortableDistroRid when your local directory name contains android (#47045)
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Simon Nattress [Fri, 22 Jan 2021 04:57:23 +0000 (20:57 -0800)]
Parse method call chain model file and resolve methods (#47302)
* Parse method call chain model file and resolve methods
* Resolve methods from Azure profile trace building a list of caller->callees with counts to use in compilation heuristics
* Resolves the two main forms of methods we see in the traces:
```
System.Core.ni.dll!System.Linq.Enumerable+WhereSelectEnumerableIterator`2[System.__Canon,System.__Canon].MoveNext
Microsoft.Azure.Monitoring.WarmPath.FrontEnd.Middleware.SecurityMiddlewareBase`1+<Invoke>d__6[System.__Canon]!MoveNext
```
Anirudh Agnihotry [Fri, 22 Jan 2021 04:14:18 +0000 (20:14 -0800)]
update branding from alpha to preview1 (#47282)
Vladimir Sadov [Fri, 22 Jan 2021 03:57:38 +0000 (19:57 -0800)]
Export DotNetRuntimeInfo symbol from singlefile host (#47299)
* Exporting DotNetRuntimeInfo from singlefilehost
* move runtimeinfo into a separate lib
* enable runtimeinfo on macOS
* export only runtimeinfo
* fix FreeBSD build
* revert DLLEXPORT change
Doug Bunting [Fri, 22 Jan 2021 02:31:36 +0000 (18:31 -0800)]
React to dotnet/aspnetcore master -> main renaming (#47306)
Daniel Chalmers [Fri, 22 Jan 2021 01:04:43 +0000 (19:04 -0600)]
Fix typo in LoggerMessage.cs (#47293)
'sisxth' -> 'sixth'
Fixes #47292
Kornei Dontsov [Fri, 22 Jan 2021 01:02:04 +0000 (03:02 +0200)]
Reduce allocations in System.Threading.Channels for netstandard2.* and net461 (#46458)
* Reduce allocations in System.Threading.Channels for netstandard2.* and net461
System.Threading.Channels.AsyncOperation<TResult> is well optimized for .NET Core, but there are no optimizations for .NET Standard 2.0 and .NET Framework. They use the same code as .NET Standard 1.3.
* Remove execution flow suppression as redundant
* Rollback QueueUserWorkItem
Stephen Toub [Fri, 22 Jan 2021 00:55:23 +0000 (19:55 -0500)]
Replace two uses of TaskCreationOptions.LongRunning (#47296)
Alexander Köplinger [Fri, 22 Jan 2021 00:46:01 +0000 (01:46 +0100)]
Bump Linux arm64 Helix docker image (#47254)
Looks like it was never bumped to bring in https://github.com/dotnet/core-eng/issues/10033#issuecomment-
655807795
Tarek Mahmoud Sayed [Thu, 21 Jan 2021 23:20:04 +0000 (15:20 -0800)]
Optimize Activity Ids (#46890)
* Optimize Activity Ids
* Generate long random numbers and make the generator object a threadstatic
* Addnew line at the end of the file
* Update the Random number generator
* Fix Full Framework failure
* Address the feedback regarding ranomizing Guid bits
* address more Feedback
* Address more feedback
Günther Foidl [Thu, 21 Jan 2021 22:31:41 +0000 (23:31 +0100)]
NameResolution-Tests: enable GetHostEntryAsync_InvalidHost_LogsError on Windows (#47034)
* Enable GetHostEntryAsync_InvalidHost_LogsError on Windows too
* Use WaitForErrorEventAsync instead of a naive Task.Delay
Cf. https://github.com/dotnet/runtime/pull/47034#discussion_r558728557
Konstantin Gukov [Thu, 21 Jan 2021 22:04:36 +0000 (23:04 +0100)]
Make File.Move(..., ..., overwrite: true) more efficient. (#47118)
The current implementation has an inefficiency. When moving a file across volumes, and when
the target file doesn't exist, the "rename" syscall will be called twice (unsuccesfully) instead of once.
By branching on "overwrite" from the beginning, we avoid calling the first "rename" in vain.
Co-authored-by: Konstantin Gukov <kgukov@microsoft.com>
Jeremy Koritzinsky [Thu, 21 Jan 2021 21:57:55 +0000 (13:57 -0800)]
Use CorInfoCallConvExtension throughout runtime interop code (#47251)
* First pass to move the vm to use CorInfoCallConvExtension for all IL-stub-related calling convention needs.
* Use CorInfoCallConvExtension all the way down to the native function signature emit stage.
* PR feedback.
* Fix variable name.
* Update src/coreclr/vm/dllimport.cpp
Sergey Andreenko [Thu, 21 Jan 2021 21:37:42 +0000 (13:37 -0800)]
Arm64 apple vm fixes for arg alignment. (#46665)
* Add `MarshalInfo::IsValueClass`.
* Add `TypeHandle* pTypeHandle` to `SizeOf`.
* Add a few asserts/start using inline function instead of macro.
* use TARGET_POINTER_SIZE instead of STACK_ELEM_SIZE.
* Use `m_curOfs` instead of `m_idxStack` in `ArgIteratorBase` on all platforms.
Before some platforms were using stackSlots, some curOfs in bytes.
* Use byte sizes and offsets in `ArgLocDesc`.
Fix arm32.
x86 fixes.
use StackSize on ArgSizes
Add `GetStackArgumentByteIndexFromOffset` and return back the old values for asserts.
another fix
* Stop using `#define STACK_ELEM_SIZE`
* Add `isFloatHfa`.
* delete checking code.
because it won't pass on arm64 apple.
* arm64 apple fixes.
* roundUp the stack size.
* Add a reflection test.
* Return byte offset from `GetNextOfs`.
It is not a complete fix for arm64 apple, but covers most cases.
* Add `FLOAT_REGISTER_SIZE`
* Use StackElemSize for ` pLoc->m_byteStackSize`.
* replace `assert` with `_ASSERTE`.
* Use `ALIGN_UP` in the code that I have changed.
* rename `m_curOfs` as `m_ofsStack`.
* delete "ceremony " from `StackElemSize`.
* Delete `cSlots` and don't call `StackElemSize` on `GetArgSize`.
* Fix an assert.
* Fix nit.
* fix wrong return for hfa<float>.
* fix nit.
* Fix crossgen job.
Tom Deseyn [Thu, 21 Jan 2021 21:11:49 +0000 (22:11 +0100)]
Linux: don't use deprecated sysctl (#45753)
* Linux: don't use deprecated sysctl
* Handle deprecated sysctl in coreclr, gc, corehost.
Katelyn Gadd [Thu, 21 Jan 2021 20:54:31 +0000 (12:54 -0800)]
Add interned string support to the JS<->WASM bindings layer (#44518)
This PR introduces interned string support to the bindings layer along with some related changes:
The JS bindings layer maintains a pair of string intern tables, one mapping JS string -> managed pointer and the other mapping managed pointer -> JS string.
Any interned managed string is automatically added to the JS intern tables when it crosses the bindings boundary, to avoid duplicate allocations + reduce time spent copying/decoding text.
Signatures gain a new type token S which specifies that the argument is an interned string. If the string passed is not already interned, the JS bindings will automatically intern it on both sides.
The bindings layer logic for creating a new managed string will automatically look it up in the local intern table (unless it is large) and use the existing managed string if an interned string is found.
mono_wasm_get_obj_type and similar APIs now return a distinct type ID for interned strings. The logic for this is awkward but doing it in the driver is much faster than trying to do it from JS.
Partial support for converting JS Symbol instances to interned managed strings in the bindings layer. I didn't finish this yet because v8 shell's Symbol support is broken, but it's a good way to achieve interning because the JS runtime exposes interning for symbols.
Aleksey Kliger (λgeek) [Thu, 21 Jan 2021 20:07:48 +0000 (15:07 -0500)]
Re-enable RunThreadLocalTest8_Values on Mono (#47277)
This is possibly fixed by https://github.com/dotnet/runtime/pull/44124
Since that PR mono will throw a ThreadStartException instead of an
ExecutionEngineException if thread creation fails. The threadpool
already catches ThreadStartException and can deal with thread creation failure.
Related to https://github.com/dotnet/runtime/issues/43981
Stephen Toub [Thu, 21 Jan 2021 19:49:38 +0000 (14:49 -0500)]
Replace HttpMethod dictionary with switch (#47281)
Jan Kotas [Thu, 21 Jan 2021 17:18:21 +0000 (09:18 -0800)]
Libraries shims build fixes (#47127)
* On Windows, both dynamic and static libraries are producing .lib file (export library vs. actual static library). We need to make sure that these .lib file have different name to avoid build race conditions.
* Fix System.Globalization.Native too for consistency
* Delete unnecessary ifdef
Kenneth Pouncey [Thu, 21 Jan 2021 17:09:07 +0000 (18:09 +0100)]
Clean up test in System.Threading to use PlatformDetection instead of PlatformSpecific. (#47260)
- Add `[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]`
Alexander Köplinger [Thu, 21 Jan 2021 17:05:33 +0000 (18:05 +0100)]
Fix building symbols archive (#47271)
When passing `/p:CreateSymbolsArchive=true` the build complained about missing `PublishSymbolsToDisk` targets.
Aleksey Kliger (λgeek) [Thu, 21 Jan 2021 17:01:40 +0000 (12:01 -0500)]
[mbr] [wasm] Don't automatically turn off inlining (#47246)
Instead of turning off inlining whenever ENABLE_METADATA_UPDATE is defined in
the code, only turn it off when MONO_METADATA_UPDATE is set in the environment.
Update the browser MBR sample to use the env var
Johan Lorensson [Thu, 21 Jan 2021 15:33:45 +0000 (16:33 +0100)]
EventPipe C library CoreClr ep_rt_object_array_alloc should zero init. (#47111)
EventPipe C library is defensive in its type allocators:
ep_rt_object_alloc
ep_rt_object_array_alloc
meaning that they will zero init memory before returned. On Mono this is
done through use of g_new0 and on CoreClr we use C++11 zero init feature
when allocating struct (only type allocated through these functions).
On CoreClr this was only applied for ep_rt_object_alloc but not for
ep_rt_object_array_alloc meaning that ep_rt_object_array_alloc would
return arrays of allocated objects but not zero initialized.
PR makes sure we call new (nothrow) utilizing C++11's zero initialization
capabilities of non-class types without constructors.
Zoltan Varga [Thu, 21 Jan 2021 15:06:37 +0000 (10:06 -0500)]
[aot] Avoid creating runtime invoke wrappers for methods which return a byreflike type, the return value cannot be boxed. (#47033)
Tammy Qiu [Thu, 21 Jan 2021 12:05:04 +0000 (07:05 -0500)]
[wasm][docs] Add docs for using AOT profiler (#47170)
* add instructions for using profiler
* [wasm][docs] add link to wasm/build/README.md
Peter Sollich [Thu, 21 Jan 2021 07:59:28 +0000 (08:59 +0100)]
Fix call to GcWeakPtrScanBySingleThread (#47225)
When running with MARK_LIST not defined, I noticed a crash due an incorrect #ifdef, which caused GcWeakPtrScanBySingleThread to be executed by multiple threads. The #endif is in the wrong place - we didn't notice because we usually have MARK_LIST defined.
Aaron Robinson [Thu, 21 Jan 2021 06:29:51 +0000 (22:29 -0800)]
Update the ComWrappers API (#47073)
* Update the ComWrappers API
Add support for the new Aggregated and Unwrap flags in ComWrappers.
* ARM/ARM64 build issues.
Add missing contracts.
* Add test for unwrap logic.
Remove extra AddRef() in ComWrappers global marshalling scenario.
* Review feedback.
* Add negative test for passing non-null inner without indicating
the scenario is for aggregation.
Jeremy Koritzinsky [Thu, 21 Jan 2021 02:48:04 +0000 (18:48 -0800)]
Only pass the method context when tracking transitions. (#47238)
* Only pass the method context when tracking transitions.
* Add another separate helper for exit. use a jitflag to signify when to track transitions
* Apply suggestions from code review
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Wire up R2R helpers.
* Revert "Wire up R2R helpers."
This reverts commit
80a4749232312a89752518bcb8741a2b8e0129cc.
* Update CorInfoHelpFunc to have the new entries. Don't handle the new helpers since they won't be used.
* Simplify if check since CORProfilerTrackTransitions is process-wide.
* Remove unneeded assignment.
* Fix formatting.
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Maryam Ariyan [Thu, 21 Jan 2021 02:18:58 +0000 (21:18 -0500)]
Fixes DI deadlock when resolving singletons (#46157)
Stephen Toub [Thu, 21 Jan 2021 01:26:55 +0000 (20:26 -0500)]
Improve Random (performance, APIs, ...) (#47085)
* Improve Random (performance, APIs, ...)
- Changes the algorithm used by `new Random()` to be one that's smaller and faster and produces better results
- Refactors the implementation to make it internally pluggable
- Moves the existing implementation to be used when it's necessary for back compat
- Adds NextInt64 and NextSingle methods
Alexander Köplinger [Thu, 21 Jan 2021 00:17:07 +0000 (01:17 +0100)]
Bump timeout of iOS job in runtime-staging.yml (#47241)
We saw it running into the 2hr timeout in https://dev.azure.com/dnceng/public/_build/results?buildId=958281&view=logs&j=
8580ecfb-912a-5dbd-35ce-
e64d0d51ddbf even though the build progressed fine (albeit slowly).
Steve MacLean [Wed, 20 Jan 2021 23:29:57 +0000 (18:29 -0500)]
src/installer support osx-arm64 (#47247)
Sergey Andreenko [Wed, 20 Jan 2021 23:05:48 +0000 (15:05 -0800)]
Include crossgen2 when crossgening SPC. (#47216)
dotnet-maestro[bot] [Wed, 20 Jan 2021 22:22:15 +0000 (22:22 +0000)]
[master] Update dependencies from mono/linker (#47108)
[master] Update dependencies from mono/linker
- Reflect linker changes
- Reflect linker changes
- Reflect linker changes
- Merge branch 'darc-master-
cda9432a-2250-4c6f-822a-
6016b38faef1' of github.com:dotnet/runtime into darc-master-
cda9432a-2250-4c6f-822a-
6016b38faef1
- fix msbuild logic
Jeremy Koritzinsky [Wed, 20 Jan 2021 22:01:09 +0000 (14:01 -0800)]
Update SafeHandle types to have public parameterless constructors and add InitHandle API (#47189)
* Update public SafeHandle types to have public parameterless constructors.
Remove now-unneeded ILLink trim files.
Make public abstract SafeHandle constructors protected.
Remove comment on SafeWaitHandle
* Make SafeHandle constructors public for internal types.
Make internal abstract SafeHandle default constructors protected. Make non-abstract internal SafeHandles sealed when possible.
More internal SafeHandle types.
* Add new Marshal.InitHandle API.
Fix SetHandle accessibility
Fix test.
Use Marshal.InitHandle.
* PR feedback.
* Remove trailing whitespace.
Geoff Kizer [Wed, 20 Jan 2021 21:37:58 +0000 (13:37 -0800)]
define HttpVersion.Version30 and use where appropriate (#47208)
* define HttpVersion.Version30 and use where appropriate
* add xmldoc to HttpVersion
* fix debug references
* readd HttpVersion30 to HttpClientHandlerTestBase
* revert changes to HttpClientHandlerTest.cs
Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
imhameed [Wed, 20 Jan 2021 21:12:27 +0000 (13:12 -0800)]
[mono] Add basic Vector128 support for arm64. (#47028)
This change:
- Unpacks SIMD parameters passed via multiple GPRs (`LLVMArgVtypeAsIArgs`) into
local LLVM SSA vector-typed values on function entry. The calling convention we
use on arm and arm64 has "large" value types passed in multiple GPRs when
possible, and the way this is currently encoded in the LLVM IR we emit is by
using parameters with the LLVM type `[Size x {i32 or i64}]`, where the
resulting size of this type, in bytes, is at least as large as the size of the
value type encoded within.
- Packs SIMD return values into multiple GPRs (`LLVMArgVtypeAsScalar`); the way
this is currently encoded in the LLVM IR we emit for arm64 (but not arm) is by
using a "wide" LLVM integer type (e.g. `i128`).
- Makes `OP_LDADDR` aware of our special-case handling of SIMD value types:
SIMD value types passed via an indirection (`LLVMArgVtypeAddr` or
`LLVMArgVtypeByRef`) are loaded from memory to an LLVM SSA value in the initial
basic block, but `OP_LDADDR` had previously assumed that any value type passed
via an indirection had an associated LLVM SSA value containing an indirection
rather than the actual value.
- Adds a debugging utility function (`mono_llvm_dump_type`).
- Gives greppable names to some allocas.
- Makes some formerly amd64-specific SIMD-related opcodes also work on arm64.
Ankit Jain [Wed, 20 Jan 2021 19:45:22 +0000 (14:45 -0500)]
[wasm][debugger][tests] Update tests to track harness changes (#46968)
* [wasm][debugger][tests] Move all the tests to `SingleSessionTestBase`
And thus move to remove the use to `insp.Ready`:
So, old code:
```csharp
[Fact]
public async Task BrowserClose()
{
var insp = new Inspector();
var scripts = SubscribeToScripts(insp);
await Ready();
await insp.Ready(async (cli, token) => {
await Assert.ThrowsAsync<WebSocketException>(async () =>
await SendCommandAndCheck(null, "Browser.close", null, -1, -1, null));
});
}
```
.. becomes:
```csharp
[Fact]
public async Task BrowserClose() => await Assert.ThrowsAsync<WebSocketException>(async () =>
await SendCommandAndCheck(null, "Browser.close", null, -1, -1, null));
```
* [wasm][debugger][tests] Run `dotnet format` on the test files
* [wasm][debugger][tests] Merge SingleSessionTestBase=>DebuggerTestBase
.. since it isn't required any more.
* [wasm][debugger][tests] Remove DebugTestContext
This isn't required anymore.
* [wasm][debugger][tests] Remove unused insp.Ready method
* [wasm][debugger][tests] Re-apply old commit to expand console args
In the previous merge, this commit got lost:
```
commit
22e9f6ef0e45bba65e927341f09279a697aae56f
Author: Larry Ewing <lewing@microsoft.com>
Date: Wed Dec 9 15:48:09 2020 -0600
expand console arguments when writing them out (#44632)
* expand cosole arguments when writing them out
* Update src/mono/wasm/debugger/DebuggerTestSuite/Support.cs
* Update src/mono/wasm/debugger/DebuggerTestSuite/Support.cs
Co-authored-by: Ankit Jain <radical@gmail.com>
```
Update, and re-apply it.
* [wasm][debugger][tests] remove debug statement
SingleAccretion [Wed, 20 Jan 2021 19:29:43 +0000 (22:29 +0300)]
Fix unrolling for LocateLastFoundChar and LocateLastFoundByte in SpanHelpers (#46977)
Zoltan Varga [Wed, 20 Jan 2021 18:38:59 +0000 (13:38 -0500)]
[jit] Emit a null check for stelem instructions. (#46817)
Part of the fix for https://github.com/dotnet/runtime/issues/46766.
Geoff Kizer [Wed, 20 Jan 2021 18:26:54 +0000 (10:26 -0800)]
clean up some issues in header classes around immutability and readonly fields (#47205)
* clean up some issues in header classes around immutability and readonly fields
Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
Adeel Mujahid [Wed, 20 Jan 2021 18:13:59 +0000 (20:13 +0200)]
Classify type with empty base as non-blittable (#46769)
* Add tests for MarshalUtils.IsBillitableType
* Classify type with empty base as non-blittable
* Add tests for IsZeroSizedReferenceType
* Rename local variables in tests
Jo Shields [Wed, 20 Jan 2021 17:43:27 +0000 (12:43 -0500)]
Initial new-style iOS/tvOS cross compiler (#47184)
* Allow no EMSDK for cross-compiler
* Don't try to include file not made during AOT on Browser
* Move BuildMonoCrossAOT from a bool to a Subset-esque string
* Generate wasm offsets
* Add new offset generation to non-official builds too. Oops
* Deal with default case when generating offsets only
* We override the OS, so can't switch on it
* We're being skipped again
* Grr
* Try another time. Merges passing in the night.
* Try and make the yaml consume both offsets
* Clean up last commit, which went surprisingly well
* Actually consume all offsets from parameter
* Yaml 🤷♂️
* It's not crossandroid any more, is it?
* Official version
* Fix typo
* Fix typo in typo
* Cleanups
* Variable rename suggestion from Alex
* More better variable names from Alex
* Initial new-style AOT for iOS. Need to disable Linux builds selectively though.
* Split Linux & Mac AOT
* fix error in official builds
AnakinSklavenwalker [Wed, 20 Jan 2021 17:32:05 +0000 (18:32 +0100)]
Update StackBehaviour.cs (#47234)
Steve Pfister [Wed, 20 Jan 2021 17:02:45 +0000 (12:02 -0500)]
[Wasm] Add AOT CI Leg (#46651)
In lieu of running all the library tests suites in AOT mode on CI (estimated to be ~36 hrs = 240 test suites * ~9min AOT time per test suite), only System.Buffers will be ran in AOT mode to standup the leg. Once we find a more acceptable solution, the other libraries tests will be enabled.
The CI leg will start out on the staging pipeline to avoid blocking and failing the build.
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
monojenkins [Wed, 20 Jan 2021 15:47:47 +0000 (10:47 -0500)]
Disable the localloc-noinit.exe test on CI, it depends on undefined behavior and it fails on i386 linux. (#47078)
Co-authored-by: vargaz <vargaz@users.noreply.github.com>
Jo Shields [Wed, 20 Jan 2021 14:40:11 +0000 (09:40 -0500)]
Fix wasm package build being skipped (#47227)
Anton Firszov [Wed, 20 Jan 2021 14:13:36 +0000 (15:13 +0100)]
Update comments for Socket.UseOnlyOverlappedIO (#47160)
* Update UseOnlyOverlappedIO comments
* Update Socket.cs
* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/Socket.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Kenneth Pouncey [Wed, 20 Jan 2021 13:45:27 +0000 (14:45 +0100)]
[browser][tests][outerloop] Standup OuterLoop tests on CI (#45949)
* [browser][tests][outerloop] Standup OuterLoop tests on CI
* System.Collections.NonGeneric.Tests passing
* System.Console.Tests passing
* System.Diagnostics.DiagnosticSource.Tests passing
* System.Globalization.Tests passing
- See active issue https://github.com/dotnet/runtime/issues/45951
* System.IO.FileSystem.Tests passing after deactivating test cannot wait on monitors on this runtime.
* System.IO.FileSystem.Tests passing - See active issue: https://github.com/dotnet/runtime/issues/45954
* Remove fat fingered code.
* Threads not supported on Browser
* Browser does not support monitor
* Browser does not support monitor
* Browser does not support wait on monitors
* Browser does not support wait on monitors
* Add ActiveIssue for DataFlow tests TestNullTarget_CompletionNoCaching
* Add ActiveIssue for DataFlow tests
* Add ActiveIssue for DataFlow tests
* Add threading support conditional
* Change all Cannot wait on monitors on this runtime Browser platform checks to
[ConditionalXXXX(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
As was suggested in comments
* Address review comment for monitors not supported
* Address review comments
* Add threading supported condition.
```
fail: [FAIL] System.Text.Json.Serialization.Tests.EnumConverterTests.VeryLargeAmountOfEnumsToSerialize
[08:10:56] info: System.PlatformNotSupportedException : Cannot wait on monitors on this runtime.
```
David Mason [Wed, 20 Jan 2021 11:15:20 +0000 (03:15 -0800)]
Fix profiler sync issue (#47214)
David Mason [Wed, 20 Jan 2021 10:22:28 +0000 (02:22 -0800)]
update profiling API status (#47217)
Ryan Lucia [Wed, 20 Jan 2021 08:41:51 +0000 (03:41 -0500)]
[mono] Remove MonoPInvokeCallbackAttribute from Corelib (#47175)
Xamarin guidance was to define it in projects separately, so we can safely remove it from Corelib but not the runtime handling.
Johan Lorensson [Wed, 20 Jan 2021 08:01:06 +0000 (09:01 +0100)]
Enable EventPipe C library build on IOS. (#47049)
Jeremy Koritzinsky [Wed, 20 Jan 2021 07:58:03 +0000 (23:58 -0800)]
Remove extra UnmanagedCallersOnly overhead on x86 (#46238)
* Implement emitting an unmanaged calling convention entry point with the correct argument order and register usage on x86.
* Move Unix x86 to the UnmanagedCallersOnly plan now that we don't need to do argument shuffling.
* Add SEH hookup and profiler/debugger hooks to Reverse P/Invoke entry helper to match custom x86 thunk.
Fixes #46177
* Remove Windows x86 assembly stub for individual reverse p/invokes. Move Windows x86 unmanaged callers only to not have extra overhead and put reverse P/Invoke stubs for Windows x86 on the UnmanagedCallersOnly plan.
* Further cleanup
* Remove extraneous UnmanagedCallersOnly block now that x86 UnmanagedCallersOnly has been simplified.
* Undo ArgOrder size specifier since it isn't needed and it doesn't work.
* Fix copy constructor reverse marshalling. Now that we don't have the emitted unmanaged thunk stub, we need to handle the x86 differences for copy-constructed parameters in the IL stub.
* Fix version guid syntax.
* Remove FastNExportHandler.
* Revert "Remove FastNExportHandler."
This reverts commit
423f70ee4d564147dc0ce370d38b3a38404f8e22.
* Fix setting up entry frame for new thread.
* Allow the NExportSEH record to live below ESP so we don't need to create a new stack frame.
* Fix formatting.
* Assign an offset for the return buffer on x86 since it might come in on the stack.
* Make sure we use the TC block we just put in on x86 as well.
* Shrink the ReversePInvokeFrame on non-x86 back to master's size.
* Fix arch-specific R2R constant.
* Pass the return address of the ReversePInvokeEnter helper to TraceCall instead of the entry point and call TraceCall from all JIT_ReversePInvokeEnter* helpers.
* Fix ILVerification and ILVerify
* fix R2R constants for crossgen1
* Don't assert ReversePInvokeFrame size for cross-bitness scenarios.
Dan Moseley [Wed, 20 Jan 2021 05:52:35 +0000 (21:52 -0800)]
Fix regex test OOM (#47209)
Zoltan Varga [Wed, 20 Jan 2021 04:16:22 +0000 (23:16 -0500)]
Pop LMF frames in exception handlers on wasm, since the normal pop LMF code might not get executed in case of an exception. (#47144)
* Pop LMF frames in exception handlers on wasm, since the normal pop LMF code might not get executed in case of an exception.
Fixes https://github.com/dotnet/runtime/issues/46613.
* Update src/mono/mono/mini/llvmonly-runtime.c
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Stephen Toub [Wed, 20 Jan 2021 03:54:39 +0000 (22:54 -0500)]
Fix HttpWebResponse.GetHeaderValueAsString to properly handle empty inputs (#47179)
Kunal Pathak [Wed, 20 Jan 2021 03:10:37 +0000 (19:10 -0800)]
Consider nextIntervalRef of other half of double registers for ARM (#47032)
* use getNextIntervalRef for arm
* Remove dead code Registers and RegisterIterator
* For TYP_DOUBLE interval, check if other half can be candidate for PREV_REG_OPT heuristics
* jit format
* fixed the way foundPrevRegOpt is set
* nit
Jo Shields [Wed, 20 Jan 2021 01:27:44 +0000 (20:27 -0500)]
Fix missing mono jit nupkg runtime library (#47193)
Resolve race condition w/ empty Microsoft.NETCore.App.Runtime.Mono.linux-x64
With the original Subsets.props, some packaging targets are called in an AOT-only environment, and are simply missing some files (because in AOT-only, the JIT was not built). These half-empty nupkgs are uploaded during AzDO builds, after the "correct" JIT builds, and overwriting them. Make changes here to avoid replacing good packages with bad - simply do not call those targets in this situation.
Kunal Pathak [Wed, 20 Jan 2021 00:34:35 +0000 (16:34 -0800)]
Free the second half of double register (#46939)
* free the second half of double register
* Take appropriate regmask
* revert part of comment
Aleksey Kliger (λgeek) [Wed, 20 Jan 2021 00:17:06 +0000 (19:17 -0500)]
Mono: Update MBR samples (#47060)
* [mbr] fix browser sample
1. Use the new json script file for specifying deltas
2. Update to use the new WasmApp.InTree props and targets
* [mbr] fix console sample
* [wasm] Move some default sample properties to WasmApp.InTree.props
* [wasm] mbr browser sample - move relevant bits from D.B.{props,targets} to the project file
* fixup to use new bits from
d26d673d0a1ff1e1c3f904c597c2ee6e9f974950
Co-authored-by: Ankit Jain <radical@gmail.com>
Eric Erhardt [Wed, 20 Jan 2021 00:04:07 +0000 (18:04 -0600)]
Make Delegate.CreateDelegate trimming safe (#47017)
* Make Delegate.CreateDelegate trimming safe
The underlying code will find non-public methods on base types, but the current annotation won't preserve these methods. Use All annotation on the Type to ensure they are preserved.
Fix #46857
* Add a trimming test
Sergey Andreenko [Tue, 19 Jan 2021 23:35:12 +0000 (15:35 -0800)]
x86: support Return SIMD8. (#46899)
* test
* Add x86 support in `genSIMDSplitReturn`.
* Fix for old machines.
* fix format.
* response review.
Eric Erhardt [Tue, 19 Jan 2021 22:57:49 +0000 (16:57 -0600)]
Resolve ILLink warnings in System.Runtime.Serialization.Formatters (#46964)
* Resolve ILLink warnings in System.Runtime.Serialization.Formatters
Contributes to #45623
mihir-b-shah [Tue, 19 Jan 2021 22:56:15 +0000 (16:56 -0600)]
Fix to issue 32972: Grow GArray multiplicatively (#47089)
* Fix issue https://github.com/dotnet/runtime/issues/32972
It changes GArray to the multiplicative 1.5x growth.
* changed to shift and add
Co-authored-by: mihir-b-shah <mihirs@DESKTOP-62O5N77.localdomain>
Steve Pfister [Tue, 19 Jan 2021 21:12:12 +0000 (16:12 -0500)]
Stops logging MSBuild errors when AOT compiler writes to stderr (#47057)
The MonoAotCompiler task will just write to the MSBuild log as a warning rather than error. Prevents AOT compilation from failing when no real failure occurred
Youssef Victor [Tue, 19 Jan 2021 20:55:21 +0000 (22:55 +0200)]
Remove extra space (#47166)
Jan Vorlicek [Tue, 19 Jan 2021 20:13:43 +0000 (21:13 +0100)]
Fix covariant returns issue with partially canonical instantiation (#47048)
* Fix covariant returns issue with partially canonical instantiation
The ClassLoader::ValidateMethodsWithCovariantReturnTypes was properly
handling canonical instantiations only when all the type parameters were
canonical. But when only some of them were cannonical, it was not
getting the non-canonical version of the instantiation and the
validation was failing.
This change fixes it by using ClassLoader::IsCanonicalGenericInstantiation
instead of the IsTypicalSharedInstantiation.
I've also added a regression test for the problem and added couple of
missing licence headers to regression tests I have recently created.
* Remove unnecessary checks
Jo Shields [Tue, 19 Jan 2021 20:00:47 +0000 (15:00 -0500)]
Wasm cross compiler (#47011)
Leverage changes brought in for Android AOT, to add Wasm AOT. Also rename some parameters to make it clearer what their purpose is
Ankit Jain [Tue, 19 Jan 2021 18:32:16 +0000 (13:32 -0500)]
[wasm] Some cleanup of targets, especially around profiler use (#46958)
* [wasm] samples: makefile cleanup
* [wasm] Mark FileWrites as Output
* [wasm] Move driver-gen.c generation for and profile, !aot case to separate target
* [wasm] Add $(WasmProfilers) for aot compiler
* [wasm] update public properties/items list in WasmApp.targets
* wasmapp.targets - some more cleanup - differentiate internal properties
* [wasm] fix MonoAOTCompiler build error
* [wasm] WasmApp.targets - Add `WasmExtraConfig`, to add to `mono-config.js`
`WasmAppBuilder.EnableProfiler` was added to add a special entry to
`mono-config.js` (`config.enable_profiler=true`), for the
`browser-profile` sample. Instead of doing that, add a general way to
add extra json elements to the config file.
This can be done through `WasmAppBuilder.ExtraConfig` set via
`@(WasmExtraConfig)`. Examples:
```xml
<WasmExtraConfig Include="enable_profiler" Value="true" />
<!-- Value attribute can have a number, bool, quoted string, or json string -->
<WasmExtraConfig Include="json" Value="{ "abc": 4 }" />
<WasmExtraConfig Include="string_val" Value=""abc"" />
<WasmExtraConfig Include="string_with_json" Value=""{ "abc": 4 }"" />
```
This would add the following to the config file:
```json
"enable_profiler": true,
"json": {
"abc": 4
},
"string_val": "abc",
"string_with_json": "{ \"abc\": 4 }"
```
* [wasm] Remove BuildAOTProfiled, and instead use AOTProfilePath only
* [wasm] Fix typo
* [wasm] MonoAOTCompiler: fix NRE
* [wasm] WasmAppBuilder.ExtraConfig: add comments
* [wasm] WasmAppBuilder - fix json escaping
Alexander Köplinger [Tue, 19 Jan 2021 16:50:31 +0000 (17:50 +0100)]
Add executable bit to postinstall scripts (#47168)
Should help with https://github.com/dotnet/runtime/issues/46962
Egor Bogatov [Tue, 19 Jan 2021 16:46:32 +0000 (19:46 +0300)]
[mono] Fix compilation errors for iOS-arm64 sample (#47115)
Huo Yaoyuan [Tue, 19 Jan 2021 15:32:24 +0000 (23:32 +0800)]
More arities for tuple returning zip extension method (#47147)
* Implementation.
* ref source
* Tests for Zip3.
* Implement queryable.zip3
* ref source for Queryable.Zip3
* Test for Queryable.Zip3
* xml doc
* Add to ILLink supression.
* Fix argument name in copied tests.
* PR feedbacks
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
Dan Moseley [Tue, 19 Jan 2021 14:33:50 +0000 (06:33 -0800)]
Clarify obsoletion impact of 32-bit Process properties (#47137)
* Clarify obsoletion impact
* new text
Ali Alp [Tue, 19 Jan 2021 13:07:48 +0000 (16:07 +0300)]
code documentation spelling mistake has been corrected (#47158)
calue -> value
Koundinya Veluri [Tue, 19 Jan 2021 13:06:22 +0000 (05:06 -0800)]
Improve tiering disablement for `UnmanagedCallersOnly` methods (#46710)
- Simplifies https://github.com/dotnet/runtime/pull/46550 and fixes some issues
- Disables call counting and adjusts the tier appropriately for `UnmanagedCallersOnly` methods
- Fixes optimization flags sent to the JIT for the default code version when call counting is disabled, including when an `UnmanagedCallersOnly` method is attributed with `AggressiveOptimization`. On the default code version path previously it wasn't checking if call counting was disabled, and since that's an expensive check to add on that path, added a flag to `PrepareCodeConfig`.
- Fixes some miscellaneous inconsistencies between call counting enablement, optimization tier, and jit flags
Kenneth Pouncey [Tue, 19 Jan 2021 04:38:45 +0000 (05:38 +0100)]
[browser][docs] Add docs for running tests in different browser (#47109)
* Add documentation on running tests using different Browsers other than chrome.
- XHARNESS_COMMAND="test-browser --browser=safari"
- Add ability to run against different browsers from the make file target `run-browser-tests` by adding `XHARNESS_BROWSER= ` to command line.
At the moment supported values are:
- `chrome`
- `safari`
- `firefox`
* Add gecko firefox requirements to testing docs.
Eric Erhardt [Tue, 19 Jan 2021 03:47:33 +0000 (21:47 -0600)]
Optimize DispatchProxy generated code (#47134)
* Remove unnecessary allocs
* Call the Invoke method directly from generated code
dotnet-maestro[bot] [Tue, 19 Jan 2021 03:25:53 +0000 (22:25 -0500)]
[master] Update dependencies from dotnet/runtime dotnet/xharness (#47119)
* Update dependencies from https://github.com/dotnet/runtime build
20210118.2
Microsoft.NETCore.DotNetHost , Microsoft.NETCore.DotNetHostPolicy , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , Microsoft.NET.Sdk.IL , System.Runtime.CompilerServices.Unsafe , System.Text.Json
From Version 6.0.0-alpha.1.21060.3 -> To Version 6.0.0-alpha.1.21068.2
* Update dependencies from https://github.com/dotnet/xharness build
20210118.1
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.21065.1 -> To Version 1.0.0-prerelease.21068.1
* Update dependencies from https://github.com/dotnet/xharness build
20210118.2
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.21065.1 -> To Version 1.0.0-prerelease.21068.2
* Update dependencies from https://github.com/dotnet/xharness build
20210118.3
Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
From Version 1.0.0-prerelease.21065.1 -> To Version 1.0.0-prerelease.21068.3
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Eric StJohn [Mon, 18 Jan 2021 23:17:06 +0000 (15:17 -0800)]
Make changes to reference assembly rerun compile (#46999)
* Make changes to reference assembly rerun compile
* Make sure src project will build ref project
This ensures we'll catch incremental changes to reference assemblies
* Allow a project to specify its reference assembly
Eirik Tsarpalis [Mon, 18 Jan 2021 20:36:27 +0000 (20:36 +0000)]
Update ValueTuple.cs with C# 9 pattern matching (#44828)
* use C# 9 constructs in ValueTuple.cs
* address feedback
* address feedback
* address feedback
* address feedback
Miha Zupan [Mon, 18 Jan 2021 19:49:11 +0000 (20:49 +0100)]
Spanify Uri Compress helper (#46751)
* Spanify Uri Compress helper
* Update name of local in comment
* Fix offset for strings without leading slash
Dan Moseley [Mon, 18 Jan 2021 15:55:48 +0000 (07:55 -0800)]
Add more logging for abrupt test failures on Linux (#47102)
Anirudh Agnihotry [Mon, 18 Jan 2021 12:45:45 +0000 (04:45 -0800)]
set private assets and IsImplicitlyDefined (#47100)
monojenkins [Mon, 18 Jan 2021 10:47:22 +0000 (05:47 -0500)]
[SGen] Optimize thread pool enqueue to handle job batches more efficiently. (#45749)
When running parallel minor GC the scan of major and LOS is split up in several jobs based on number of available cores * 4 * 2. On an 8 core machine that will generate 32 major heap and 32 LOS scanning jobs. Current implementation queued each individual job into the thread pool but since the threads where not allowed to work on the items at this point, doing it
this way creates a lot of signalled threads + contention over shared mutex for each queued job.
Commit optimize this pattern adding the ability to add a batch of allocated jobs into the thread pool at the same time, signalling all threads when all, jobs have been added to the queue reducing the number of mutex acquire/release and waking all thread pool threads from 65 (including scan wbroots) down to 1.
Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
Stephen Toub [Sat, 16 Jan 2021 18:52:21 +0000 (13:52 -0500)]
Add Thread.UnsafeStart (#47056)
Adam Sitnik [Sat, 16 Jan 2021 16:13:30 +0000 (17:13 +0100)]
revert ordering change to address PR feedback (#45964)
Tomáš Rylek [Sat, 16 Jan 2021 10:24:40 +0000 (11:24 +0100)]
Initial PDB / PerfMap support in Crossgen2 + System.Private.CoreLib switchover to use Crossgen2 (#47019)
I have moved the PDB writer code to a new assembly
ILCompiler.Diagnostics so that it can be reused by Crossgen2.
I have also added an initial trivial implementation of the
PerfMap writer.
Thanks
Tomas