platform/upstream/dotnet/runtime.git
5 years agoMerge pull request dotnet/coreclr#27117 from erozenfeld/RenameTest
Eugene Rozenfeld [Thu, 10 Oct 2019 05:27:50 +0000 (22:27 -0700)]
Merge pull request dotnet/coreclr#27117 from erozenfeld/RenameTest

Rename tests for issue 27107.

Commit migrated from https://github.com/dotnet/coreclr/commit/978f0426fee9faf3b2427b7bb1b6d216f901cfef

5 years agoFinish `Statement` rework. (dotnet/coreclr#26876)
Sergey Andreenko [Thu, 10 Oct 2019 04:13:02 +0000 (21:13 -0700)]
Finish `Statement` rework. (dotnet/coreclr#26876)

* Delete a leftover for STMT and update dump examples.

* Prepare `GetNextStmt` and `GetPrevStmt` to be used as main read accesors.

* Rename `Statement->gtNext` to `m_nextStmt` and make private.

* Rename `Statement->gtPrev` to `m_prev` and make private.

* Rename `gtStmtLastILoffs` to `m_lastILOffset` and make it private.

* Rename `gtStmtILoffsx` to `m_ILOffsetX` and make it private.

* Rename `compilerAdded` to `m_compilerAdded` and make it private.

* Rename `gtInlineContext` to `m_inlineContext` and make it private.

* Rename `gtStmtList` to `m_treeList` and make it private.

* Rename `gtStmtExpr` to `m_rootTree` and make it private.

* Update the class layout acording to our spec.

* Update the docs.

* Delete another forgotten line.

* Rename `m_rootTree` to `m_TreeRoot`.

Keep it consistent with `m_treeList` .

* Rename `m_TreeRoot` to `m_rootNode`.

* Add comments.

Commit migrated from https://github.com/dotnet/coreclr/commit/e0f4a6477f1656648f3469adf4a1d0bbc1c1e60d

5 years agoFix crossgen2 skipped methods NullReferenceException (dotnet/coreclr#27028)
Simon Nattress [Thu, 10 Oct 2019 00:11:42 +0000 (17:11 -0700)]
Fix crossgen2 skipped methods NullReferenceException (dotnet/coreclr#27028)

* Fix crossgen2 skipped methods NullReferenceException

https://github.com/dotnet/coreclr/pull/26756 introduced skipping methods based on filtering criteria, publishing empty code for methods which are skipped.
`ShouldSkipCompilation` reads properties on types and methods and can trigger type loads and thus throw `TypeLoadException`. Currently when that happens, we will not publish empty code for the method and hit the catch in `ComputeDependencyNodeDependencies`. Later when the node is scanned for dependencies, it is in a zombie state with `_methodCode` still null.

Move the `ShouldSkipCompilation` check under the `CompileMethodInternal` try/catch which will appropriately call `PublishEmptyCode` if there's a `TypeSystemException`.

Commit migrated from https://github.com/dotnet/coreclr/commit/56a97e6dc5d6ac7d413edf6ca8ab28fa77b1f255

5 years agoRename tests for issue 27107.
Eugene Rozenfeld [Wed, 9 Oct 2019 23:17:06 +0000 (16:17 -0700)]
Rename tests for issue 27107.

dotnet/coreclr#27108 fixed dotnet/coreclr#27107 but the tests had an incorrect placeholder name.

Rename the test directory and files.

Commit migrated from https://github.com/dotnet/coreclr/commit/21030064b170aa922d4dfed8ede9a936893dce24

5 years agoJIT: allow block cloning opt in methods with EH (dotnet/coreclr#27088)
Andy Ayers [Wed, 9 Oct 2019 22:34:54 +0000 (15:34 -0700)]
JIT: allow block cloning opt in methods with EH (dotnet/coreclr#27088)

Update `fgOptimizeUncondBranchToSimpleCond` to handle methods with EH. Also
rework the helpers a bit to make them more time-efficient.

Commit migrated from https://github.com/dotnet/coreclr/commit/60ff0227b75495561269ee1b28d32d9431e62691

5 years agoMerge pull request dotnet/coreclr#27108 from erozenfeld/Fix27107
Eugene Rozenfeld [Wed, 9 Oct 2019 22:13:20 +0000 (15:13 -0700)]
Merge pull request dotnet/coreclr#27108 from erozenfeld/Fix27107

Fix ADDR(IND(tree))=>tree transformation in morph.

Commit migrated from https://github.com/dotnet/coreclr/commit/1c34c94fe7b0ed75326ef41d924b0bd232355ffe

5 years agoFix ADDR(IND(tree))=>tree transformation in morph.
Eugene Rozenfeld [Wed, 9 Oct 2019 19:36:47 +0000 (12:36 -0700)]
Fix ADDR(IND(tree))=>tree transformation in morph.

ADDR(IND(tree)) => tree transformation was losing zero field
sequence annotation that was causing incorrect value numbering
and asserts in the CSE optimization.

Fixes dotnet/coreclr#27107.

Commit migrated from https://github.com/dotnet/coreclr/commit/f929febb8d6cb5ff5783da0d4eddd6e8695c4710

5 years agoFix F5 experience in VS for crossgen2 (dotnet/coreclr#27104)
Michal Strehovský [Wed, 9 Oct 2019 19:24:10 +0000 (21:24 +0200)]
Fix F5 experience in VS for crossgen2 (dotnet/coreclr#27104)

Ever since dotnet/coreclr#26792 I wasn't able to F5 launch the crossgen2 project from the src\tools\crossgen2\crossgen2.sln solution. I tried git clean, updating VS, etc. until I convinced myself this is really broken for everyone.

The error was:

```
It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '3.0.0' was not found.
  - No frameworks were found.
```

I narrowed this down to the various json config file gunk. Not generating the json file gunk makes the old setup work again. We likely don't need the crossgen2/libs hack anymore either.

Commit migrated from https://github.com/dotnet/coreclr/commit/088299e2b7f439dfd1f5056fdc291b9d82149fc1

5 years agoAdd new ready to run helper to managed tools (dotnet/coreclr#27102)
Michal Strehovský [Wed, 9 Oct 2019 14:17:05 +0000 (16:17 +0200)]
Add new ready to run helper to managed tools (dotnet/coreclr#27102)

Follow up to dotnet/coreclr#26807.

Commit migrated from https://github.com/dotnet/coreclr/commit/ad54f6e03e77c38482d8538550f1bc13b3267015

5 years agoEnsure that GC suspension does not modify last error (dotnet/coreclr#27099)
Jan Kotas [Wed, 9 Oct 2019 12:47:03 +0000 (05:47 -0700)]
Ensure that GC suspension does not modify last error (dotnet/coreclr#27099)

There are no known bugs that this is fixing. These fixes are based on codereview.

Commit migrated from https://github.com/dotnet/coreclr/commit/10e69e1075472121488a7053694c7f690219146f

5 years agoReplace isHfaArg with IsHfaArg()
Sinan Kaya [Wed, 9 Oct 2019 08:17:55 +0000 (01:17 -0700)]
Replace isHfaArg with IsHfaArg()

Commit migrated from https://github.com/dotnet/coreclr/commit/9e6f164a41cfe6af6a7de2765eb4a6cc695032cd

5 years agoRemove some unused code in binder (dotnet/coreclr#27095)
Elinor Fung [Wed, 9 Oct 2019 02:47:43 +0000 (19:47 -0700)]
Remove some unused code in binder (dotnet/coreclr#27095)

Commit migrated from https://github.com/dotnet/coreclr/commit/1ced1af44e3fc3c8e0ccca4b846b5e635ba0c3bc

5 years agocleanup: remove several redundant conditions found by cppcheck (dotnet/coreclr#27001)
Ilya Shipitsin [Wed, 9 Oct 2019 00:14:04 +0000 (05:14 +0500)]
cleanup: remove several redundant conditions found by cppcheck (dotnet/coreclr#27001)

* src/utilcode/ilformatter.cpp: remove redundant condition

[src/utilcode/ilformatter.cpp:274] -> [src/utilcode/ilformatter.cpp:278]: (warning) Identical inner 'if' condition is always true.
[src/utilcode/ilformatter.cpp:285] -> [src/utilcode/ilformatter.cpp:287]: (warning) Identical inner 'if' condition is always true.

* src/utilcode/regutil.cpp: remove redundant condition

[src/utilcode/regutil.cpp:57] -> [src/utilcode/regutil.cpp:64]: (style) The if condition is the same as the previous if condition

* src/utilcode/loaderheap.cpp: remove redundant condition

[src/utilcode/loaderheap.cpp:860] -> [src/utilcode/loaderheap.cpp:865]: (style) The if condition is the same as the previous if condition

* src/pal/src/synchobj/mutex.cpp: remove redundant condition

[src/pal/src/synchobj/mutex.cpp:1273] -> [src/pal/src/synchobj/mutex.cpp:1298]: (style) The if condition is the same as the previous if condition

* src/utilcode/ilformatter.cpp: add closing bracket back
(occasionaely deleted in previous commit)

Commit migrated from https://github.com/dotnet/coreclr/commit/c44fd8cce65fb77a718459d0c9af983d4e325788

5 years agoOptimize ToString() for byte, ushort, uint and ulong (dotnet/coreclr#27056)
Egor Bogatov [Wed, 9 Oct 2019 00:02:45 +0000 (03:02 +0300)]
Optimize ToString() for byte, ushort, uint and ulong (dotnet/coreclr#27056)

Commit migrated from https://github.com/dotnet/coreclr/commit/020639bdb3580ddf6ddc7e5723310d9175fba44c

5 years agoReplace InternalLoadUnmanagedDllFromPath with NativeLibrary.Load (dotnet/coreclr...
Ryan Lucia [Tue, 8 Oct 2019 23:23:06 +0000 (19:23 -0400)]
Replace InternalLoadUnmanagedDllFromPath with NativeLibrary.Load (dotnet/coreclr#27090)

Both just call into NDirect::LoadLibraryFromPath, and so this simplifies the code by removing a superfluous QCall

Commit migrated from https://github.com/dotnet/coreclr/commit/b3efcae9f917f57417418f462c4244e0feade689

5 years agoRename genAlignLoops (dotnet/coreclr#27030)
Sinan Kaya [Tue, 8 Oct 2019 23:09:24 +0000 (16:09 -0700)]
Rename genAlignLoops (dotnet/coreclr#27030)

* find src/jit -type f -exec sed -i -e 's/.*declspec.*genAlignLoops.*//g' {} \;

* Go back to doAlignLoops

* Rename to ShouldAlignLoops

Commit migrated from https://github.com/dotnet/coreclr/commit/8df2e7b38211e0a2b6bad706a473f181ec1cb3fb

5 years agoReplace gtRegNum with GetRegNum() (dotnet/coreclr#27086)
Sinan Kaya [Tue, 8 Oct 2019 23:08:04 +0000 (16:08 -0700)]
Replace gtRegNum with GetRegNum() (dotnet/coreclr#27086)

* find src/jit -type f -exec sed -i -e 's/.*declspec.*gtRegNum.*//g' {} \;

Regnum

gtRegNum

GetRegNum

gtRegNum

Format patch

Align document

Rename

* Use Set function

Commit migrated from https://github.com/dotnet/coreclr/commit/45324ac7928fb45a6337dff37d8db37fa86b988d

5 years agoEnable optimized single-proc allocation helpers for single-proc x86/x64 systems only...
Jan Kotas [Tue, 8 Oct 2019 02:04:18 +0000 (19:04 -0700)]
Enable optimized single-proc allocation helpers for single-proc x86/x64 systems only (dotnet/coreclr#27014)

Use maximum number of processors the process may run on to determine whether it is ok to use
single-proc allocation helpers. It is not sufficient to depend on current process affinity since
that can change during the process lifetime.

Also, the single-proc allocation helpers work well on x86/x64 systems only because of they depend
on atomic non-interlocked increment instruction for good performance. Such instruction is available
on x86/x64 only. Disable them everywhere else.

Fixes dotnet/coreclr#26990

Commit migrated from https://github.com/dotnet/coreclr/commit/4e702da2c06ded8239d5eb2f47619604efbf3fde

5 years agoAdd crossgen2 option to specify JIT library path (dotnet/coreclr#26967)
Anton Lapounov [Tue, 8 Oct 2019 01:11:39 +0000 (18:11 -0700)]
Add crossgen2 option to specify JIT library path (dotnet/coreclr#26967)

Commit migrated from https://github.com/dotnet/coreclr/commit/7d4e358140ebd55531b584a244a8d8767ddc7cea

5 years agoRemove SQL callout cookie from JIT. (dotnet/coreclr#27069)
Aaron Robinson [Tue, 8 Oct 2019 00:05:31 +0000 (17:05 -0700)]
Remove SQL callout cookie from JIT. (dotnet/coreclr#27069)

* Remove SQL callout cookie from JIT.

* Update CLR ABI documentation.

Commit migrated from https://github.com/dotnet/coreclr/commit/abd4442322981e4fdc5ca05ce9c939e651c36e59

5 years agoExplicitly make our minimum ICU version be the version availab… (dotnet/coreclr#27042)
Jeremy Koritzinsky [Mon, 7 Oct 2019 23:11:51 +0000 (16:11 -0700)]
Explicitly make our minimum ICU version be the version availab… (dotnet/coreclr#27042)

* Explicitly make our minimum ICU version be the version available in Alpine 3.6.

* Also check the lower end of the supported version range (to make sure that the range is accurate. Use #error instead of static_assert since we're in C.

* Only define minimum ICU version on Alpine.

* Update ICU version range based on PR feedback.

Commit migrated from https://github.com/dotnet/coreclr/commit/2d80d4fc6b81108ce396db46212cc7baccbddd29

5 years agoRevert "Preparatory changes for implementing Crossgen2 pipeline (dotnet/coreclr#26908...
Tomáš Rylek [Mon, 7 Oct 2019 22:27:57 +0000 (15:27 -0700)]
Revert "Preparatory changes for implementing Crossgen2 pipeline (dotnet/coreclr#26908)" (dotnet/coreclr#27073)

This reverts commit dotnet/coreclr@6ab52d607a3e2a65030b8668a759f717a7bf6ee8.

Commit migrated from https://github.com/dotnet/coreclr/commit/88295e4c3b42e3bf6420241196cf8f4fe427da7c

5 years agoFix crossgen2 for methods with StackCrawlMark (dotnet/coreclr#27050)
Jan Vorlicek [Mon, 7 Oct 2019 19:44:47 +0000 (21:44 +0200)]
Fix crossgen2 for methods with StackCrawlMark (dotnet/coreclr#27050)

* Fix crossgen2 for methods with StackCrawlMark

Methods using StackCrawlMark (like Assembly.GetExecutingAssembly)
require that the method is not inlined. Such methods are marked by
System.Security.DynamicSecurityMethod attribute.

This change adds proper handling of such methods, mimicking exactly what
old crossgen does.

Commit migrated from https://github.com/dotnet/coreclr/commit/98c2d5ff70059d115fe38bc6c19956a721e33558

5 years agoImprove superilc test copying speed and cleanup (dotnet/coreclr#27025)
Jan Vorlicek [Mon, 7 Oct 2019 19:39:46 +0000 (21:39 +0200)]
Improve superilc test copying speed and cleanup (dotnet/coreclr#27025)

The superilc is copying all files that are not found to be managed
assemblies from the original test folder to the target folder.
This includes .pdb and .ilk files that are huge and slow down the
copying process significantly. And they are not needed anyways. So this
change filters these files out.

During cleanup, superilc was removing all .out folders. But I've found
that in most cases, I want it to remove only these folders for crossgen or
crossgen2 based on the compiler types selected using command line
options. This allows me to keep crossgen results and keep comparing them
with new crossgen2 results as I work on fixing issues.
So I have added such a functionality.

Commit migrated from https://github.com/dotnet/coreclr/commit/b015c8433186f5e1a4bb6fd5da334499640ba2e2

5 years agoClean up our CMake scripts using features introduced between 3… (dotnet/coreclr#26980)
Jeremy Koritzinsky [Mon, 7 Oct 2019 19:11:15 +0000 (12:11 -0700)]
Clean up our CMake scripts using features introduced between 3… (dotnet/coreclr#26980)

* Try to remove the CLR_CMAKE_COMPILER weirdness.

* Cleanup phase 1.

Fixes CMake's incremental build, but makes MSBuild complain about it's incremental build possibly not working.

* Drive dac and crossgen-specific defines through target properties.

* First pass of consolidation of singularly nested CMakeLists.txt files.

* Convert metadata libraries to not use leaf folders for dac/runtime/crossgen/dbi variations.

* Clean up some of the non-arm assembly file handling.

* Encapsulate arm/arm64 manual preprocessing and compilation of assembly files into a cmake function preprocess_compile_asm.

* Fix typo.

* Convert usages of add_precompiled_header to target_precompile_header everywhere except the jit.

* Clean up/remove some leaf CMake files that are just simple target creation (where most of the work was done in the parent).

* Remove unused CMakeLists file and folder.

* Clean up coreclr/CMakeLists.txt

* Remove conditions based on CMake version (since we're unifying on CMake 3.14)

* Convert final usages of add_precompiled_header to target_precompile_header and remove add_precompiled_header.

* Handle the AsmConstants.inc inclusion in cee_wks by marking it a header file instead of making a custom target.

* Move from deprecated FindPythonInterp module to FindPython module.

* Remove unused jitpch.cpp

* Fix typo.

* Have get_compile_definitions correctly split out generator expressions for multiple-valued generator expressions.

* preprocess_def_file -> preprocess_file and make it work xplat.

* Fix test build.

* Fix typo in flag.

* Fix resource building on non-windows.

* Fix other linker flag typo I missed.

* Add missing eventing_headers dependency.

* Fix multivalued generator expression.

* Use CMake 3.x features to significantly simplify toolchain.cmake.

* Remove references to LLDB from gen-buildsys-* (these aren't needed since SOS moved out of the repo).

* Remove debugging line

* Check check_pie_supported

* Clean up link flags.

* Fix copy-paste typo

* Cleanup. Change some conditions in configurecompiler to check for MSVC specifically, not Windows.

* Restore the llldb include and library path searching.

* Restore asmconstants_inc custom target.

Commit migrated from https://github.com/dotnet/coreclr/commit/59c7b7e84ab3a74d3939abd0c0f973d2bb9e8a70

5 years agoRename isSplit (dotnet/coreclr#27011)
Sinan Kaya [Mon, 7 Oct 2019 17:38:39 +0000 (13:38 -0400)]
Rename isSplit (dotnet/coreclr#27011)

* __declspec(property(get = getIsSplit, put = setIsSplit)) bool isSplit;

* Format patch

* SetSplit

* GetSplit

* Forgotten conversions

* Add more forgotten

* Rename agein

Commit migrated from https://github.com/dotnet/coreclr/commit/601a4ae2a1a17e43c2f09952e51e16176090258a

5 years agoPrint tier in DumpJittedMethods. (dotnet/coreclr#27017)
Sergey Andreenko [Mon, 7 Oct 2019 17:30:55 +0000 (10:30 -0700)]
Print tier in DumpJittedMethods. (dotnet/coreclr#27017)

* Print tier in DumpJittedMethods.

I found that useful when reproducing bugs that require `complus_TieredCompilation=1`.

Example:
```
Compiling    0 System.SpanHelpers::IndexOf, IL size = 902, hsh=0xda613814 for Tier-1
Compiling    1 System.Text.Unicode.Utf16Utility::GetPointerToFirstInvalidChar, IL size = 1107, hsh=0xe576e43d
Compiling    2 System.Runtime.Intrinsics.Vector128::CreateScalarUnsafe, IL size = 21, hsh=0x6746a268 for Tier-0
```

* Fix JitFunctionTrace printing.

The opening is using decimal number, but the closing was using hex.

* Add compGetTieringName.

Commit migrated from https://github.com/dotnet/coreclr/commit/a6a38a77b1cedef1ab90a404b53550c851d9c2c3

5 years agoInitial perf jitdump implementation (dotnet/coreclr#26897)
Steve MacLean [Mon, 7 Oct 2019 17:12:16 +0000 (13:12 -0400)]
Initial perf jitdump implementation (dotnet/coreclr#26897)

* Initial perf jitdump implementation

When COMPlus_PerfMapEnabled is enabled, generate jitdump file.

Usage:

export COMPlus_PerfMapEnabled=1
perf record -k 1 -g corerun helloworld.dll
perf --debug verbose=10 inject --input perf.data --jit --output perfjit.data
perf report --input perfjit.data

Works best with latest perf with patches:

Repo: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
Branch: perf/urgent
Patches:
- https://lkml.org/lkml/2019/10/2/875

cd tools/perf && make DEBUG=1

Commit migrated from https://github.com/dotnet/coreclr/commit/0868d201937d9d88f465fabe5c85f51e4e95f2d2

5 years agoImplement stack probing using helpers on (win|linux)-(x86|x64) (dotnet/coreclr#26807)
Egor Chesakov [Mon, 7 Oct 2019 16:46:35 +0000 (09:46 -0700)]
Implement stack probing using helpers on (win|linux)-(x86|x64) (dotnet/coreclr#26807)

* Implement JIT_StackProbe (CORINFO_HELP_STACK_PROBE) helper in assembly on win-x64, win-x86, linux-x64, linux-x86 in src/vm/amd64 and src/vm/i386

* Insert a call to CORINFO_HELP_STACK_PROBE helper instead of inlining a stack probing loop in src/jit/codegenxarch.cpp

* Add READYTORUN_HELPER_StackProbe and its mapping to CORINFO_HELP_STACK_PROBE in src/inc/readytorun.h and src/inc/readytorunhelpers.h

* Update crossgen2 JitInterface and JITEEVersionIdentifier in src/inc/corinfo.h and src/tools/crossgen2/jitinterface/jitwrapper.cpp

* Add test templates (T4) for stack probing tests in tests/src/JIT/Regression/JitBlue/GitHub_21061/GitHub_21061_StackOverflowIn(Function|Funclet)Prolog.tt

Commit migrated from https://github.com/dotnet/coreclr/commit/2ca2b2b21b45079d23c73d06ffc6daf6c9fd0af4

5 years agoAdd csproj and bash script for crossgen2 ThunkGenerator (dotnet/coreclr#26916)
Jakob Botsch Nielsen [Mon, 7 Oct 2019 16:11:23 +0000 (18:11 +0200)]
Add csproj and bash script for crossgen2 ThunkGenerator (dotnet/coreclr#26916)

Commit migrated from https://github.com/dotnet/coreclr/commit/58084a2f5e1879169a737ee29fb272a5bb223d62

5 years agoMake it possible to compile apps that target WindowsDesktop SDK (dotnet/coreclr#27037)
Michal Strehovský [Mon, 7 Oct 2019 15:05:52 +0000 (17:05 +0200)]
Make it possible to compile apps that target WindowsDesktop SDK (dotnet/coreclr#27037)

We were missing some p/invoke related stuff.

Commit migrated from https://github.com/dotnet/coreclr/commit/e59c3aee22b69f68352ed52099b882507ea79bfc

5 years agoMore CompareInfo.IndexOf globalization fixes (dotnet/coreclr#27049)
Jan Kotas [Sun, 6 Oct 2019 19:01:55 +0000 (12:01 -0700)]
More CompareInfo.IndexOf globalization fixes (dotnet/coreclr#27049)

Apply earlier CompareInfo.StartsWith fixes onto CompareInfo.IndexOf as well

Commit migrated from https://github.com/dotnet/coreclr/commit/af55c1b707d27a938c65742dc2522d88d7580108

5 years ago[master] Update dependencies from dotnet/corefx (dotnet/coreclr#26965)
dotnet-maestro[bot] [Sun, 6 Oct 2019 14:05:27 +0000 (14:05 +0000)]
[master] Update dependencies from dotnet/corefx (dotnet/coreclr#26965)

* Update dependencies from https://github.com/dotnet/corefx build 20190930.12

- Microsoft.NETCore.Platforms - 5.0.0-alpha1.19480.12
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19480.12

* Update dependencies from https://github.com/dotnet/corefx build 20191001.13

- Microsoft.NETCore.Platforms - 5.0.0-alpha1.19501.13
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19501.13

* Update dependencies from https://github.com/dotnet/corefx build 20191002.6

- Microsoft.NETCore.Platforms - 5.0.0-alpha1.19502.6
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19502.6

* Update dependencies from https://github.com/dotnet/corefx build 20191003.5

- Microsoft.NETCore.Platforms - 5.0.0-alpha1.19503.5
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19503.5

* Disable newly added Utf8SpanTests

* Update dependencies from https://github.com/dotnet/corefx build 20191004.9

- Microsoft.NETCore.Platforms - 5.0.0-alpha1.19504.9
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19504.9

* Update dependencies from https://github.com/dotnet/corefx build 20191005.5

- Microsoft.NETCore.Platforms - 5.0.0-alpha1.19505.5
- Microsoft.Private.CoreFx.NETCoreApp - 5.0.0-alpha1.19505.5

Commit migrated from https://github.com/dotnet/coreclr/commit/93a3714f509ed71460d2a315ec6280dc3d54df8d

5 years agoPreparatory changes for implementing Crossgen2 pipeline (dotnet/coreclr#26908)
Tomáš Rylek [Sun, 6 Oct 2019 13:01:10 +0000 (06:01 -0700)]
Preparatory changes for implementing Crossgen2 pipeline (dotnet/coreclr#26908)

1) Modify CoreCLR pipelines to use the zipping / unzipping templates
for manipulating the product build.

2) Pass the crossgen option to product build so that it crossgens the
framework assemblies.

3) After my recent split of native vs. managed test artifact build
build-job and xplat-test-job ended up with quite a few variable
duplications. I have just modified the two jobs
needing the common variables (build-job and
crossgen-comparison-job) to use the more specialized template
xplat-test-job instead of xplat-job they used before.

4) Optimize the pipeline to reuse *nix managed artifacts across
architectures. For Windows we're currently splitting managed
artifacts by bitness which matters for some reason I'll investigate
next.

Thanks

Tomas

Commit migrated from https://github.com/dotnet/coreclr/commit/6ab52d607a3e2a65030b8668a759f717a7bf6ee8

5 years agoNew fix for dotnet/coreclr#26417 - Don't allow the hoisting of GT_CLS_VARs that were...
Brian Sullivan [Sun, 6 Oct 2019 00:39:37 +0000 (17:39 -0700)]
New fix for dotnet/coreclr#26417 - Don't allow the hoisting of GT_CLS_VARs that were assigned a constant value. (dotnet/coreclr#26952)

* Fix issue dotnet/coreclr#26417 = Incorrect caching of loop variable
Contributes to issue  dotnet/coreclr#7147 - JIT: Loop hoisting re-ordering exceptions
Added the Test case for Issue 26417

Commit migrated from https://github.com/dotnet/coreclr/commit/da6edcd43fb83d6843208a82f719e49984b7e59e

5 years agoFix duplicate key failure in SuperIlc when using multiple runners (dotnet/coreclr...
Tomáš Rylek [Sat, 5 Oct 2019 18:44:05 +0000 (11:44 -0700)]
Fix duplicate key failure in SuperIlc when using multiple runners (dotnet/coreclr#27038)

Apologies about the inconvenience, it somehow slipped through
the cracks.

Thanks

Tomas

Commit migrated from https://github.com/dotnet/coreclr/commit/d364ea3043c45eb91b0b0f1d6bedba3cca129a96

5 years agoPut single-def CSEs into SSA (dotnet/coreclr#26986)
Andy Ayers [Sat, 5 Oct 2019 14:22:09 +0000 (07:22 -0700)]
Put single-def CSEs into SSA (dotnet/coreclr#26986)

If we create a single-def temp during SSE, add it into SSA so uses of the temp
can benefit from assertion prop and similar.

Follow-up from some work proposed for dotnet/coreclr#21973.

Commit migrated from https://github.com/dotnet/coreclr/commit/863b40ec595bc1db58d7000255d72180a43deacb

5 years agoRename rsMaskVars (dotnet/coreclr#27012)
Sinan Kaya [Fri, 4 Oct 2019 20:10:50 +0000 (16:10 -0400)]
Rename rsMaskVars (dotnet/coreclr#27012)

* find src/jit -type f -exec sed -i -e 's/rsMaskVars->/GetMaskVars()->/g' {} \;

* Remove dangling comment

* Format patch

* Move to next line

* Update regset.h

* delete the comment after `public:`.

We have found them useless in the past and here it corrupts the formatting.

Commit migrated from https://github.com/dotnet/coreclr/commit/9d92b3b23309ebb5f65707e206a004d2115a6f91

5 years agoRename lvOtherReg (dotnet/coreclr#27031)
Sinan Kaya [Fri, 4 Oct 2019 19:23:39 +0000 (15:23 -0400)]
Rename lvOtherReg (dotnet/coreclr#27031)

* find src/jit -type f -exec sed -i -e 's/->lvOtherReg/->GetOtherReg()/g' {} \;

* Format branch

Commit migrated from https://github.com/dotnet/coreclr/commit/82ed48cfbfc478c71890d60f993037d1208fb3c4

5 years agoapply StartsWith optimizations to EndsWith (dotnet/coreclr#26962)
Adam Sitnik [Fri, 4 Oct 2019 16:26:06 +0000 (18:26 +0200)]
apply StartsWith optimizations to EndsWith (dotnet/coreclr#26962)

Commit migrated from https://github.com/dotnet/coreclr/commit/7d2554f9df71aa5f2e05d0fda30531e2ff981038

5 years agoHandle AV caused by invalid IBC data (dotnet/coreclr#27029)
Fadi Hanna [Fri, 4 Oct 2019 16:03:03 +0000 (09:03 -0700)]
Handle AV caused by invalid IBC data (dotnet/coreclr#27029)

Make FindOrCreateAssociatedMethodDesc throw a type load exception instead of an AV, which can't be handled by EX_TRY/EX_CATCH on Unix systems.

Commit migrated from https://github.com/dotnet/coreclr/commit/187071c4c5cd258f922d67a19fb03a6980491b38

5 years agoAdd partial default interface method support (dotnet/coreclr#27026)
Jan Vorlicek [Fri, 4 Oct 2019 14:09:08 +0000 (16:09 +0200)]
Add partial default interface method support (dotnet/coreclr#27026)

Commit migrated from https://github.com/dotnet/coreclr/commit/b57915b0e6830c52c700f690f77dfd77f4511c93

5 years agoMake SuperIlc resilient towards JIT no-op compilation phase (dotnet/coreclr#27020)
Tomáš Rylek [Fri, 4 Oct 2019 09:57:35 +0000 (02:57 -0700)]
Make SuperIlc resilient towards JIT no-op compilation phase (dotnet/coreclr#27020)

Commit migrated from https://github.com/dotnet/coreclr/commit/ab953e35d2bfd762ff90e04d9a97e402cabd961e

5 years agoAdd two unsupported helpers to fail a method instead of the entire build (dotnet...
Tomáš Rylek [Fri, 4 Oct 2019 09:13:29 +0000 (02:13 -0700)]
Add two unsupported helpers to fail a method instead of the entire build (dotnet/coreclr#27019)

Commit migrated from https://github.com/dotnet/coreclr/commit/c118d040460293ea779a4f5744e0574f577c4de2

5 years agoFix crossgen2 to fix several Loader tests (dotnet/coreclr#27022)
Jan Vorlicek [Fri, 4 Oct 2019 09:05:30 +0000 (11:05 +0200)]
Fix crossgen2 to fix several Loader tests (dotnet/coreclr#27022)

Six Loader\classloader\TypeGeneratorTests (Generated612, Generated613,
Generated614, Generated681, Generated682 and Generated683) were failing
with System.BadImageFormatException. While investigating the issue, I've
found that it was caused by a fix made few months ago. That fix fixed
several hundreds of tests from the Loader category, but broken these
six. The fix was made in getCallInfo and it doesn't correspond to what
we have in the old crossgen.
This change reverts that fix and fixes all the issues by using proper
token at some places and converting MemberRefs and MethodSpecs at few
places to MethodDefs, exacty the same way like the old crossgen does.

Commit migrated from https://github.com/dotnet/coreclr/commit/335dcbdb99fbb0217d8d9d52b6e0c582eaef6716

5 years agoAdd ExceptionDispatchInfo.SetCurrentStackTrace (dotnet/coreclr#27004)
Stephen Toub [Fri, 4 Oct 2019 01:59:40 +0000 (21:59 -0400)]
Add ExceptionDispatchInfo.SetCurrentStackTrace (dotnet/coreclr#27004)

* Add ExceptionDispatchInfo.SetCurrentStackTrace

* Address PR feedback

Commit migrated from https://github.com/dotnet/coreclr/commit/3bdc9f625480f497adfcd2bbfae039fdfd1e73f3

5 years agoRename genFullPtrRegMap (dotnet/coreclr#27006)
Sinan Kaya [Fri, 4 Oct 2019 00:34:50 +0000 (20:34 -0400)]
Rename genFullPtrRegMap (dotnet/coreclr#27006)

* __declspec(property(get = getFullPtrRegMap, put = setFullPtrRegMap)) bool genFullPtrRegMap;

__declspec(property(get = doFullPtrRegMap, put = setFullPtrRegMap)) bool genFullPtrRegMap;

Add forgotten getFullPtrRegMap()

* Rename to IsFullPtrRegMapRequired

* Forgotten rename

* Format patch

* Rename

* More rename

Commit migrated from https://github.com/dotnet/coreclr/commit/66f8bcf64ad1d93a249e58be3fc2501e6fe7d4c6

5 years agoFix stackalloc reuse bug in Environment.UserDomainName (dotnet/coreclr#26994)
Stephen Toub [Fri, 4 Oct 2019 00:27:03 +0000 (20:27 -0400)]
Fix stackalloc reuse bug in Environment.UserDomainName (dotnet/coreclr#26994)

* Fix stackalloc reuse bug in Environment.UserDomainName

According to the comment, this code is never expected to be used (so it should either be deleted or the comment fixed), but in the meantime, if it were to be executed, things could go badly due to potentially passing the same buffer into LookupAccountNameW for two different arguments.

* Fix existing ValueStringBuilder usage to dispose the builder

Commit migrated from https://github.com/dotnet/coreclr/commit/814c282db30906a1de496aca4b2654b688be09b5

5 years agoUse const internally in corelib for Environment.NewLine (dotnet/coreclr#27013)
Stephen Toub [Thu, 3 Oct 2019 20:40:04 +0000 (16:40 -0400)]
Use const internally in corelib for Environment.NewLine (dotnet/coreclr#27013)

Commit migrated from https://github.com/dotnet/coreclr/commit/073ad7ef1b6a7112eefc965aed362c7b5923682a

5 years agoMore corelib cleanup (dotnet/coreclr#26993)
Stephen Toub [Thu, 3 Oct 2019 19:28:18 +0000 (15:28 -0400)]
More corelib cleanup (dotnet/coreclr#26993)

* Make relevant types static (mostly Interop)

* Fix a few stray semicolons

* Remove unnecessary locals

Some can be removed entirely, some can be replaced by discards.

* Remove unnecessary usings

* Move Unix-specific helper method to TimeZoneInfo.Unix.cs

* Remove duplicated code

* Remove duplicative checks

* Remove [ThreadStatic] initialization

These are all the default values and wouldn't be necessary for any static, but inline initialization for [ThreadStatic]s is particularly unuseful (and in non-default cases problematic) because the fields are only set to these values on the initializing thread.

* Fix methods whose return value is never used

* Use string.IsNullOrEmpty

* Remove unnecessary field initialization

All ctors overwrite these values.

* Address PR feedback

Commit migrated from https://github.com/dotnet/coreclr/commit/c203e048817b0a3233773cc52d79bf665f1bd8a4

5 years agoFix test/src/JIT/Intrinsics/MathCeiling*.cs copypaste (dotnet/coreclr#26963)
Tobias Thornfeldt Nissen [Thu, 3 Oct 2019 16:21:09 +0000 (18:21 +0200)]
Fix test/src/JIT/Intrinsics/MathCeiling*.cs copypaste (dotnet/coreclr#26963)

Fixes the tests tests/src/JIT/Intrinsics/MathCeilingDouble.cs and tests/src/JIT/Intrinsics/MathCeilingDouble.cs, making sure they actually use the Ceiling method.

Fix dotnet/coreclr#26941

Commit migrated from https://github.com/dotnet/coreclr/commit/474747baec1e528dd0367838908d32b76eaf869d

5 years agoUpdate FCall comment (dotnet/coreclr#27005)
Next Turn [Thu, 3 Oct 2019 16:15:52 +0000 (00:15 +0800)]
Update FCall comment (dotnet/coreclr#27005)

* Update FCall comment

* Add regparm(3)

Co-Authored-By: Jan Vorlicek <janvorli@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/1fad862fcb4c4d064f58c98bdacd93434494692b

5 years agoFix read ordering bug between buckets pointer and counter (dotnet/coreclr#26997)
Fadi Hanna [Thu, 3 Oct 2019 14:18:03 +0000 (07:18 -0700)]
Fix read ordering bug between buckets pointer and counter (dotnet/coreclr#26997)

* Fix read ordering bug between buckets pointer and counter

Use VolaiteLoad to read counter

Commit migrated from https://github.com/dotnet/coreclr/commit/d9e2079f6dc1d4de0761a08e6ccb8d6fd3103a00

5 years agoTry to pregenerate canonical method bodies (dotnet/coreclr#26991)
Michal Strehovský [Thu, 3 Oct 2019 12:15:11 +0000 (14:15 +0200)]
Try to pregenerate canonical method bodies (dotnet/coreclr#26991)

Instantiate both generic types and generic methods over `__Canon` if possible.

Commit migrated from https://github.com/dotnet/coreclr/commit/09293f7407c7704dd779c673ffa99629aee3eb2c

5 years ago[crossgen2] Handle Floor and Ceiling (dotnet/coreclr#27003)
Andrew Au [Thu, 3 Oct 2019 12:14:42 +0000 (05:14 -0700)]
[crossgen2] Handle Floor and Ceiling (dotnet/coreclr#27003)

Commit migrated from https://github.com/dotnet/coreclr/commit/8e4d98a34aaa115d8f8004aadfaa37716e06e3ae

5 years agoReplace lvRegNum with GetRegNum() (dotnet/coreclr#26977)
Sinan Kaya [Thu, 3 Oct 2019 09:09:52 +0000 (05:09 -0400)]
Replace lvRegNum with GetRegNum() (dotnet/coreclr#26977)

* find src/jit -type f -exec sed -i -e 's/->lvRegNum/->GetRegNum()/g' {} \;

* Format patch

* Fix multiline comments

* More multiline comments

* Forgotten variable

Commit migrated from https://github.com/dotnet/coreclr/commit/ecb47cfa455ab289cb8e44c679860b1171e1c60d

5 years agoStop using LIST nodes for FIELD_LIST (dotnet/coreclr#26800)
mikedn [Thu, 3 Oct 2019 06:36:01 +0000 (09:36 +0300)]
Stop using LIST nodes for FIELD_LIST (dotnet/coreclr#26800)

* Stop using LIST nodes for FIELD_LIST

* Change GT_FIELD_LIST type to TYP_STRUCT

* Smaller GenTreeField::Use

* Delete out of date comment

* Cleanup LowerArg duplicated code

* Add AddField/InsertField

Commit migrated from https://github.com/dotnet/coreclr/commit/0a00ee7fdfd113c8c2d47c85ed210de78cab4bdd

5 years agoTypos (dotnet/coreclr#26968)
John Doe [Wed, 2 Oct 2019 23:20:00 +0000 (16:20 -0700)]
Typos (dotnet/coreclr#26968)

* conveninet -> convenient

* disassambly -> disassembly

* disassebly -> disassembly

* dissassembly -> disassembly

* obsereved -> observed

* releavant -> relevant

* teh -> the

* thes -> these

* Instructio -> Instruction

Commit migrated from https://github.com/dotnet/coreclr/commit/f1d2cd463508a3fe437043979673fec427c8b0ff

5 years agoImprove TimeSpan precision (dotnet/coreclr#26992)
Boris Parfenenkov [Wed, 2 Oct 2019 21:08:43 +0000 (02:08 +0500)]
Improve TimeSpan precision (dotnet/coreclr#26992)

Change multiplying by (x * (1.0 / BigValue)) on (x / BigValue).

Fix dotnet/coreclr#41380

Commit migrated from https://github.com/dotnet/coreclr/commit/190888373afe4f526de2bd7f366ffe53cced0325

5 years agoChange PerfEventSource to be able to use 'using'. (dotnet/coreclr#26981)
Anubhav Srivastava [Wed, 2 Oct 2019 21:04:51 +0000 (14:04 -0700)]
Change PerfEventSource to be able to use 'using'. (dotnet/coreclr#26981)

* Change and reorganize PerfEventSource to be able to use using.

Commit migrated from https://github.com/dotnet/coreclr/commit/4e680b3d82effacd72d8394eee9cf01b501b9207

5 years agoCreate IL Rewriting Basics.md (dotnet/coreclr#26918)
David Mason [Wed, 2 Oct 2019 19:51:08 +0000 (12:51 -0700)]
Create IL Rewriting Basics.md (dotnet/coreclr#26918)

Commit migrated from https://github.com/dotnet/coreclr/commit/fcd2d3278ba2eb4da78ddee979fb4c475bd14b37

5 years agoMore SuperIlc changes to enable its use in CoreCLR CI pipelines (dotnet/coreclr#26978)
Tomáš Rylek [Wed, 2 Oct 2019 19:32:43 +0000 (12:32 -0700)]
More SuperIlc changes to enable its use in CoreCLR CI pipelines (dotnet/coreclr#26978)

1) Support for explicit specification of Crossgen path needed for
cross-targeting scenarios;

2) Make Corelib exclusion Crossgen2-specific to avoid regressing
legacy Crossgen testing;

3) Make SuperIlc "AnyCPU" so that it can run on ARM.

Thanks

Tomas

Commit migrated from https://github.com/dotnet/coreclr/commit/d2bba5450c03d5f8e6d0d6428ae59a79321364ca

5 years agofind src/jit -type f -exec sed -i -e 's/->lvOtherArgReg/->GetOtherArg… (dotnet/corecl...
Sinan Kaya [Wed, 2 Oct 2019 19:06:20 +0000 (15:06 -0400)]
find src/jit -type f -exec sed -i -e 's/->lvOtherArgReg/->GetOtherArg… (dotnet/coreclr#26975)

* find src/jit -type f -exec sed -i -e 's/->lvOtherArgReg/->GetOtherArgReg()/g' {} \;

GetOtherArgReg

* Format patch

* Add forgotten variable

Commit migrated from https://github.com/dotnet/coreclr/commit/f7776685fb9ee16f7aa11b74a08abd35eb671277

5 years agoFix assert while compiling CoreLib with optimizations (dotnet/coreclr#26987)
Michal Strehovský [Wed, 2 Oct 2019 15:52:49 +0000 (17:52 +0200)]
Fix assert while compiling CoreLib with optimizations (dotnet/coreclr#26987)

The thing that lead to the assert was the fact that we reported a containing type for an RVA static field as not being preinitialized.

The `!field.HasRva` is the bugfix. `!field.IsThreadStatic` is just something that we also should do to match crossgen.

Commit migrated from https://github.com/dotnet/coreclr/commit/2d62d2b19d3213b3b0b3d273f192b7b298a1e86a

5 years agoChange to use the arm32 armarch queue (dotnet/coreclr#26979)
Jarret Shook [Wed, 2 Oct 2019 03:42:57 +0000 (20:42 -0700)]
Change to use the arm32 armarch queue (dotnet/coreclr#26979)

Commit migrated from https://github.com/dotnet/coreclr/commit/ce66024ba7d60fc7bb72d5b780e395bd9d11719e

5 years agoEnable GC long running tests on ARM64 (dotnet/coreclr#26969)
Vladimir Sadov [Tue, 1 Oct 2019 23:40:54 +0000 (16:40 -0700)]
Enable GC long running tests on ARM64 (dotnet/coreclr#26969)

Commit migrated from https://github.com/dotnet/coreclr/commit/435c480cbbfb27815805af60ddb42cfffd7c32f3

5 years agooom (dotnet/coreclr#26457)
Maoni Stephens [Tue, 1 Oct 2019 23:03:41 +0000 (16:03 -0700)]
oom (dotnet/coreclr#26457)

+ when hardlimit is specified we should only retry when we didn't fail due to commit failure - if commit failed it means we simply didn't have as much memory as what the hardlimit specified. we should throw OOM in this case.

+ added some diag info around OOM history to help with future diagnostics.

Commit migrated from https://github.com/dotnet/coreclr/commit/7dca41fd36721068e610c537654765e8e42275d7

5 years agoUpdate to minimum CMake version of 3.14 (dotnet/coreclr#26777)
Jeremy Koritzinsky [Tue, 1 Oct 2019 19:36:17 +0000 (12:36 -0700)]
Update to minimum CMake version of 3.14 (dotnet/coreclr#26777)

* Update docker images to images with CMake 3.14+ installed.

* Update cmake native tools verison in global.json.

* Update to patched images.

* Upgrade minimum CMake version to 3.14

* Update Linux cross images.

* Init native tools on Windows test builds as well as product builds.

* Update container images used in documentation.

Commit migrated from https://github.com/dotnet/coreclr/commit/455f0a77a8fa76b2a0073d8d367ed7210a3d80df

5 years agoreplace isHfaRegArg with IsHfaRegArg() (dotnet/coreclr#26958)
Sinan Kaya [Tue, 1 Oct 2019 18:44:03 +0000 (14:44 -0400)]
replace isHfaRegArg with IsHfaRegArg() (dotnet/coreclr#26958)

* find src/jit -type f -exec sed -i -e 's/.*declspec.*isHfaRegArg.*//g' {} \;

* Forgotten instances

* Format patch

Commit migrated from https://github.com/dotnet/coreclr/commit/bcb2c9f0b62c1b991874bcf14b4eb8433d6e6e53

5 years agoSuperIlc improvements to facilitate its use in Crossgen2 pipeline (dotnet/coreclr...
Tomáš Rylek [Tue, 1 Oct 2019 17:44:31 +0000 (10:44 -0700)]
SuperIlc improvements to facilitate its use in Crossgen2 pipeline (dotnet/coreclr#26961)

1) New NoCrossgen2 option needed for using SuperIlc to build
the [legacy] Crossgen framework during native test component build;

2) Several hardenings in ProcessRunner that finally let me pass
framework build on Linux without null-refing. This would merit
a closer look at some point but for now this seems to do the trick.

3) Add exclusions for two framework assemblies that fail compiling
with Crossgen2.

Thanks

Tomas

Commit migrated from https://github.com/dotnet/coreclr/commit/e23ef738eac5262f650d78c59715fa54ca680816

5 years agoFixing AdvSimd.Arm64 to have an internal constructor in the "supported" file. (dotnet...
Tanner Gooding [Tue, 1 Oct 2019 16:25:37 +0000 (09:25 -0700)]
Fixing AdvSimd.Arm64 to have an internal constructor in the "supported" file. (dotnet/coreclr#26953)

Commit migrated from https://github.com/dotnet/coreclr/commit/59ebac9ef8bf5079fdfa414fe26d9ae08e654287

5 years agoFix JustMyCode stepping into jumps (dotnet/coreclr#26781)
Jakob Botsch Nielsen [Tue, 1 Oct 2019 16:24:37 +0000 (18:24 +0200)]
Fix JustMyCode stepping into jumps (dotnet/coreclr#26781)

We should not patch the next instruction in this scenario.

Commit migrated from https://github.com/dotnet/coreclr/commit/22779e52abe71ddad9f741961b8e5c3d15a6ac0e

5 years agoFix the problem with the VS2019 fix on x86 (dotnet/coreclr#26957)
Jan Vorlicek [Tue, 1 Oct 2019 14:46:11 +0000 (16:46 +0200)]
Fix the problem with the VS2019 fix on x86 (dotnet/coreclr#26957)

The x86 was missing the same treatment of the explicit frames chain as
the other architectures. The chain needs to be repaired when a GCFrame
is destroyed and it was on a chain that is not current, but that is
still used by the exception handling stack walk.

Commit migrated from https://github.com/dotnet/coreclr/commit/4081d86f221e6694f0dfd13b99e0d5b1045d2e89

5 years agoPartial Revert "Remove global locks from Exception stack trace handling (dotnet...
Jan Kotas [Tue, 1 Oct 2019 13:46:22 +0000 (06:46 -0700)]
Partial Revert "Remove global locks from Exception stack trace handling  (dotnet/coreclr#26823) (dotnet/coreclr#26950)

* Partial Revert "Remove global locks from Exception stack trace handling  (dotnet/coreclr#26823)"

The scalability improvement claimed by the change is not there after closer examination.
Reverting to avoid visible non pay-for-play overhead added by the change.

* Delete managed exception stacktrace lock

History: The original version of the code had just the managed lock. It was discovered that the managed lock is not enough to guarantee integrity of the system and so the unmanaged lock was added. The managed lock was left around even though it does not guarantee much anymore.

Commit migrated from https://github.com/dotnet/coreclr/commit/08423d04085c0fd52eef254722e1347b6abfe37b

5 years agoParenthesize macros (dotnet/coreclr#23982)
bdebaere [Tue, 1 Oct 2019 13:45:04 +0000 (08:45 -0500)]
Parenthesize macros (dotnet/coreclr#23982)

* Add parenthesis to parameters.

* Revert changes to IS_UNWINDING.

Commit migrated from https://github.com/dotnet/coreclr/commit/ce29457817253551f15d25d596c4837432cc472e

5 years agoReplace otherRegNum with GetOtherRegNum
Sinan Kaya [Tue, 1 Oct 2019 07:04:31 +0000 (03:04 -0400)]
Replace otherRegNum with GetOtherRegNum

Commit migrated from https://github.com/dotnet/coreclr/commit/8f719f2a37fd1741a4f55cf3026a3ce4d89f3bc6

5 years ago[CPAOT] Generating code for hardware intrinsic (dotnet/coreclr#26772)
Andrew Au [Tue, 1 Oct 2019 05:49:32 +0000 (22:49 -0700)]
[CPAOT] Generating code for hardware intrinsic (dotnet/coreclr#26772)

Commit migrated from https://github.com/dotnet/coreclr/commit/6ec78980083123ec82300cbcbaadbb34fd34ea0a

5 years agoallow ASCII equality ordinal fast path for en-* cultures (dotnet/coreclr#26905)
Adam Sitnik [Tue, 1 Oct 2019 01:25:29 +0000 (03:25 +0200)]
allow ASCII equality ordinal fast path for en-* cultures (dotnet/coreclr#26905)

* allow ASCII equality ordinal fast path for en-* cultures

* dont use StartsWith in the initialization execution path

* Update src/System.Private.CoreLib/shared/System/Globalization/CompareInfo.Unix.cs

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/87e4971a68114987d81a21ba6df9035e30255c51

5 years agoDisable nop padding in R2R images and remove jumpstamps from the runtime (dotnet...
David Mason [Mon, 30 Sep 2019 22:05:15 +0000 (15:05 -0700)]
Disable nop padding in R2R images and remove jumpstamps from the runtime (dotnet/coreclr#26740)

Jumpstamps were used to version methods before we had the tiered compilation versioning mechanism. Jumpstamps had some negatives, that it was only supported on x86 and x64, that it required padding methods (bloated on disk IL code size), and that it required a runtime suspension to write the jumpstamps. By consolidating to one code versioning scheme we can delete a lot of code and support all architectures that tiered compilation does for rejit.

Commit migrated from https://github.com/dotnet/coreclr/commit/7fd79859530d6d6a05ae3b69adf2e0ca8a746bab

5 years agoDelete fgArgTabEntry::node (dotnet/coreclr#24294)
mikedn [Mon, 30 Sep 2019 21:52:07 +0000 (00:52 +0300)]
Delete fgArgTabEntry::node (dotnet/coreclr#24294)

* Store the `this` call arg in the GenTreeCall::Use

* Store gtCallThisArg in fgArgTabEntry

* Do not store the node in fgArgTabEntry

* Cleanup fgArgInfo "copy constructor"

* Extract call compare code to a separate function

* Extra asserts

* Add UseIterator::GetUse()

Commit migrated from https://github.com/dotnet/coreclr/commit/afb9ca8808367c976fdd58a2d88f9aa53c89b81d

5 years agoMake ResolveEventArgs.Name not nullable (dotnet/corefxdotnet/coreclr#41415)
Santiago Fernandez Madero [Fri, 27 Sep 2019 23:23:20 +0000 (16:23 -0700)]
Make ResolveEventArgs.Name not nullable (dotnet/corefxdotnet/coreclr#41415)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
Commit migrated from https://github.com/dotnet/coreclr/commit/5aef145649d95eb00dd0ca183d1e3d55ac9cd565

5 years agoStartsWith Linux perf improvements (dotnet/coreclr#26621)
Adam Sitnik [Mon, 30 Sep 2019 15:53:01 +0000 (17:53 +0200)]
StartsWith Linux perf improvements (dotnet/coreclr#26621)

* implement simple starts with using icu iterators

* remove IsFastSort() from StartsWith, implement simple lucky paths

* Revert "remove IsFastSort() from StartsWith, implement simple lucky paths"

This reverts commit dotnet/coreclr@ed443f16fc03bf3688e0b316b2c62c1962ba8241.

* handle combining characters properly

* code review fixes

* handle the ignorable character properly

Commit migrated from https://github.com/dotnet/coreclr/commit/8e4050a57a19df1cbc777c9b8a58b443602bbead

5 years agoFix URL to a sample perfcollect setup Dockerfile (dotnet/coreclr#26944)
Donatas Mačiūnas [Mon, 30 Sep 2019 14:04:35 +0000 (17:04 +0300)]
Fix URL to a sample perfcollect setup Dockerfile (dotnet/coreclr#26944)

Commit migrated from https://github.com/dotnet/coreclr/commit/57d13a30df0e05df45aefc3baa112d540899d35e

5 years agoFix grammar mistake (dotnet/coreclr#26943)
Donatas Mačiūnas [Mon, 30 Sep 2019 14:03:35 +0000 (17:03 +0300)]
Fix grammar mistake (dotnet/coreclr#26943)

Commit migrated from https://github.com/dotnet/coreclr/commit/e883f76bbaffe7fd3cba6a2b8b38529e7245fcc4

5 years agoFix crossgen2 handling of non-gc statics in generic classes (dotnet/coreclr#26802)
Jan Vorlicek [Mon, 30 Sep 2019 12:18:51 +0000 (14:18 +0200)]
Fix crossgen2 handling of non-gc statics in generic classes (dotnet/coreclr#26802)

* Fix crossgen2 handling of non-gc statics in generic classes

All such statics were being handled incorrectly in the
GetElementTypeInfo, leading to an incorrect offset being passed to the
JIT and a crash at runtime.

Commit migrated from https://github.com/dotnet/coreclr/commit/4d08f28b00067557924c94d2e80cc0f9500ce359

5 years agoRemove global locks from Exception stack trace handling (dotnet/coreclr#26823)
Ben Adams [Sat, 28 Sep 2019 17:32:00 +0000 (18:32 +0100)]
Remove global locks from Exception stack trace handling  (dotnet/coreclr#26823)

Commit migrated from https://github.com/dotnet/coreclr/commit/bef420a74e1a7ff81883b8bb3a36a9a452e0af61

5 years agoresolve several issues found by cppcheck (dotnet/coreclr#26885)
Ilya Shipitsin [Sat, 28 Sep 2019 14:21:00 +0000 (14:21 +0000)]
resolve several issues found by cppcheck (dotnet/coreclr#26885)

* src/utilcode/prettyprintsig.cpp: remove dead code
found by cppcheck

[src/utilcode/prettyprintsig.cpp:336] -> [src/utilcode/prettyprintsig.cpp:338]: (warning) Opposite inner 'if' condition leads to a dead code block.
[src/utilcode/prettyprintsig.cpp:750] -> [src/utilcode/prettyprintsig.cpp:752]: (warning) Opposite inner 'if' condition leads to a dead code block.

* src/dlls/dbgshim/dbgshim.cpp: resolve possible null pointer dereference
found by cppcheck

[src/dlls/dbgshim/dbgshim.cpp:1767] -> [src/dlls/dbgshim/dbgshim.cpp:1763]: (warning) Either the condition 'ppCordb==NULL' is redundant or there is possible null pointer dereference: ppCordb.

* src/utilcode/prettyprintsig.cpp: remove redundant check

* src/utilcode/prettyprintsig.cpp: remove another redundant condition

Commit migrated from https://github.com/dotnet/coreclr/commit/0f6fa8fb44f4c89e3c9a20bd2cf0364d2ce32aa0

5 years agoCheck for nullity of the context in FuncEval setup SP alignment checks (dotnet/corecl...
Juan Hoyos [Sat, 28 Sep 2019 08:21:55 +0000 (01:21 -0700)]
Check for nullity of the context in FuncEval setup SP alignment checks (dotnet/coreclr#26911)

Commit migrated from https://github.com/dotnet/coreclr/commit/1a0abb3f421e17df09569428e684464655b9eda5

5 years agoRemove duplicate enum SystemVClassificationType (dotnet/coreclr#26922)
Adeel Mujahid [Fri, 27 Sep 2019 23:31:28 +0000 (02:31 +0300)]
Remove duplicate enum SystemVClassificationType (dotnet/coreclr#26922)

Commit migrated from https://github.com/dotnet/coreclr/commit/830c607cf4975279dd1304f673374841022cef38

5 years agoDelete dead code (dotnet/coreclr#26926)
Jan Kotas [Fri, 27 Sep 2019 23:01:08 +0000 (16:01 -0700)]
Delete dead code (dotnet/coreclr#26926)

Commit migrated from https://github.com/dotnet/coreclr/commit/8f8528c5af2bbaf1fef5147398c08c8d14e417b2

5 years agoEnable GitHub_7147 (dotnet/coreclr#26884)
mikedn [Fri, 27 Sep 2019 20:30:50 +0000 (23:30 +0300)]
Enable GitHub_7147 (dotnet/coreclr#26884)

* Enable GitHub_7147

* Don't swallow exceptions

* Add another reordering test case

Commit migrated from https://github.com/dotnet/coreclr/commit/98125970356eed451fc29e0dbb790521d4ebe8e4

5 years agoReplace hfaType with GetHfaType() (dotnet/coreclr#26914)
Sinan Kaya [Fri, 27 Sep 2019 17:32:54 +0000 (13:32 -0400)]
Replace hfaType with GetHfaType() (dotnet/coreclr#26914)

* find src/jit -type f -exec sed -i -e 's/.*declspec.*hfaType.*//g' {} \;

More hfaTypes

* Compilation fix

Commit migrated from https://github.com/dotnet/coreclr/commit/321865f09c9f88f781d7b3ba09b3e8300e46ea3f

5 years agotypo and add language identifier (dotnet/coreclr#26923)
Youssef Victor [Fri, 27 Sep 2019 17:22:23 +0000 (19:22 +0200)]
typo and add language identifier (dotnet/coreclr#26923)

Commit migrated from https://github.com/dotnet/coreclr/commit/a1ec4f11787faa6080af11bc3436a102ce0709f6

5 years agoTypo: retreive => retrieve (dotnet/coreclr#26915)
Youssef Victor [Fri, 27 Sep 2019 13:27:30 +0000 (15:27 +0200)]
Typo: retreive => retrieve (dotnet/coreclr#26915)

Commit migrated from https://github.com/dotnet/coreclr/commit/3b15ddfb39defc5dbee58788ed896add9186edd6

5 years agoRefactoring the ARM Hardware Intrinsics based on the latest design decisions. (dotnet...
Tanner Gooding [Fri, 27 Sep 2019 12:06:24 +0000 (05:06 -0700)]
Refactoring the ARM Hardware Intrinsics based on the latest design decisions. (dotnet/coreclr#26895)

* Moving the Arm64 intrinsic files into the Arm folder.

* Refactoring the ARM Hardware Intrinsics based on the new design.

* Adding support for AdvSimd.Add

* Adding LoadVector64 and LoadVector128 APIs to Arm.AdvSimd

* Marking the LoadVector64 and LoadVector128 methods as unsafe

* Removing the ARM64 HWIntrinsic tests

* Renaming Arm.Base to Arm.ArmBase, as per the design

* Fixing Base.cs to ArmBase.cs in the shared projitems

* Fixing the doc comments for the AdvSimd.LoadVector methods

* Marking various IsSupported methods as new, now that they inherit from ArmBase

* Fixing a malformed doc comment that was missed

* Marking AdvSimd.Arm64 as [Intrinsic] and new

Commit migrated from https://github.com/dotnet/coreclr/commit/14b66ba36669ac002de415c4e8f19792e1c721e8

5 years agoRename GetIsVararg to IsVararg (dotnet/coreclr#26913)
Sinan Kaya [Fri, 27 Sep 2019 06:13:56 +0000 (02:13 -0400)]
Rename GetIsVararg to IsVararg (dotnet/coreclr#26913)

Commit migrated from https://github.com/dotnet/coreclr/commit/0d1c180164555513cbdb206dd4546007cbb3a42c

5 years agoFix Segfault in PerfInfo Image Logging (dotnet/coreclr#26900)
Brian Robbins [Thu, 26 Sep 2019 22:19:05 +0000 (15:19 -0700)]
Fix Segfault in PerfInfo Image Logging (dotnet/coreclr#26900)

Commit migrated from https://github.com/dotnet/coreclr/commit/db48b17fdfc3cca038e9695ec2d835eea4c9e204

5 years ago[Linux/x86] Use ebp from current context during unwinding (dotnet/coreclr#26789)
Konstantin Baladurin [Thu, 26 Sep 2019 17:06:57 +0000 (20:06 +0300)]
[Linux/x86] Use ebp from current context during unwinding (dotnet/coreclr#26789)

pCurrentContextPointers in REGDISPLAY can contain NULLs so we need to use
ebp value from pCurrentContext. This patch contains following changes:

- GetRegdisplayFP returns ebp from pCurrentContext
- GetRegdisplayFP is used instead of *GetEbpLocation()
- Set##reg##Location also updates register value in pCurrentContext

Commit migrated from https://github.com/dotnet/coreclr/commit/1e27a905a0081fe95dd7aaf5f9e99449b4811c1a

5 years agoCollectionsMarshal.AsSpan allow null refs (dotnet/coreclr#26903)
Ben Adams [Thu, 26 Sep 2019 04:27:10 +0000 (05:27 +0100)]
CollectionsMarshal.AsSpan allow null refs (dotnet/coreclr#26903)

Commit migrated from https://github.com/dotnet/coreclr/commit/d0ad04749905dab06251565f1dfdcfd26add77e8

5 years agoStop unloading the profiler on shutdown to prevent segfaults on background threads...
David Mason [Thu, 26 Sep 2019 04:03:29 +0000 (21:03 -0700)]
Stop unloading the profiler on shutdown to prevent segfaults on background threads (dotnet/coreclr#26762)

Commit migrated from https://github.com/dotnet/coreclr/commit/0df1edee35714c0e52b05581cc667455d7ebb0d4