platform/upstream/coreclr.git
5 years agoLocal GC - Fix GCToOSInterface::GetPhysicalMemoryLimit (#20495)
David Mason [Sat, 20 Oct 2018 00:41:25 +0000 (17:41 -0700)]
Local GC - Fix GCToOSInterface::GetPhysicalMemoryLimit (#20495)

We weren't setting memStatus->dwLength so the call to GlobalMemoryStatusEx would fail and we would return 0. This caused the standalone GC to get in to a state where we wouldn't allocate more memory for the GC heap even if there was plenty available on the machine.

5 years agoAdd PInvoke/DateTime tests (#19298)
Zeng Jiang [Fri, 19 Oct 2018 21:33:55 +0000 (05:33 +0800)]
Add PInvoke/DateTime tests (#19298)

* Add PInvoke/DateTime tests

* Make DateTimeTest windows-only

* Update managed side to current infrastructure

* Link to OleAut32.

* Add missing target_link_libraries command.

5 years agoMerge pull request #20472 from BruceForstall/ImproveLoopCloningArm64
Bruce Forstall [Fri, 19 Oct 2018 17:28:26 +0000 (10:28 -0700)]
Merge pull request #20472 from BruceForstall/ImproveLoopCloningArm64

Fix loop cloning array index recognition for arm64

5 years agoAdd PInvoke/ExactSpelling tests (#19303)
Zeng Jiang [Fri, 19 Oct 2018 17:07:59 +0000 (01:07 +0800)]
Add PInvoke/ExactSpelling tests (#19303)

* Add PInvoke/ExactSpelling tests

Refactor tests to fit with the rest of the Interop tests.

Fix up test to cleanly run.

Change CMakeLists.txt to match the rest of the tests.

Include Interop.cmake in CMakeLists.txt

Remove Service.

* On x86 enable stdcall mangling irrespective of ExactSpelling and account for the charset suffix when ExactSpelling = false.

Change variable name.

Clean up the FindEntryPoint. The logic flow now matches CoreRT + CoreCLR specific features (ordinals and stdcall mangling).

PR Feedback.

Fix format specifier.

Add back probing null check.

Fix offset calculation for stdcall mangling.

Probe the stdcall-mangled versions of the original entry-point names when ExactSpelling isn't set.

Cleanup.

5 years agoDelete redundant framework API tests (#20481)
Jan Kotas [Fri, 19 Oct 2018 03:38:25 +0000 (20:38 -0700)]
Delete redundant framework API tests (#20481)

Contributes to https://github.com/dotnet/coreclr/issues/12782

5 years agoAdd PInvoke/Primitives/Int tests (#19304)
Zeng Jiang [Thu, 18 Oct 2018 17:19:12 +0000 (01:19 +0800)]
Add PInvoke/Primitives/Int tests (#19304)

* Add PInvoke/Primitives/Int tests

* Clean up Int tests to pass xplat.

5 years ago[RyuJIT] Delete dead code (#20411)
mikedn [Thu, 18 Oct 2018 15:15:21 +0000 (18:15 +0300)]
[RyuJIT] Delete dead code (#20411)

* Delete dead code

optFindLocalInit and related functions (optIsTrackedLocal, lvaLclVarRefs, lvaLclVarRefsAccumIntoRes, lvaLclVarRefsAccum) are not used anywhere.
Also delete a bunch of undefined function declarations.

* Cleanup DataFlow callback comment

5 years agoAdd public IThreadPoolWorkItem (#20387)
Stephen Toub [Thu, 18 Oct 2018 10:01:49 +0000 (06:01 -0400)]
Add public IThreadPoolWorkItem (#20387)

- Changes the internal IThreadPoolWorkItem to be public, removing the legacy ThreadAbortException from it (which was specific to Task, anyway).
- Removes the IThreadPoolWorkItem implementation from Task, so that devs can't write code like `ThreadPool.UnsafeQueueUserWorkItem(task);` or `((IThreadPoolWorkItem)task).Execute();`, both of which could end up doing a variety of bad things that could show up in a variety of ways, some discoverable, some less so.
- Adds an internal UnsafeQueueUserWorkItemInternal that takes object so that it can be passed either an IThreadPoolUserWorkItem or a Task,
- Changes the ThreadPool's queues to be in terms of object instead of IThreadPoolWorkItem
- Changes the dispatch loop to type check for IThreadPoolWorkItem or Task so that both remain supported.

5 years agoRemove unnecessary interpreter fallback (#20470)
Bruce Forstall [Thu, 18 Oct 2018 03:52:39 +0000 (20:52 -0700)]
Remove unnecessary interpreter fallback (#20470)

This was added for arm64 bring-up. Remove it, and the associated TODO.

Fixes #19696

5 years agoRevert List.InsertRange changes from #8306 (#20471)
Stephen Toub [Thu, 18 Oct 2018 03:52:11 +0000 (23:52 -0400)]
Revert List.InsertRange changes from #8306 (#20471)

5 years agoFix loop cloning array index recognition for arm64
Bruce Forstall [Thu, 18 Oct 2018 01:22:02 +0000 (18:22 -0700)]
Fix loop cloning array index recognition for arm64

arm64 Checked PMI altjit frameworks asm diffs:
```
Found 95 files with textual diffs.

Summary:
(Lower is better)

Total bytes of diff: 30144 (0.15% of base)
    diff is a regression.

Top file regressions by size (bytes):
       11772 : System.Private.CoreLib.dasm (2.06% of base)
        1768 : Microsoft.CodeAnalysis.dasm (0.26% of base)
        1764 : System.Private.DataContractSerialization.dasm (0.19% of base)
        1692 : Microsoft.CSharp.dasm (0.49% of base)
        1436 : System.Collections.Immutable.dasm (0.16% of base)

Top file improvements by size (bytes):
         -80 : NuGet.Packaging.dasm (-0.04% of base)
         -28 : xunit.execution.dotnet.dasm (-0.10% of base)
         -24 : Microsoft.Win32.Registry.dasm (-0.10% of base)
         -20 : Microsoft.DotNet.ProjectModel.dasm (-0.01% of base)
          -4 : System.IO.Compression.dasm (-0.01% of base)

39 total files with size differences (6 improved, 33 regressed), 90 unchanged.

Top method regressions by size (bytes):
        5908 (83.87% of base) : System.Private.CoreLib.dasm - System.DefaultBinder:BindToMethod(int,ref,byref,ref,ref,ref,byref):ref:this
         884 (62.96% of base) : Microsoft.CSharp.dasm - Microsoft.CSharp.RuntimeBinder.Errors.ErrorHandling:Error(int,ref):ref
         740 (38.14% of base) : Microsoft.VisualBasic.dasm - Microsoft.VisualBasic.CompilerServices.OverloadResolution:MoreSpecificProcedure(ref,ref,ref,ref,int,byref,bool):ref
         728 (48.02% of base) : System.Private.CoreLib.dasm - System.DefaultBinder:SelectMethod(int,ref,ref,ref):ref:this
         668 (38.84% of base) : System.Private.CoreLib.dasm - System.DefaultBinder:SelectProperty(int,ref,ref,ref,ref):ref:this

Top method improvements by size (bytes):
         -80 (-2.42% of base) : NuGet.Packaging.dasm - <<InstallFromSourceAsync>b__0>d:MoveNext():this
         -40 (-10.10% of base) : Microsoft.Diagnostics.Tracing.TraceEvent.dasm - Microsoft.Diagnostics.Utilities.DirectoryUtilities:Clean(ref):int
         -32 (-5.63% of base) : System.Private.DataContractSerialization.dasm - System.Xml.XmlDictionaryReader:ReadContentAs(ref,ref):ref:this
         -28 (-3.24% of base) : xunit.execution.dotnet.dasm - Xunit.Serialization.XunitSerializationInfo:CanSerializeObject(ref):bool
         -24 (-2.38% of base) : Microsoft.CSharp.dasm - Microsoft.CSharp.RuntimeBinder.SymbolTable:AddConversionsForOneType(ref)

Top method regressions by size (percentage):
         468 (110.38% of base) : System.Data.Common.dasm - System.Data.ConstraintCollection:BaseGroupSwitch(ref,int,ref,int):this
        5908 (83.87% of base) : System.Private.CoreLib.dasm - System.DefaultBinder:BindToMethod(int,ref,byref,ref,ref,ref,byref):ref:this
         480 (82.76% of base) : System.Web.HttpUtility.dasm - System.Web.Util.HttpEncoder:UrlEncodeUnicode(ref):ref
         624 (78.00% of base) : System.Private.CoreLib.dasm - System.DefaultBinder:FindMostSpecific(ref,ref,ref,ref,ref,ref,ref,ref):int
         148 (74.00% of base) : System.Private.Xml.dasm - System.Xml.ValidateNames:ParseNmtokenNoNamespaces(ref,int):int

Top method improvements by size (percentage):
          -4 (-14.29% of base) : System.Collections.Immutable.dasm - System.Collections.Immutable.ImmutableStack`1[Int32][System.Int32]:System.Collections.Immutable.IImmutableStack<T>.Pop():ref:this
         -40 (-10.10% of base) : Microsoft.Diagnostics.Tracing.TraceEvent.dasm - Microsoft.Diagnostics.Utilities.DirectoryUtilities:Clean(ref):int
          -4 (-6.67% of base) : System.Collections.Immutable.dasm - System.Collections.Immutable.ImmutableStack`1[Int32][System.Int32]:Pop(byref):ref:this
         -20 (-6.58% of base) : Microsoft.DotNet.ProjectModel.dasm - Microsoft.DotNet.ProjectModel.Resolution.FrameworkReferenceResolver:GetFrameworkInformation(ref):ref:this
         -32 (-5.63% of base) : System.Private.DataContractSerialization.dasm - System.Xml.XmlDictionaryReader:ReadContentAs(ref,ref):ref:this

180 total methods with size differences (36 improved, 144 regressed), 100761 unchanged.

18 files had text diffs but not size diffs.
System.Resources.Writer.dasm had 171 diffs
System.Security.Permissions.dasm had 76 diffs
System.IO.FileSystem.dasm had 40 diffs
System.IO.IsolatedStorage.dasm had 34 diffs
NuGet.Frameworks.dasm had 26 diffs
```

5 years agoEnable code to prevent bad byrefs on all platforms (#20446)
Bruce Forstall [Thu, 18 Oct 2018 01:20:07 +0000 (18:20 -0700)]
Enable code to prevent bad byrefs on all platforms (#20446)

Loop cloning is doing pattern recognition on the morphed form of a GT_INDEX
node. That form has now changed, so update to match the new form.

Fixes #17571

5 years agoPrint Tier-0 or Tier-1 to JIT dump output (#20453)
Bruce Forstall [Wed, 17 Oct 2018 23:28:29 +0000 (16:28 -0700)]
Print Tier-0 or Tier-1 to JIT dump output (#20453)

* Print Tier-0 or Tier-1 to JIT dump output

Make it very obvious we've been asked to generate Tier-0 code.

* Print Tier-0 or Tier-1 in assembly output, as appropriate

5 years agoFix collectible NativeCallable UMThunkEntry lifetime (#20438)
Jan Vorlicek [Wed, 17 Oct 2018 23:20:36 +0000 (16:20 -0700)]
Fix collectible NativeCallable UMThunkEntry lifetime (#20438)

* Fix collectible NativeCallable UMThunkEntry lifetime

The UMEntryThunk cache entries created for NativeCallable target methods
for collectible classes were not properly cleaned up at the unload time.
This change fixes that by adding UMEntryThunkCache on LoaderAllocator
and using it for entries belonging to NativeCallable targets on
collectible classes. The cache is created lazily.

* Reflect PR feedback

Remove the UMEntryThunk cache from the AppDomain and leave it just on
the LoaderAllocator.

5 years agoMerge pull request #20464 from brianrob/eventpipe_configpath
Vance Morrison [Wed, 17 Oct 2018 20:57:17 +0000 (13:57 -0700)]
Merge pull request #20464 from brianrob/eventpipe_configpath

Use AppContext.BaseDirectory to Search for EventPipeConfig File

5 years agoUse AppContext.BaseDirectory instead of AppDomain.CurrentDomain.BaseDirectory when...
Brian Robbins [Wed, 17 Oct 2018 20:30:58 +0000 (13:30 -0700)]
Use AppContext.BaseDirectory instead of AppDomain.CurrentDomain.BaseDirectory when initializing EventPipeController.

5 years agoDelete `FixupIfSIMDLocal`. (#20360)
Sergey Andreenko [Wed, 17 Oct 2018 18:37:20 +0000 (11:37 -0700)]
Delete `FixupIfSIMDLocal`. (#20360)

* Fix the strange `ifdef ` placement.

* Fix comments/refactoring of `LinearScan::BuildReturn`.

* Delete `FixupIfSIMDLocal`.

Do not change `LCL_FLD(long)` back to `LCL_VAR(simd8)`,

5 years agoReplace 'VSCode' by 'Visual Studio Code' in doc (#20441)
Antoine Blanchet [Wed, 17 Oct 2018 17:24:55 +0000 (13:24 -0400)]
Replace 'VSCode' by 'Visual Studio Code' in doc (#20441)

Visual Studio Code is also broadly known as VSCode. But since this document already contained a typo
and Visual Studio Code is not referred as VSCode elsewhere in the CoreCLR documentation I figured it could
be nice to _clean_ this documentation page.

5 years agoMerge pull request #20455 from BruceForstall/DisableFinalize
Bruce Forstall [Wed, 17 Oct 2018 16:21:13 +0000 (09:21 -0700)]
Merge pull request #20455 from BruceForstall/DisableFinalize

Disable GC finalizearraysleep, finalizearray tests for arm32

5 years agoFix duplicate cast in RuntimeMethodInfo.GetCustomAttributes() (#20463)
Nick Craver [Wed, 17 Oct 2018 16:02:34 +0000 (12:02 -0400)]
Fix duplicate cast in RuntimeMethodInfo.GetCustomAttributes() (#20463)

The "as RuntimeType as RuntimeType" cast was redundant here - noticed this when digging into other issues. I couldn't trace how far back this goes due to file moves, but full framework has the same code issue.

5 years agomake coreclr buildable on FreeBSD again (#20459)
Tomas Weinfurt [Wed, 17 Oct 2018 14:30:46 +0000 (07:30 -0700)]
make coreclr buildable on FreeBSD again (#20459)

5 years agoOptimizes StackTrace string generation (#20448)
Nick Craver [Wed, 17 Oct 2018 03:40:03 +0000 (23:40 -0400)]
Optimizes StackTrace string generation (#20448)

When looking for compiler generated async state machine types and methods, we need not look at parents in the reflection path. This introduces additional overhead in both .IsDefined() and .GetCustomAttributes<T>() in every path.

See the short circuit path in: https://github.com/dotnet/coreclr/blob/57f8358221a3c4ad7f1608f625bc3c5936618505/src/System.Private.CoreLib/src/System/Reflection/CustomAttribute.cs#L1315-L1320

We can avoid the list allocation, the array from it, and the resulting combined array by not looking for inherited attributed members that cannot exist for our purposes of creating a stack trace.

5 years agoFix resetting of m_hasArgLocDescForStructInRegs (#20450)
David Wrighton [Wed, 17 Oct 2018 03:39:34 +0000 (20:39 -0700)]
Fix resetting of m_hasArgLocDescForStructInRegs (#20450)

- Also add testcase

Fixes #20449

5 years agoStructured dump of instance entrypoints and decoding generic lookups (#20433)
Tomáš Rylek [Wed, 17 Oct 2018 03:08:11 +0000 (20:08 -0700)]
Structured dump of instance entrypoints and decoding generic lookups (#20433)

1) Dump method signatures in the INSTANCE_METHOD_ENTRYPOINTS section;

2) Add logic for decoding generic lookups;

3) Add previously missing support for dumping MVAR index.

Thanks

Tomas

5 years agoAdd hack for arm64/x86 to skip build tools restore (#20390)
Jarret Shook [Wed, 17 Oct 2018 01:26:56 +0000 (18:26 -0700)]
Add hack for arm64/x86 to skip build tools restore (#20390)

* Add hack for arm64/x86 to skip build tools restore

* Address pr feedback

* Correct PROCESSOR_ARCHITEW6432 comparison

5 years agoHigh entropy ASLR for native images
Simon Nattress [Tue, 16 Oct 2018 18:07:25 +0000 (11:07 -0700)]
High entropy ASLR for native images

Enable high entropy for 64bit native images, which expands the set of virtual address bases a native image can be loaded at.

5 years agoMerge pull request #20431 from BruceForstall/IlasmArm64
Bruce Forstall [Wed, 17 Oct 2018 00:19:30 +0000 (17:19 -0700)]
Merge pull request #20431 from BruceForstall/IlasmArm64

Add ARM64 support to ilasm/ildasm

5 years agoDisable GC finalizearraysleep, finalizearray tests for arm32
Bruce Forstall [Wed, 17 Oct 2018 00:14:25 +0000 (17:14 -0700)]
Disable GC finalizearraysleep, finalizearray tests for arm32

Tracked by #19218

5 years agoFix behavior of TextWriter.Write with null StringBuilder (#20451)
Stephen Toub [Wed, 17 Oct 2018 00:09:11 +0000 (20:09 -0400)]
Fix behavior of TextWriter.Write with null StringBuilder (#20451)

With other overloads (including Write(object)) if you passed null it just wouldn't write anything out, so we shouldn't throw for the StringBuilder overload either.

5 years agoRemove per-AppDomain TLB (#20423)
Jan Vorlicek [Tue, 16 Oct 2018 23:42:33 +0000 (16:42 -0700)]
Remove per-AppDomain TLB (#20423)

Since there is only one AppDomain, there is no need for a per-AppDomain
TLB table for each Thread. This change removes that table and thus gets
rid of the extra indirection needed to access the TLB.

5 years agoEnable building with Clang 7 (#20417)
Jan Vorlicek [Tue, 16 Oct 2018 23:42:07 +0000 (16:42 -0700)]
Enable building with Clang 7 (#20417)

The Clang 7 is the first version in which only the major version is used in
file names and paths. So the change needed to massage the build files a bit
more than what was needed for the previous versions.

5 years agoUpdate command lines for building corefx repo (#20415)
Wes Haggard [Tue, 16 Oct 2018 23:41:42 +0000 (16:41 -0700)]
Update command lines for building corefx repo (#20415)

* Update command lines for building corefx repo

* Combine build-managed and build-native to avoid some init issues

cross and portable parameters correctly default for native builds

5 years agoUse build-test.sh script on Linux (#20430)
Egor Chesakov [Tue, 16 Oct 2018 23:12:07 +0000 (16:12 -0700)]
Use build-test.sh script on Linux (#20430)

* Use build-test.sh script on Linux (#20333)
* Use *.tgz archive format and tar tool on Unix (#20381)
* Fix paths to "..\Common\common.csproj" in ilproj (#20407)

5 years agoRemove ExportStubARM64Template support
Bruce Forstall [Tue, 16 Oct 2018 18:39:46 +0000 (11:39 -0700)]
Remove ExportStubARM64Template support

5 years agoClarify /ARM64 argument usage
Bruce Forstall [Tue, 16 Oct 2018 18:39:27 +0000 (11:39 -0700)]
Clarify /ARM64 argument usage

5 years agoFix compilation error when `FEATURE_HFA` is disabled. (#20432)
Sergey Andreenko [Tue, 16 Oct 2018 18:03:45 +0000 (11:03 -0700)]
Fix compilation error when `FEATURE_HFA` is disabled. (#20432)

5 years agoJIT: refactor logic to find compile time handle from a helper call (#20380)
Andy Ayers [Tue, 16 Oct 2018 15:34:45 +0000 (08:34 -0700)]
JIT: refactor logic to find compile time handle from a helper call (#20380)

There were 3 copies of this logic inlined into `gtFoldTypeCompare`.

Also having this functionality split out will be useful in a subsequent
change that extends `gtGetClassHandle` for some helper call cases.

So pull out the logic as a utility and refactor the 3 uses.

5 years agoExtract argInfo building from fgMorphArgs (#19658)
Carol Eidt [Tue, 16 Oct 2018 15:26:28 +0000 (15:26 +0000)]
Extract argInfo building from fgMorphArgs (#19658)

* Extract argInfo building from fgMorphArgs

This extracts the code to build the `fgArgInfo` on a call from the code that modifies the arguments.

Eliminated a pre-existing repeated traversal of the argList by changing `EvalToTmp` to take the `fgArgTabEntry` which the caller always has available.

5 years agoOptimize Span.GetPinnableReference (#20428)
Jan Kotas [Tue, 16 Oct 2018 04:39:18 +0000 (21:39 -0700)]
Optimize Span.GetPinnableReference (#20428)

* Optimize Span.GetPinnableReference

* CR feedback

5 years agoEnable building with older SDKs
Bruce Forstall [Tue, 16 Oct 2018 01:15:48 +0000 (18:15 -0700)]
Enable building with older SDKs

5 years agoAdd ARM64 support to ilasm/ilasm
Bruce Forstall [Tue, 16 Oct 2018 00:14:37 +0000 (17:14 -0700)]
Add ARM64 support to ilasm/ilasm

Remove IA-64/Itanium support.

5 years agoFix code comments in Utf16Utility (#20425)
Levi Broderick [Mon, 15 Oct 2018 20:53:02 +0000 (13:53 -0700)]
Fix code comments in Utf16Utility (#20425)

5 years agoNull out CancellationTokenSource._timer on Dispose/Cancel (#20410)
Stephen Toub [Mon, 15 Oct 2018 19:44:57 +0000 (15:44 -0400)]
Null out CancellationTokenSource._timer on Dispose/Cancel (#20410)

We already Dispose the Timer in such cases, but we don't null out the field.  That's generally fine, unless an errant CancellationToken is held onto somewhere that references the CancellationTokenSource, in which case it in turn may end up keeping the Timer alive and whatever its delegate/state reference, prolonging their GC unnecessarily.  Minor, but good house keeping, as CancellationTokens can be used in a manner that makes them longer-lived than expected.

5 years agoFix GitHub #20389 (#20391)
Fei Peng [Mon, 15 Oct 2018 19:30:25 +0000 (12:30 -0700)]
Fix GitHub #20389 (#20391)

5 years agoMerge pull request #19914 from CarolEidt/AltJitTailCall
Carol Eidt [Mon, 15 Oct 2018 17:27:22 +0000 (17:27 +0000)]
Merge pull request #19914 from CarolEidt/AltJitTailCall

Dummy TailCallCopyArgsThunk for altjit

5 years agoUpgrade symuploader to version 1.0.0-beta-63412-03 (#20394)
Mike McLaughlin [Mon, 15 Oct 2018 17:26:13 +0000 (10:26 -0700)]
Upgrade symuploader to version 1.0.0-beta-63412-03 (#20394)

Turn off verbose symbol publish logging.

5 years agoPrint target arch on arm64 and target OS during in JIT_Disasm (#20327)
Egor Chesakov [Sat, 13 Oct 2018 21:28:28 +0000 (14:28 -0700)]
Print target arch on arm64 and target OS during in JIT_Disasm (#20327)

5 years agoCorrected misspelled comment (#20408)
Joakim Skoglund [Sat, 13 Oct 2018 07:25:13 +0000 (09:25 +0200)]
Corrected misspelled comment (#20408)

5 years agoJIT: add some devirtualization info to the inline context (#20395)
Andy Ayers [Sat, 13 Oct 2018 01:30:10 +0000 (18:30 -0700)]
JIT: add some devirtualization info to the inline context (#20395)

Allows the jit to remember which calls were devirtualized and which
of those were then optimized to use an unboxed entry point. This info
is then dumped out as part of the inline tree.

Also remove some of the clutter from the COMPlus_JitPrintInlinedMethods
output stream -- we don't need to see both the in-stream results and
the final results, and we don't really need to know about the budget.
This information is still dumped for COMPlus_JitDump.

5 years agoMove ObjectAllocator phase to run right after inlining. (#20377)
Eugene Rozenfeld [Sat, 13 Oct 2018 00:35:28 +0000 (17:35 -0700)]
Move ObjectAllocator phase to run right after inlining. (#20377)

This change will support object stack allocation for the following reasons:

1. Objects should be allocated on the stack before struct promotion phase
so that their fields have a chance to be promoted.
2. Eventually object stack allocation will be performed in the same phase
as inlining since inlining heuristics will need to be aware of object stack allocation
opportunities.

I verified no x64 diffs with jit-diffs --frameworks --tests --pmi

5 years agoFix "Non-static method requires a target" caused by trying to access the HasValue...
jbhensley [Sat, 13 Oct 2018 00:25:19 +0000 (17:25 -0700)]
Fix "Non-static method requires a target" caused by trying to access the HasValue property of a nullable type through reflection when the value is null. (#20350)

5 years agoFix MacOS launch bug when spaces in module names. (#20385)
Mike McLaughlin [Fri, 12 Oct 2018 17:49:40 +0000 (10:49 -0700)]
Fix MacOS launch bug when spaces in module names. (#20385)

5 years agoImplement LeadingSignCount and LeadingZeroCount ARM64 Base Intrinsics (#20306)
Egor Chesakov [Fri, 12 Oct 2018 04:13:06 +0000 (21:13 -0700)]
Implement LeadingSignCount and LeadingZeroCount ARM64 Base Intrinsics (#20306)

5 years agofix hyperlink
Vance Morrison [Fri, 12 Oct 2018 00:02:43 +0000 (17:02 -0700)]
fix hyperlink

5 years agoAdded docs for native DLLs
Vance Morrison [Fri, 12 Oct 2018 00:00:06 +0000 (17:00 -0700)]
Added docs for native DLLs

5 years agoImprove performance of OrdinalIgnoreCase hash code calculation (#20309)
Levi Broderick [Thu, 11 Oct 2018 23:25:20 +0000 (16:25 -0700)]
Improve performance of OrdinalIgnoreCase hash code calculation (#20309)

5 years agoDo not restore or initialize buildtools for x86/arm64 (#20370)
Jarret Shook [Thu, 11 Oct 2018 22:23:17 +0000 (15:23 -0700)]
Do not restore or initialize buildtools for x86/arm64 (#20370)

* Do not restore or initialize buildtools for x86/arm64

* Remove string to download cli correctly

5 years agoDisable tracecontrol test on all platforms. (#20374)
Brian Robbins [Thu, 11 Oct 2018 21:56:20 +0000 (14:56 -0700)]
Disable tracecontrol test on all platforms. (#20374)

5 years agoChanging Number.BigInteger and Number.NumberBuffer to directly use fixed-sized buffer...
Tanner Gooding [Thu, 11 Oct 2018 21:25:40 +0000 (14:25 -0700)]
Changing Number.BigInteger and Number.NumberBuffer to directly use fixed-sized buffers (#20371)

* Moving Number.BigInteger to directly use a `fixed-sized buffer`

* Moving Number.NumberBuffer to directly use a `fixed-sized buffer`

5 years agoMerge pull request #20368 from sergign60/unwind_fix
Bruce Forstall [Thu, 11 Oct 2018 20:44:08 +0000 (13:44 -0700)]
Merge pull request #20368 from sergign60/unwind_fix

Fix for CoreRT #6253 Assertion slot != NO_REVERSE_PINVOKE_FRAME' fails

5 years agoJitEE interface additions to support object stack allocation. (#20283)
Eugene Rozenfeld [Thu, 11 Oct 2018 20:03:26 +0000 (13:03 -0700)]
JitEE interface additions to support object stack allocation. (#20283)

Add two methods to JitEE interface: getHeapClassSize and canAllocateOnStack.

Change JITEEVersionIdentifier.

5 years agoUpdate BuildTools, CoreClr, CoreFx, CoreSetup to preview1-03311-01, preview1-27011...
dotnet-maestro-bot [Thu, 11 Oct 2018 19:22:56 +0000 (12:22 -0700)]
Update BuildTools, CoreClr, CoreFx, CoreSetup to preview1-03311-01, preview1-27011-04, preview1-27011-05, preview1-27011-01, respectively (#20341)

5 years agoEnable BSTR Field Marshaller for x-plat (#20264)
Luqun Lou [Thu, 11 Oct 2018 19:21:40 +0000 (12:21 -0700)]
Enable BSTR Field Marshaller for x-plat (#20264)

5 years agoRun xunit.console.dll with "-parallel collections" option on Linux/arm (#20349)
Egor Chesakov [Thu, 11 Oct 2018 18:43:39 +0000 (11:43 -0700)]
Run xunit.console.dll with "-parallel collections" option on Linux/arm (#20349)

5 years agoInitial work to enable ASM diff generation in CI (#20366)
Bruce Forstall [Thu, 11 Oct 2018 18:29:21 +0000 (11:29 -0700)]
Initial work to enable ASM diff generation in CI (#20366)

A set of CI jobs is defined to generate assembly diffs:

```
Windows_NT x64 Checked pmi_asm_diffs
Windows_NT x86 Checked pmi_asm_diffs
Ubuntu arm Cross Checked pmi_asm_diffs
Ubuntu16.04 arm64 Cross Checked pmi_asm_diffs
Windows_NT x64_arm64_altjit Checked pmi_asm_diffs
Windows_NT x86_arm_altjit Checked pmi_asm_diffs
```

Most of the work is in the run-pmi-diffs.py script. This script:

1. Expects a "diff" build to exist.
2. Clones the baseline branch and builds it.
3. Downloads the dotnet CLI and unpacks it.
4. Clones the jitutils tree and builds it.
5. Generates asm with both the "baseline" and "diff" compilers, currently just on System.Private.CoreLib.dll, but that can be easily expanded (and perhaps we could create new jobs that do different sets of diffs, such as frameworks or benchmarks or all tests)
6. Runs jit-analyze.

The Linux arm/arm64 jobs do cross-compilation, so much zip and copy the build artifacts to a test machine to run.

This has been tested in the dev/unix_test_workflow branch, e.g. #20357

There is still some work to do:

1. Properly figure out the correct baseline commit.
2. Make the Linux arm/arm64 runs work (there are still some problems).
3. Do a better job surfacing the results, e.g., post back to the GitHub PR comments with the jit-analyze results.
4. Enable Linux x64 asm diffs jobs
5. Respond to code review feedback, e.g. (a) make various Python script improvements to handle failure modes, (b) do better temp directory creation, (c) use Tools\dotnetcli and init-tools instead of downloading/unpacking/installing a "live" dotnet CLI, (d) don't invoke run.cmd directly. Maybe use "build-test skipmanaged skipnative" instead?

5 years agoMerge pull request #20343 from stephentoub/timerevent
Vance Morrison [Thu, 11 Oct 2018 17:08:24 +0000 (10:08 -0700)]
Merge pull request #20343 from stephentoub/timerevent

Add Timer duration/period to ThreadTransferSendObj

5 years agoAdded `-generatelayout` (#20247)
Jurjen Biewenga [Thu, 11 Oct 2018 16:33:57 +0000 (18:33 +0200)]
Added `-generatelayout` (#20247)

* Added `-generatelayout`

* Update build.cmd

Removed stray paranthesis

5 years agofix enc issue where dav has an av because it tries to use the handlemanager, which...
David Mason [Thu, 11 Oct 2018 15:23:50 +0000 (08:23 -0700)]
fix enc issue where dav has an av because it tries to use the handlemanager, which isn't initialized in the dac (#20362)

5 years agoadd handle tracking for profiler (#20361)
David Mason [Thu, 11 Oct 2018 15:23:39 +0000 (08:23 -0700)]
add handle tracking for profiler (#20361)

5 years agofix issue where we wouldn't throw OOM after failing to allocate more space for finali...
David Mason [Thu, 11 Oct 2018 15:22:02 +0000 (08:22 -0700)]
fix issue where we wouldn't throw OOM after failing to allocate more space for finalize queue (#20363)

5 years agoFix for CoreRT issue Assertion slot != NO_REVERSE_PINVOKE_FRAME' failed #6253
Sergey Ignatov [Thu, 11 Oct 2018 13:56:17 +0000 (16:56 +0300)]
Fix for CoreRT issue Assertion slot != NO_REVERSE_PINVOKE_FRAME' failed #6253

5 years agoFix build breaks
Jan Kotas [Thu, 11 Oct 2018 00:25:43 +0000 (17:25 -0700)]
Fix build breaks

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoMerge pull request #20359 from BruceForstall/Disable_b152292
Bruce Forstall [Thu, 11 Oct 2018 04:31:45 +0000 (21:31 -0700)]
Merge pull request #20359 from BruceForstall/Disable_b152292

Disable b152292 for Linux/arm64

5 years agoMinor dump improvements in R2RDump (#20344)
Tomáš Rylek [Thu, 11 Oct 2018 00:53:14 +0000 (17:53 -0700)]
Minor dump improvements in R2RDump (#20344)

* Minor dump improvements in R2RDump

1) Don't silently unify available types;

2) Display RVA's for import cells to enable searching the cell by RVA
in the dump;

3) Display cell signatures for method precodes.

5 years agoDisable b152292 for Linux/arm64
Bruce Forstall [Thu, 11 Oct 2018 00:43:40 +0000 (17:43 -0700)]
Disable b152292 for Linux/arm64

Tracked by #20358

5 years agoMerge pull request #20347 from briansull/resolve-8648
Brian Sullivan [Wed, 10 Oct 2018 22:35:44 +0000 (15:35 -0700)]
Merge pull request #20347 from briansull/resolve-8648

Enable the tests associated with the fixed issue 8648

5 years agoAdd CancellationToken.UnsafeRegister (#20342)
Stephen Toub [Wed, 10 Oct 2018 21:10:12 +0000 (17:10 -0400)]
Add CancellationToken.UnsafeRegister (#20342)

Expose an equivalent to Register that doesn't flow ExecutionContext and thus doesn't capture AsyncLocals.

5 years agoAdded advice about using ZapDisable to get symbols
Vance Morrison [Wed, 10 Oct 2018 21:04:57 +0000 (14:04 -0700)]
Added advice about using ZapDisable to get symbols

5 years agoRemove obslete DBG_printf_gcc, all compilers now support DBG_printf_c99 (#20338)
Jonathan Marler [Wed, 10 Oct 2018 21:03:37 +0000 (15:03 -0600)]
Remove obslete DBG_printf_gcc, all compilers now support DBG_printf_c99 (#20338)

5 years agoFix unwind on ARM64 Linux (#20345)
Jan Vorlicek [Wed, 10 Oct 2018 21:00:28 +0000 (14:00 -0700)]
Fix unwind on ARM64 Linux (#20345)

The libunwind cannot unwind from `__libc_start_main` to `_start` on
Linux ARM64 with glibc <= 2.27, because the `__libc_start_main` is
missing unwind info. While we already have a way to detect such case
when the same issue happens for `_start`, we were triggering it only in
case unw_step returned 0. For this case, it returns 1 though, which is
also a valid success indicator.
The result is that .NET core starts spinning infinitely in case an
unhandled exception happens on ARM64.
The fix is to update the check to test for the return value being >= 0.

5 years agoFix typo
Vance Morrison [Wed, 10 Oct 2018 20:29:39 +0000 (13:29 -0700)]
Fix typo

5 years agoImprove instructions on getting framework symbols
Vance Morrison [Wed, 10 Oct 2018 20:28:28 +0000 (13:28 -0700)]
Improve instructions on getting framework symbols

5 years agoMerge pull request #20348 from BruceForstall/ReducePri1TestCount
Bruce Forstall [Wed, 10 Oct 2018 19:17:25 +0000 (12:17 -0700)]
Merge pull request #20348 from BruceForstall/ReducePri1TestCount

Reduce the number of expected Pri-1 tests

5 years agoReduce the number of expected Pri-1 tests
Bruce Forstall [Wed, 10 Oct 2018 19:14:21 +0000 (12:14 -0700)]
Reduce the number of expected Pri-1 tests

The number has shrunk lately due to removing CoreMangLib tests.

5 years agoEnable the tests associated with the fixed issue 8648
Brian Sullivan [Wed, 10 Oct 2018 18:33:38 +0000 (11:33 -0700)]
Enable the tests associated with the fixed issue 8648

5 years agoThrow an exception when we try to marshal a non-blittable fixed buffer. (#20263)
Jeremy Koritzinsky [Wed, 10 Oct 2018 17:04:48 +0000 (10:04 -0700)]
Throw an exception when we try to marshal a non-blittable fixed buffer. (#20263)

* Throw an exception when we try to marshal a non-blittable fixed buffer.

* Move function prototype into fieldmarshaler.cpp

5 years agoMerge pull request #20337 from BruceForstall/DisableStackTracePreserveTests
Bruce Forstall [Wed, 10 Oct 2018 16:48:50 +0000 (09:48 -0700)]
Merge pull request #20337 from BruceForstall/DisableStackTracePreserveTests

Disable StackTracePreserveTests

5 years agoMerge pull request #20310 from fiigii/nogeneric
Carol Eidt [Wed, 10 Oct 2018 16:29:19 +0000 (16:29 +0000)]
Merge pull request #20310 from fiigii/nogeneric

 Explode generic Intel hardware intrinsic on all the supported types

5 years agoAdd Timer duration/period to ThreadTransferSendObj
Stephen Toub [Wed, 10 Oct 2018 15:45:40 +0000 (11:45 -0400)]
Add Timer duration/period to ThreadTransferSendObj

5 years agoDelete redundant API tests (#20336)
Jan Kotas [Wed, 10 Oct 2018 06:31:39 +0000 (23:31 -0700)]
Delete redundant API tests (#20336)

Contributes to dotnet/coreclr#12782

5 years agoFix test JIT\Regression\VS-ia64-JIT\M00\b80373 (#20321)
mikedn [Wed, 10 Oct 2018 05:24:32 +0000 (08:24 +0300)]
Fix test JIT\Regression\VS-ia64-JIT\M00\b80373 (#20321)

On 64 bit hosts it does a 64 bit store to a 32 bit parameter and corrupts the stack. A previous implementation of fgMarkAddressExposedLocals did not mark the parameter as address exposed, allowing the optimizer to remove the dead store and thus hide the incorrect code.

5 years agoFix issue 20261: infinite recursion for non PAL threads (#20267)
Jonathan Marler [Wed, 10 Oct 2018 03:21:30 +0000 (21:21 -0600)]
Fix issue 20261: infinite recursion for non PAL threads (#20267)

5 years agoDisable StackTracePreserveTests
Bruce Forstall [Tue, 9 Oct 2018 23:59:18 +0000 (16:59 -0700)]
Disable StackTracePreserveTests

Tracked by #20322

5 years agoReduce CPU consumption by Timer's FireNextTimers (#20302)
Stephen Toub [Tue, 9 Oct 2018 22:05:46 +0000 (18:05 -0400)]
Reduce CPU consumption by Timer's FireNextTimers (#20302)

* Reduce CPU consumption by Timer's FireNextTimers

Historically, in certain applications that were Timer-heavy (either via direct use or via wrappers like Task.Delay), timer-related operations like creation (ctor), destruction (Dispose), and firing (internally in FireNextTimers) were relatively expensive. A single linked queue of timers was maintained and protected by a single lock, such that every creation, destruction, and firing would require taking that lock and operating on the list.

In .NET Core 2.1, we improved this significantly to reduce contention by splitting the single lock and queue into N partitions, each with its own lock and queue (and native timer that triggers the processing of that queue). This enables lots of threads that would otherwise all be contending for timer creation/destruction/firing to now spread the load across the various partitions. This made a significantly positive and measurable impact on these timer-heavy workloads, in particular for workloads that created and destroyed lots of timers with most never actually firing (e.g. where timers are used to implement timeouts, and most things don't timeout).

However, we still see some apps that rely heavily on timers firing, in particular with apps that have tens of thousands or hundreds of thousands of periodic timers, with lots of time spent inside FireNextTimers (the function that's invoked when the native timer for a partition fires to process whatever set of timers may be ready to fire in its queue). This operation currently walks the whole list of that queue's timers, such that it needs to touch and do a little work for every scheduled timer in that partition, even if only one or a few timers actually need to fire. The more timers are scheduled, even if they're for a time far in the future, the more costly FireNextTimers becomes. And as FireNextTimers is invoked while holding that partition's lock, this also then slows down any code paths trying to create/destroy timers on the same partition.

This PR attempts to address the most impactful cases of that. Instead of each partition maintaining a single queue, we simply split the queue into two: a "short" list that contains all scheduled timers with a next firing time that's <= some absolute threshold, and a "long" list for the rest. When FireNextTimers is invoked, we walk the "short" list, processing it as we do today. If the current time is less than or equal to the absolute threshold, then we know we don't need to examine the long list and can skip it and the (hopefully) majority of timers it contains. If, however, we're beyond that time or the short list becomes empty, we continue to process the long list as we do today, with the slight modification that we then also move to the short list anything with a due time that puts it at or under the threshold, which is reset to point to a time short into the future. When new timers are added, we just add them to the appropriate list based on their due time.

The theory behind this is that the problematic cases are when we have lots of long-lived timers that rarely fire but today we're having to examine them every time any timer fires; by maintaining a short list that ideally has only a small subset of the timers, we can avoid touching the majority of the timers each time FireNextTimers is called, on average. This doesn't change the O(N) complexity of FireNextTimers, but it should often reduce the size of N significantly.  Synthetic workloads have shown that it often reduces the cost of FireNextTimers to just 5-10% of what it was previously, and without increasing the cost of the fast add/dispose path measurably.

(An alternative approach considered is to use a priority queue / heap for the timer list. This would allow for FireNextTimers to pull off in O(log N) time each of the next timers to fire, hopefully making FireNextTimers much cheaper. However, it comes at the expense of making creation and destruction also O(log N) instead of O(1). And in cases where all timers in the list needed to fire, it would make FireNextTimers O(N log N) instead of O(N). It is, however, an approach that could be pursued if this approach proves less effective in real-world applications than expected.)

* Address PR feedback

Improve handling of the case where the short list ends up empty.

Also fix an issue I noticed around the setting of m_currentAbsoluteThreshold.

5 years agoUpdate BuildTools, CoreFx, CoreSetup to preview1-03309-01, preview1-27009-06, preview...
dotnet-maestro-bot [Tue, 9 Oct 2018 22:05:22 +0000 (15:05 -0700)]
Update BuildTools, CoreFx, CoreSetup to preview1-03309-01, preview1-27009-06, preview1-27009-01, respectively (#20316)

5 years agoDo not promote struct field with type mistmatch. (#20085)
Sergey Andreenko [Tue, 9 Oct 2018 22:03:19 +0000 (15:03 -0700)]
Do not promote struct field with type mistmatch. (#20085)

* Add a test that reads int field as double.

It fails in `void CodeGen::genCodeForStoreInd(GenTreeStoreInd* tree)`  on `assert(!varTypeIsFloating(targetType) || (targetType == data->TypeGet()));`.

* Fix for the previous test.

No asm diffs.

* Add a test that reads struct field as another struct type.

It fails with assert `Compiler::StructPromotionHelper::CheckFakedType` `assert(fakedFieldsMap.Lookup(fieldHnd));`.

* Fix the previous test.

Check that we promote with the same class.

* Add a test case for accessing an invalid offset.

It fails in `fgMorphStructField` with `noway_assert(fieldLclIndex != BAD_VAR_NUM);`.

* Fix the previous test.

Reject field promotion if offset is invalid. No asm diffs.

5 years agoSimplify next command output for build-test.sh (#19903)
Bruce Forstall [Tue, 9 Oct 2018 22:00:59 +0000 (15:00 -0700)]
Simplify next command output for build-test.sh (#19903)

Simplify next command output for build-test.sh

5 years agoMove ARM64 Windows boxen to be Helix-provisioned (#20204)
Matt Galbraith [Tue, 9 Oct 2018 21:18:50 +0000 (14:18 -0700)]
Move ARM64 Windows boxen to be Helix-provisioned (#20204)

5 years agoUse runtest.cmd for arm(64) windows testing (#20301)
Jarret Shook [Tue, 9 Oct 2018 21:17:49 +0000 (14:17 -0700)]
Use runtest.cmd for arm(64) windows testing (#20301)

* Use runtest.cmd for arm(64) windows testing

* Correct archival

* Address pr feedback

* Correct containsKey to containsValue

* Change to just use contains

5 years agoMerge pull request #20129 from briansull/vn-add-exception-sets
Brian Sullivan [Tue, 9 Oct 2018 20:32:50 +0000 (13:32 -0700)]
Merge pull request #20129 from briansull/vn-add-exception-sets

Full support for exception sets in value numbering.