platform/upstream/dotnet/runtime.git
5 years agoUpdate CoreFx to preview.19070.3 (dotnet/coreclr#22061)
dotnet-maestro-bot [Mon, 21 Jan 2019 06:09:52 +0000 (22:09 -0800)]
Update CoreFx to preview.19070.3 (dotnet/coreclr#22061)

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

5 years agoMove Task factory type to shared partition (dotnet/coreclr#22089)
Marek Safar [Sun, 20 Jan 2019 23:02:09 +0000 (00:02 +0100)]
Move Task factory type to shared partition (dotnet/coreclr#22089)

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

5 years agoUse List<T>.ToArray() in places (dotnet/coreclr#22101)
Ben Adams [Sun, 20 Jan 2019 22:42:10 +0000 (23:42 +0100)]
Use List<T>.ToArray() in places (dotnet/coreclr#22101)

* Use ReadOnlySpan.ToArray in places

* Use List.ToArray

* Don't take .Length in to local and use as loop condition

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

5 years agoCleanup array related FCalls (dotnet/coreclr#22097)
Jan Kotas [Sun, 20 Jan 2019 16:16:44 +0000 (08:16 -0800)]
Cleanup array related FCalls (dotnet/coreclr#22097)

* Cleanup Array FCalls

* Disable outdated CoreFX tests

https://github.com/dotnet/corefx/pull/34700

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

5 years agoFix CoreCLR build for changes in shared partition
Jan Kotas [Sat, 19 Jan 2019 19:48:28 +0000 (11:48 -0800)]
Fix CoreCLR build for changes in shared partition

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

5 years agoFix build for ProjectN/WinRTInterop Delete superfluous AsyncCausalityTracer arguments
Jan Kotas [Sat, 19 Jan 2019 08:24:57 +0000 (00:24 -0800)]
Fix build for ProjectN/WinRTInterop Delete superfluous AsyncCausalityTracer arguments

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

5 years agoFix build
Marek Safar [Fri, 18 Jan 2019 19:58:11 +0000 (20:58 +0100)]
Fix build

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

5 years agoUpdate Newtonsoft.Json (dotnet/coreclr#22060)
Ben Adams [Sat, 19 Jan 2019 20:03:03 +0000 (21:03 +0100)]
Update Newtonsoft.Json (dotnet/coreclr#22060)

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

5 years agoCleanup: Remove MethodDesc::GetLoaderAllocatorForCode (dotnet/coreclr#22067)
Jan Vorlicek [Sat, 19 Jan 2019 20:02:00 +0000 (21:02 +0100)]
Cleanup: Remove MethodDesc::GetLoaderAllocatorForCode (dotnet/coreclr#22067)

This function was recently changed to just return the
MethodDesc::GetLoaderAllocator. This is a cleanup that removes the
function completely and replaces all of its usages.

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

5 years agoRemoved unused 'Stack Walking' code (dotnet/coreclr#22039)
Matt Warren [Sat, 19 Jan 2019 19:59:40 +0000 (19:59 +0000)]
Removed unused 'Stack Walking' code (dotnet/coreclr#22039)

As fair as I can tell `ECWGCFCrawlCallBack(..)` is not wired-up anywhere (I've successfully compiled CoreCLR locally with this change under `x86` and `x64`)

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

5 years agoStrip symbols on unix in release builds (dotnet/coreclr#22083)
Sven Boemer [Sat, 19 Jan 2019 00:11:25 +0000 (16:11 -0800)]
Strip symbols on unix in release builds (dotnet/coreclr#22083)

Fixes https://github.com/dotnet/coreclr/issues/22082

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

5 years agoFix calling conventions on reverse PInvoke callbacks. (dotnet/coreclr#22044)
Jeremy Koritzinsky [Fri, 18 Jan 2019 23:39:54 +0000 (15:39 -0800)]
Fix calling conventions on reverse PInvoke callbacks. (dotnet/coreclr#22044)

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

5 years agoRun Azure DevOps builds against pull requests in coreclr/master (dotnet/coreclr#22051)
Egor Chesakov [Fri, 18 Jan 2019 22:05:29 +0000 (14:05 -0800)]
Run Azure DevOps builds against pull requests in coreclr/master (dotnet/coreclr#22051)

And disable Windows_NT and Ubuntu arm32 and arm64 default triggers in Jenkins CI

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

5 years agoSuperPMI Collect/Replay/AsmDiff tool (dotnet/coreclr#21252)
Jarret Shook [Fri, 18 Jan 2019 20:33:13 +0000 (12:33 -0800)]
SuperPMI Collect/Replay/AsmDiff tool (dotnet/coreclr#21252)

This change adds superpmi.py. The tool feature three modes, collection, replay, and asmdiffs.

Collection
The collection logic is very similar to the logic in our superpmi-collect test. Mostly it just allows running a script which will run managed code and it will produce a .mch which is clean to be run against. See superpmi.md for more information on specific usage and problems.

Replay
Replay will take an existing .mch file and run the current jit over the collection. If there is no .mch file on disk, the script will download the latest collection and run against that.

AsmDiffs
superpmi.md has the latest information on what platforms support asmdiffs. So far, I have an updated OSX and Windows collection that I have run against. If there are binary diffs, the tool will automatically generate base & diff folders with the asm under each one. Future work would include automatically running jit-analyze over those locations.

In addition, the tool has the option to automatically run and diff jit dumps, I have found this to be useful to looking into diffs created, as re-running superpmi with different jits to collect this same information is somewhat tedious.

Future work
This change is in no way the end of the work needed to leverage superpmi effectively. Instead, it is a good first step. Below are some suggestions for future superpmi work:

Automated collections
Add pmi collection support
Leverage some of the new corefx work to use superpmi shim for collections of corefx runs
To be added/changed
I will unset zapdisable being set by default, it creates too much data, although it is useful it should be opt in
Will include example usage in superpmi.md.

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

5 years agoMove AsyncCausality to shared partition (dotnet/coreclr#22062)
Marek Safar [Fri, 18 Jan 2019 18:19:17 +0000 (19:19 +0100)]
Move AsyncCausality to shared partition (dotnet/coreclr#22062)

* Move AsyncCausality to shared partition

* Set FeatureAsyncCausalityTracer property

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

5 years agoRe-enable signing of System.Private.CoreLib (dotnet/coreclr#22068)
Sven Boemer [Fri, 18 Jan 2019 17:50:33 +0000 (09:50 -0800)]
Re-enable signing of System.Private.CoreLib (dotnet/coreclr#22068)

* Re-enable signing for System.Private.CoreLib

Now that https://github.com/dotnet/arcade/issues/1582 is fixed.
Addresses https://github.com/dotnet/coreclr/issues/21946.

* Use uppercase build config

For consistency with other builds. Doesn't impact functionality, but
will result in the build logs showing the bin directory with the
uppercase build config during this step.

* Override arcade version of SignTool package

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

5 years agoAdd Per-assembly Load Native Library callbacks (dotnet/coreclr#21555)
Swaroop Sridhar [Fri, 18 Jan 2019 17:24:41 +0000 (09:24 -0800)]
Add Per-assembly Load Native Library callbacks (dotnet/coreclr#21555)

Add Per-assembly Load Native Library callbacks

This Change implements the Native Library resolution
Call-backs proposed in https://github.com/dotnet/corefx/issues/32015

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

5 years agoEnable detection of HW intrinsics (dotnet/corertdotnet/coreclr#6836)
Michal Strehovský [Fri, 18 Jan 2019 11:01:03 +0000 (12:01 +0100)]
Enable detection of HW intrinsics (dotnet/corertdotnet/coreclr#6836)

I took the liberty of marking the types containing the hardware intrinsics as [Intrinsic] to avoid doing a name check on everything in the system module. It feels like we should take advantage of this attribute in CoreCLR too.

This doesn't actually enable the support because RyuJIT unconditionally disables HW intrinsics for prejit (both CoreRT and CPAOT are considered prejit). We might want to do something about this on the RyuJIT side to address that (for CPAOT, to be able to pregenerate best code possible ahead of time, assuming a fixed ISA; and for CoreRT without JIT, where the concerns about AVX-SSE penalty don't apply). See conversation in dotnet/coreclrdotnet/coreclr#21603

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

5 years agoFix defines in TaskAwaiter (dotnet/corertdotnet/coreclr#6846)
Marek Safar [Fri, 18 Jan 2019 11:00:02 +0000 (12:00 +0100)]
Fix defines in TaskAwaiter (dotnet/corertdotnet/coreclr#6846)

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

5 years agoHandle complex constrained calls with default interface methods (dotnet/coreclr#21978)
Michal Strehovský [Fri, 18 Jan 2019 12:18:49 +0000 (13:18 +0100)]
Handle complex constrained calls with default interface methods (dotnet/coreclr#21978)

This adds handling for the interface dispatch corner case where:

* We have a constrained callsite to a method on a generic interface in shared code
* The callsite cannot be statically resolved because the result of dispatch depends on the generic context
* At runtime, the dispatch resolves to a default interface method

This would require us to have infrastructure to build "boxing thunks" - thunks that would box their first argument before dispatching to the default interface method implementation.

Since this is a corner case and the fix is actually quite involved, we're making the runtime just throw in this situation.

The test is written so that it should pass both if the runtime chooses to throw, or if the runtime makes the boxing thunk (we're not hardcoding the implementation limitation).

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

5 years agoUse correct resolution scope when checking default implementations (dotnet/coreclr...
Michal Strehovský [Fri, 18 Jan 2019 10:18:56 +0000 (11:18 +0100)]
Use correct resolution scope when checking default implementations (dotnet/coreclr#22036)

We need to use the module of the interface.

Fixes dotnet/coreclr#22021.

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

5 years agoAdd comments on headers that gets parsed by Mono linker for whoever touches this...
Sung Yoon Whang [Fri, 18 Jan 2019 08:23:16 +0000 (00:23 -0800)]
Add comments on headers that gets parsed by Mono linker for whoever touches this next (dotnet/coreclr#22054)

* Add comments on headers that gets parsed by Mono linker for whoever touches this next

* add more comments to the targets file

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

5 years agoMove Environment to shared CoreLib (dotnet/corefxdotnet/coreclr#34654)
Stephen Toub [Fri, 18 Jan 2019 01:07:12 +0000 (20:07 -0500)]
Move Environment to shared CoreLib (dotnet/corefxdotnet/coreclr#34654)

Rather than having Environment partially live in corefx and call into an EnvironmentAugments type in CoreLib that in turn calls into an Environment type in CoreLib, we're just moving Environment to live in CoreLib.

To start that, this PR moves Environment and its dependencies from their current locations into the shared CoreLib.  Those changes will mirror over to coreclr.  After that, I'll fix it up to work in CoreLib. And once those changes are built and available back to corefx, I'll update System.Runtime.Extensions to just use the functionality from CoreLib and delete remaining unnecessary code from corefx.

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

5 years agoUnify xplatform.h and platformdefines.h (dotnet/coreclr#21389)
Jeremy Koritzinsky [Fri, 18 Jan 2019 00:58:34 +0000 (16:58 -0800)]
Unify xplatform.h and platformdefines.h (dotnet/coreclr#21389)

* Move most of xplatform.h into platformdefines.h and clean up the interop CMake files.

* Fix build-break off Windows.

* Fix typo.

* Fix another break off-Windows.

* Fix signed/unsigned mismatch

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

5 years agoUnblock Azure DevOps-as-CI (dotnet/coreclr#22042)
Egor Chesakov [Fri, 18 Jan 2019 00:21:41 +0000 (16:21 -0800)]
Unblock Azure DevOps-as-CI (dotnet/coreclr#22042)

* Disable JIT.Methodical/doublearray/dblarray3_cs_do

* Disable readytorun.r2rdump/R2RDumpTest

* Disable RedHat.6.Amd64.Open queue

* Rename Creator coreclr/pulls -> coreclr-pulls

* IsExternal is deprecated as of https://github.com/dotnet/arcade build 20190115.6

* Increase timeout for all test jobs

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

5 years agoMerge pull request dotnet/coreclr#22002 from dotnet-maestro-bot/master-UpdateDependencies
William Godbe [Fri, 18 Jan 2019 00:20:08 +0000 (16:20 -0800)]
Merge pull request dotnet/coreclr#22002 from dotnet-maestro-bot/master-UpdateDependencies

Update BuildTools, CoreClr, CoreFx, PgoData to preview1-03617-02, preview-27316-02, preview.19066.1, master-20190116.5, respectively (master)

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

5 years agoRemove ToString from RuntimeAssembly.GetManifestResourceStream (dotnet/coreclr#22012)
Stephen Toub [Thu, 17 Jan 2019 23:10:48 +0000 (18:10 -0500)]
Remove ToString from RuntimeAssembly.GetManifestResourceStream (dotnet/coreclr#22012)

* Remove ToString from RuntimeAssembly.GetManifestResourceStream

A small allocation we can avoid with the span-based string.Concat.

* Address PR feedback

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

5 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview1-03617-02, preview-27316-02...
dotnet-maestro-bot [Thu, 17 Jan 2019 22:27:15 +0000 (14:27 -0800)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview1-03617-02, preview-27316-02, preview.19066.1, master-20190116.5, respectively

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

5 years agoSplit ContractsBCL into separate classes and move them to shared CoreLib (dotnet...
Filip Navara [Thu, 17 Jan 2019 21:48:17 +0000 (22:48 +0100)]
Split ContractsBCL into separate classes and move them to shared CoreLib (dotnet/coreclr#22006)

* Split up ContractsBCL into separate classes.

* Move remaining Contract, ContractHelper code to shared partition.

* Split ContractHelper to allow custom debugging experience in CoreRT.

* Simplify ContractHelper.InternalContractFailed.

* Use resource loading code from CoreRT.

* Remove unused parameter.

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

5 years agoClean up a few minor Span-related uses (dotnet/coreclr#22038)
Stephen Toub [Thu, 17 Jan 2019 21:40:56 +0000 (16:40 -0500)]
Clean up a few minor Span-related uses (dotnet/coreclr#22038)

Some unnecessary Span to ReadOnlySpan casts.
Some places where new Span(...).Slice(...) can be replaced with AsSpan(...).
Etc.

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

5 years agoRemove a few stale resource strings for ConcurrentStack (dotnet/coreclr#22037)
Stephen Toub [Thu, 17 Jan 2019 21:40:34 +0000 (16:40 -0500)]
Remove a few stale resource strings for ConcurrentStack (dotnet/coreclr#22037)

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

5 years agoAvoid allocations in Utf8Formatter.TryFormat(float/double, ...) (dotnet/coreclr#22011)
Stephen Toub [Thu, 17 Jan 2019 21:00:12 +0000 (16:00 -0500)]
Avoid allocations in Utf8Formatter.TryFormat(float/double, ...) (dotnet/coreclr#22011)

* Avoid allocations in Utf8Formatter.TryFormat(float/double, ...)

Currently every call to Utf8Formatter.TryFormat for a float or a double allocates two strings, one for the format string and one for the resulting number.   This avoids those in the common case where we can use float/double.TryFormat and format directly into a stack buffer.  Also removes some unsafe code; the performance of StandardFormat.ToString isn't currently worth the extra nanoseconds gained by using unsafe code.

* Delete assert

There's a test that uses unsafe code to cause this to fail and validate that no exception is thrown.

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

5 years agoMerge pull request dotnet/coreclr#22022 from fiigii/reenabletest
Carol Eidt [Thu, 17 Jan 2019 19:10:52 +0000 (11:10 -0800)]
Merge pull request dotnet/coreclr#22022 from fiigii/reenabletest

Re-enable Avx.PermuteVar tests

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

5 years agoFix AsyncMethodBuilder build on Mono (dotnet/coreclr#22034)
Marek Safar [Thu, 17 Jan 2019 16:42:44 +0000 (17:42 +0100)]
Fix AsyncMethodBuilder build on Mono (dotnet/coreclr#22034)

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

5 years agoFix CoreCLR build of AsyncMethodBuilder.
Filip Navara [Thu, 17 Jan 2019 06:38:00 +0000 (07:38 +0100)]
Fix CoreCLR build of AsyncMethodBuilder.

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

5 years agoAdd new members to AsyncCausalitySupport.
Filip Navara [Thu, 17 Jan 2019 04:42:23 +0000 (05:42 +0100)]
Add new members to AsyncCausalitySupport.
Remove file moved to shared partition.
Fix builds without FeatureCominterop.

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

5 years agoMove AsyncMethodBuilder to shared. (dotnet/corertdotnet/coreclr#6832)
Filip Navara [Wed, 16 Jan 2019 18:26:14 +0000 (19:26 +0100)]
Move AsyncMethodBuilder to shared. (dotnet/corertdotnet/coreclr#6832)

* Move AsyncMethodBuilder to shared.

* Bring back PROJECTN.

* #if-out TrackAsyncMethodCompletion for CoreRT.

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

5 years agoRe-enable Avx.PermuteVar tests
Fei Peng [Wed, 16 Jan 2019 23:13:06 +0000 (15:13 -0800)]
Re-enable Avx.PermuteVar tests

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

5 years agoMerge pull request dotnet/coreclr#21997 from BruceForstall/FixFpRelativeInstructions
Bruce Forstall [Wed, 16 Jan 2019 20:00:30 +0000 (12:00 -0800)]
Merge pull request dotnet/coreclr#21997 from BruceForstall/FixFpRelativeInstructions

Fix two cases of FP-relative immediate offsets possibly not encodable

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

5 years agoReduce steps for string.Contains(string value) (dotnet/coreclr#22008)
Ben Adams [Wed, 16 Jan 2019 18:31:56 +0000 (19:31 +0100)]
Reduce steps for string.Contains(string value) (dotnet/coreclr#22008)

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

5 years agoUpdate linux/OSX build instructions (dotnet/coreclr#21679)
Jarret Shook [Wed, 16 Jan 2019 17:57:19 +0000 (09:57 -0800)]
Update linux/OSX build instructions (dotnet/coreclr#21679)

* Update linux/OSX build instructions

* Update based on feedback

* Address PR feedback

* Update to address feedback

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

5 years ago Fix imm-operand encoding for SSE/AVX instructions (dotnet/coreclr#21999)
Fei Peng [Wed, 16 Jan 2019 17:48:43 +0000 (09:48 -0800)]
 Fix imm-operand encoding for SSE/AVX instructions (dotnet/coreclr#21999)

* Move more SSE2 tests to the template

* Improve Insert test template to involve more codegen situations

* Fix imm-operand encoding for SSE/AVX instructions

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

5 years agoFix generate_layout_only (dotnet/coreclr#21996)
Jarret Shook [Wed, 16 Jan 2019 17:35:16 +0000 (09:35 -0800)]
Fix generate_layout_only (dotnet/coreclr#21996)

* Fix generate_layout_only

* Correctly add all opons

* Clean run for cross built device

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

5 years agoEnable BenchmarksGame when BuildTestsAgainstPackages (see dotnet/coreclr#21554) in...
Egor Chesakov [Tue, 15 Jan 2019 00:52:39 +0000 (16:52 -0800)]
Enable BenchmarksGame when BuildTestsAgainstPackages (see dotnet/coreclr#21554) in tests/issues.targets

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

5 years agoMake JIT\superpmi\superpmicollect compatible with Helix
Egor Chesakov [Fri, 11 Jan 2019 22:45:25 +0000 (14:45 -0800)]
Make JIT\superpmi\superpmicollect compatible with Helix

Related issue: https://github.com/dotnet/coreclr/issues/21698

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

5 years agoString -> string
Jan Kotas [Tue, 15 Jan 2019 23:53:23 +0000 (15:53 -0800)]
String -> string

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

5 years agoDelete files moved to shared partition
Jan Kotas [Tue, 15 Jan 2019 23:49:12 +0000 (15:49 -0800)]
Delete files moved to shared partition

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

5 years agoMove more COM exceptions to shared partition (dotnet/corertdotnet/coreclr#6829)
Marek Safar [Tue, 15 Jan 2019 23:32:58 +0000 (00:32 +0100)]
Move more COM exceptions to shared partition (dotnet/corertdotnet/coreclr#6829)

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

5 years agoWIP: Re-enable ObjectStackAllocationTests for arm32
Eugene Rozenfeld [Fri, 14 Dec 2018 00:57:12 +0000 (16:57 -0800)]
WIP: Re-enable ObjectStackAllocationTests for arm32

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

5 years agoUse MSBuild to generate __TestEnv files (dotnet/coreclr#21966)
Egor Chesakov [Wed, 16 Jan 2019 00:25:10 +0000 (16:25 -0800)]
Use MSBuild to generate __TestEnv files (dotnet/coreclr#21966)

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

5 years agoFix two cases of FP-relative immediate offsets not being checked for encodability
Bruce Forstall [Tue, 15 Jan 2019 22:21:48 +0000 (14:21 -0800)]
Fix two cases of FP-relative immediate offsets not being checked for encodability

For ARM32/ARM64, the immediate offsets in addressing modes have
limited range that varies by instruction. A couple cases were not
checking for that range, leading to generating potentially
un-encodable instruction.

In particular, the test case shows a case where a very large frame in a function
with a stored generic context would fail on ARM64.

There are no code diffs from this change for ARM64, except we sometimes get
better assembly comments where the local variable referenced is annotated on
the store instruction. For ARM32, the "secret stub param" is now stored using
SP-relative addressing, not FP-relative, if possible (which we generally prefer
in main function bodies).

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

5 years agoOn SIGTERM default to a non-zero exit code (dotnet/coreclr#21300)
Tom Deseyn [Tue, 15 Jan 2019 20:43:08 +0000 (21:43 +0100)]
On SIGTERM default to a non-zero exit code (dotnet/coreclr#21300)

* On SIGTERM default to a non-zero exit code

* Fix Windows builds

* Improve SIG_DFL/SIG_IGN handling

* Remove PAL_GetTerminationExitCode

* Use sa_handler/sa_sigaction based on SA_SIGINFO; remove HAVE_SIGINFO_T.

* configure.cmake: remove siginfo_t check

* Move restore_signal_and_resend so OSX can use it; add function documentation

* Fix OSX build: include pal/process.h for gPID

* Check SIG_IGN and SIG_DFL against sa_handler

* Don't use sa_handler when SA_SIGINFO is set

* Fix equality check

* Swap order of checking SA_SIGINFO and SIG_IGN/SIG_DFL

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

5 years agoMerge pull request dotnet/coreclr#21963 from BrianBohe/master
Juan Hoyos [Tue, 15 Jan 2019 20:01:45 +0000 (12:01 -0800)]
Merge pull request dotnet/coreclr#21963 from BrianBohe/master

Remove unreachable code

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

5 years agoAdd freebsd official build (dotnet/coreclr#21988)
Sven Boemer [Tue, 15 Jan 2019 19:21:05 +0000 (11:21 -0800)]
Add freebsd official build (dotnet/coreclr#21988)

* Enable freebsd build

Two different environment variables are used to tell either buildtools or arcade to use an existing SDK instead of trying to restore one. The package build project is pure msbuild (it doesn't do platform detection in any wrapper .sh files), and we don't have FreeBSD detected in msbuild, so pass the __BuildOS in from the caller.

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

5 years agoallocate the right number of slots for the handle table when number of processors...
David Mason [Tue, 15 Jan 2019 18:23:48 +0000 (10:23 -0800)]
allocate the right number of slots for the handle table when number of processors > 64 (dotnet/coreclr#21992)

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

5 years agoUpdate CoreClr, CoreFx, PgoData to preview-27312-01, preview.19063.1, master-20190111...
dotnet-maestro-bot [Tue, 15 Jan 2019 16:12:09 +0000 (08:12 -0800)]
Update CoreClr, CoreFx, PgoData to preview-27312-01, preview.19063.1, master-20190111.1, respectively (master) (dotnet/coreclr#21954)

* Update CoreClr, CoreFx, PgoData to preview-27312-01, preview.19063.1, master-20190111.1, respectively

* Disable invalid test

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

5 years agofix the help message for runtest.sh so the gcstress instructions aren't split across...
David Mason [Tue, 15 Jan 2019 04:48:49 +0000 (20:48 -0800)]
fix the help message for runtest.sh so the gcstress instructions aren't split across multiple lines (dotnet/coreclr#21989)

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

5 years agoLarge version bubble Support (dotnet/coreclr#21727)
Andon Andonov [Tue, 15 Jan 2019 03:59:12 +0000 (19:59 -0800)]
Large version bubble Support (dotnet/coreclr#21727)

* Preliminary Changes

* Module Index Resolution

* Change infoModule encoding

* Change referencing module in R2R

* Pre-condition Check

* Virtual Method Module Resolution

* Remove Workarounds and add conditional import loading

* Add signature kind module override

* Add ELEMENT_TYPE_MODULE_ZAPSIG

* Add switch to enable large version bubble

* Cleanup

* Change Native header check

* Add large version bubble test

* Add Large Version Bubble Checks

* Cleanup

* Revert unnecessary check

* Change EncodeMethod Version Bubble Condition

* Add Large Version Bubble asserts

* Cleanup

* Add default argument to runtests.py

* Change test PreCommands

* Revert whitespace changes

* Change breaking conditional check

* Streamline Version Bubble test

* Address PR Feedback

* Address PR Feedback dotnet/coreclr#2

* Remove dead code

* Add crossgen-time ifdef

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

5 years agoFinding Standalone GC and CoreDisTools in non-standard host testing (dotnet/coreclr...
Aaron Robinson [Tue, 15 Jan 2019 02:41:00 +0000 (18:41 -0800)]
Finding Standalone GC and CoreDisTools in non-standard host testing (dotnet/coreclr#21983)

* Use GetInternalSystemDirectory() as the directory for standalone GC

* Use GetInternalSystemDirectory() as the directory for coredistools

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

5 years agoImprovements for object stack allocation.
Eugene Rozenfeld [Sat, 5 Jan 2019 05:27:20 +0000 (21:27 -0800)]
Improvements for object stack allocation.

This change enables object stack allocation for more cases.

1. Objects with gc fields can now be stack-allocated.
2. Object stack allocation is enabled for x86.

ObjectAllocator updates the types of trees containing references
to possibly-stack-allocated objects to TYP_BYREF or TYP_I_IMPL as appropriate.
That allows us to remove the hacks in gcencode.cpp and refine reporting of pointers:
the pointer is not reported when we can prove that it always points to a stack-allocated object or is null (typed as TYP_I_IMPL);
the pointer is reported as an interior pointer when it may point to either a stack-allocated object or a heap-allocated object (typed as TYP_BYREF);
the pointer is reported as a normal pointer when it points to a heap-allocated object (typed as TYP_REF).

ObjectAllocator also adds flags to indirections:
GTF_IND_TGTANYWHERE when the indirection may be the heap or the stack
(that results in checked write barriers used for writes)
or the new GTF_IND_TGT_NOT_HEAP when the indirection is null or stack memory
(that results in no barrier used for writes).

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

5 years agoAdd test calling a NativeCallable via an unmanaged calli. (dotnet/coreclr#21984)
Jeremy Koritzinsky [Tue, 15 Jan 2019 00:33:37 +0000 (16:33 -0800)]
Add test calling a NativeCallable via an unmanaged calli. (dotnet/coreclr#21984)

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

5 years agoRemoving noisy R2R compilation outputs, and putting them under the /verbose switch...
Fadi Hanna [Tue, 15 Jan 2019 00:21:58 +0000 (16:21 -0800)]
Removing noisy R2R compilation outputs, and putting them under the /verbose switch (dotnet/coreclr#21987)

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

5 years agoCustom Marshalers in custom-ALC-loaded assemblies results in types loaded from crossi...
Jeremy Koritzinsky [Mon, 14 Jan 2019 23:49:45 +0000 (15:49 -0800)]
Custom Marshalers in custom-ALC-loaded assemblies results in types loaded from crossing ALCs (dotnet/coreclr#21606)

* Create repro for dotnet/coreclrdotnet/coreclr#19654

* Update ICustomMarshaler.csproj

* Update ICustomMarshaler.csproj

* Clean up repro per feedback.

* Add test case for different assemblies with the same CustomMarshaler name.

* Move EEMarshalingData cache from AppDomain to LoaderAllocator. This fixes the custom-marshaler conflict when using unloadable assembly contexts.

* Internalize the LoaderHeap* parameter.

* Add the pointer to the requesting assembly to the hashtable key.

* Fix linux-musl build break.

* Move Crst out of FEATURE_COMINTEROP block.

* Make sure to copy over the assembly pointer to the key that's actually stored in the hash table.

* Add comment for m_invokingAssembly.

* Move all usages of EEMarshallingData to hang off the correct loader allocator instead of always the global one.

* Change to m_InteropDataCrst since this EEMarshallingData can be used in preemptive GC mode.

* Always init m_InteropDataCrst (since it's used by EEMarshallingData as well as COM).

* PR Feedback.

* Remove extraneous inlines.

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

5 years agoFix TimeSpan parsing (dotnet/coreclr#21968)
Tarek Mahmoud Sayed [Mon, 14 Jan 2019 22:49:00 +0000 (14:49 -0800)]
Fix TimeSpan parsing (dotnet/coreclr#21968)

* Fix TimeSpan parsing

* Temporary disabling the failed CI tests

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

5 years agoFix TaskCompletionSource to avoid capturing ExecutionContext (dotnet/coreclr#21981)
Stephen Toub [Mon, 14 Jan 2019 22:16:59 +0000 (17:16 -0500)]
Fix TaskCompletionSource to avoid capturing ExecutionContext (dotnet/coreclr#21981)

When a TaskCompletionSource is constructed without any arguments, it simply creates a Task using a simple Task constructor that sets a few fields and is done.  When it's constructed with options, though, those options are validated, and then it calls into a shared routine that configures based on those options.  A previous set of changes resulted in erroneously doing the ExecutionContext.Capture for the task inside of that shared routine, rather than only doing it for tasks that actually have a delegate to be executed.  The net effect of this is that, while TaskCompletionSources created with the parameterless constructor correctly did not capture ExecutionContext, TaskCompletionSources created with options erroneously did; this doesn't have a functional impact, because that ExecutionContext isn't used for anything, but it can have a performance impact, in particular for memory, if the resulting Task is cached, and if the captured ExecutionContext holds onto some expensive object from an AsyncLocal, such that the cached Task then does so, too.

The fix is simply to move the capture from the shared routine that's invoked in two places to instead be done only in the one caller that's for tasks with delegates.

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

5 years agoRemove tizen jobs as valid pr jobs (dotnet/coreclr#21982)
Jarret Shook [Mon, 14 Jan 2019 18:11:37 +0000 (10:11 -0800)]
Remove tizen jobs as valid pr jobs (dotnet/coreclr#21982)

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

5 years agoMaking sure the nativeCodeVersion flowing change works with Rejit and EnC (dotnet...
Andrew Au [Mon, 14 Jan 2019 17:43:51 +0000 (09:43 -0800)]
Making sure the nativeCodeVersion flowing change works with Rejit and EnC (dotnet/coreclr#21961)

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

5 years agoAdd NativeLibrary Resolve Event (dotnet/coreclr#21929)
Swaroop Sridhar [Sun, 13 Jan 2019 06:25:25 +0000 (22:25 -0800)]
Add NativeLibrary Resolve Event (dotnet/coreclr#21929)

This change adds the Native library resolving event, to be raised as the last attempt to resolve a native DLL in an AssemblyLoadContext.

With this change, the DllImport resolution sequence is as follows (stopping at any step with successful resolution):

* If the invoking-assembly is not in the default load context, call AssemblyLoadContext.LoadUnmanagedDll()
* Run the default load logic, try loading from:
    * AppDomain cache
    * NATIVE_DLL_SEARCH_DIRECTORIES
    * Invoking-assembly directory, System32, etc. based on DllImportSearchPaths
* Raise the ResolvingUnmanagedDll event

API Review: https://github.com/dotnet/corefx/issues/32850

The ResolveEventTests triggered a pre-existing bug in the exception handling code (dotnet/coreclr#21964).
Disabling the test on ARM64 Windows until the issue is fixed.

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

5 years agoAdd System.Reflection.Emit.DynamicILInfo (dotnet/coreclr#21945)
Maryam Ariyan [Sun, 13 Jan 2019 01:44:06 +0000 (17:44 -0800)]
Add System.Reflection.Emit.DynamicILInfo (dotnet/coreclr#21945)

* Making DynamicILInfo and its API impls public

* Remove DynamicScope input from ctor args

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

5 years agoFix x64 CFI generation (dotnet/coreclr#21955)
Andrey Kvochko [Sat, 12 Jan 2019 06:22:45 +0000 (09:22 +0300)]
Fix x64 CFI generation (dotnet/coreclr#21955)

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

5 years agoPatch vtable slots and similar when tiering is enabled (dotnet/coreclr#21292)
Koundinya Veluri [Sat, 12 Jan 2019 02:02:10 +0000 (18:02 -0800)]
Patch vtable slots and similar when tiering is enabled (dotnet/coreclr#21292)

Patch vtable slots and similar when tiering is enabled

For a method eligible for code versioning and vtable slot backpatch:
  - It does not have a precode (`HasPrecode()` returns false)
  - It does not have a stable entry point (`HasStableEntryPoint()` returns false)
  - A call to the method may be:
    - An indirect call through the `MethodTable`'s backpatchable vtable slot
    - A direct call to a backpatchable `FuncPtrStub`, perhaps through a `JumpStub`
    - For interface methods, an indirect call through the virtual stub dispatch (VSD) indirection cell to a backpatchable `DispatchStub` or a `ResolveStub` that refers to a backpatchable `ResolveCacheEntry`
  - The purpose is that typical calls to the method have no additional overhead when code versioning is enabled

Recording and backpatching slots:
  - In order for all vtable slots for the method to be backpatchable:
    - A vtable slot initially points to the `MethodDesc`'s temporary entry point, even when the method is inherited by a derived type (the slot's value is not copied from the parent)
    - The temporary entry point always points to the prestub and is never backpatched, in order to be able to discover new vtable slots through which the method may be called
    - The prestub, as part of `DoBackpatch()`, records any slots that are transitioned from the temporary entry point to the method's at-the-time current, non-prestub entry point
    - Any further changes to the method's entry point cause recorded slots to be backpatched in `BackpatchEntryPointSlots()`
  - In order for the `FuncPtrStub` to be backpatchable:
    - After the `FuncPtrStub` is created and exposed, it is patched to point to the method's at-the-time current entry point if necessary
    - Any further changes to the method's entry point cause the `FuncPtrStub` to be backpatched in `BackpatchEntryPointSlots()`
  - In order for VSD entities to be backpatchable:
    - A `DispatchStub`'s entry point target is aligned and recorded for backpatching in `BackpatchEntryPointSlots()`
      - The `DispatchStub` was modified on x86 and x64 such that the entry point target is aligned to a pointer to make it backpatchable
    - A `ResolveCacheEntry`'s entry point target is recorded for backpatching in `BackpatchEntryPointSlots()`

Slot lifetime and management of recorded slots:
  - A slot is recorded in the `LoaderAllocator` in which the slot is allocated, see `RecordAndBackpatchEntryPointSlot()`
  - An inherited slot that has a shorter lifetime than the `MethodDesc`, when recorded, needs to be accessible by the `MethodDesc` for backpatching, so the dependent `LoaderAllocator` with the slot to backpatch is also recorded in the `MethodDesc`'s `LoaderAllocator`, see `MethodDescBackpatchInfo::AddDependentLoaderAllocator_Locked()`
  - At the end of a `LoaderAllocator`'s lifetime, the `LoaderAllocator` is unregistered from dependency `LoaderAllocators`, see `MethodDescBackpatchInfoTracker::ClearDependencyMethodDescEntryPointSlots()`
  - When a `MethodDesc`'s entry point changes, backpatching also includes iterating over recorded dependent `LoaderAllocators` to backpatch the relevant slots recorded there, see `BackpatchEntryPointSlots()`

Synchronization between entry point changes and backpatching slots
  - A global lock is used to ensure that all recorded backpatchable slots corresponding to a `MethodDesc` point to the same entry point, see `DoBackpatch()` and `BackpatchEntryPointSlots()` for examples

Due to startup time perf issues:
  - `IsEligibleForTieredCompilation()` is called more frequently with this change and in hotter paths. I chose to use a `MethodDesc` flag to store that information for fast retreival. The flag is initialized by `DetermineAndSetIsEligibleForTieredCompilation()`.
  - Initially, I experimented with allowing a method versionable with vtable slot backpatch to have a precode, and allocated a new precode that would also be the stable entry point when a direct call is necessary. That also allows recording a new slot to be optional - in the event of an OOM, the slot may just point to the stable entry point. There are a large number of such methods and the allocations were slowing down startup perf. So, I had to eliminate precodes for methods versionable with vtable slot backpatch and that in turn means that recording slots is necessary for versionability.

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

5 years agoMerge pull request dotnet/coreclr#21795 from fiigii/fixGeneric
Carol Eidt [Sat, 12 Jan 2019 01:00:29 +0000 (17:00 -0800)]
Merge pull request dotnet/coreclr#21795 from fiigii/fixGeneric

Remove unnecessary ThrowIfUnsupportedType calls and definitions

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

5 years agoGenerate non-null assertion for byrefs if we can't find corresponding refs.
Eugene Rozenfeld [Thu, 10 Jan 2019 22:53:24 +0000 (14:53 -0800)]
Generate non-null assertion for byrefs if we can't find corresponding refs.

When we have a non-null fact about a byref, we try to find the corresponding
ref and generate an assertion about the ref. Then it can be used on byrefs if the offset is not too big.
We use both trees and value numbers to find the ref. When the ref wasn't found we bailed on generating
the assertion.

I found that we get a number of good diffs if we generate assertions for byrefs when refs can't be found
so this change enables that.

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

5 years agoFix access token used for internal helix submissions (dotnet/coreclr#21957)
Sven Boemer [Fri, 11 Jan 2019 23:00:32 +0000 (15:00 -0800)]
Fix access token used for internal helix submissions (dotnet/coreclr#21957)

Also specify the variable group using yaml syntax.

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

5 years agoShare arg validation runtest and run-pmi-diff (dotnet/coreclr#20812)
Jarret Shook [Fri, 11 Jan 2019 20:55:44 +0000 (12:55 -0800)]
Share arg validation runtest and run-pmi-diff (dotnet/coreclr#20812)

* Share arg validation runtest and run-pmi-diff

Use the same arg validation in runtests.py and run-pmi-diffs.py

* Add valid arches to ci_arch

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

5 years agoAdd missing overrides to SyncTextWriter (dotnet/coreclr#21956)
Stephen Toub [Fri, 11 Jan 2019 20:04:11 +0000 (15:04 -0500)]
Add missing overrides to SyncTextWriter (dotnet/coreclr#21956)

Several recently added virtuals to TextWriter were missing overrides on SyncTextWriter.

We were missing overrides of the synchronous `Write(ReadOnlySpan<char>)` and `WriteLine(ReadOnlySpan<char>)` overloads.  The impact here is primarily performance, though it'll still be an observable change in corner-case scenarios: rather than using the base implementation which would copy the span to an array and then invoke the properly overridden array-based Write{Line} methods, it'll now just delegate to the wrapped span methods.  So it calls the correct overload now on the wrapped instance, and saves some cost in the process.

We were also missing overrides for the async `WriteLineAsync()`, `WriteAsync(ReadOnlyMemory<char>, CancellationToken)`, WriteLineAsync(ReadOnlyMemory<char>, CancellationToken)` overloads.  Fixing these doesn't change the overload that's invoked on the wrapped writer, but it does cause the calls to become synchronous rather than queue a task that in turn calls the synchronized overload.  Whether the new behavior is better is arguable, but it keeps it consistent with every other XxAsync method on SyncTextWriter, which in my opinion is more important... if we wanted to alter the behavior for all of the XxAsync methods, we should do it for all of them.

Also, in the StringBuilder-based overrides, we were ignoring cancellation.  And in the recently added DisposeAsync, we should follow-suit with the rest of the async APIs and make it synchronous.

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

5 years agoRemove unreachable code
Brian Bohe [Fri, 11 Jan 2019 19:15:58 +0000 (11:15 -0800)]
Remove unreachable code

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

5 years agoEnable returning more complex structures via PInvoke returns. (dotnet/coreclr#21470)
Jeremy Koritzinsky [Fri, 11 Jan 2019 19:12:01 +0000 (11:12 -0800)]
Enable returning more complex structures via PInvoke returns. (dotnet/coreclr#21470)

* Add test verifying behavior in dotnet/coreclrdotnet/coreclr#19676.

* Clean up test code.

* Test what happens if we enable returning structures by value.

* Use braced initializer.

* Update Decimal tests to expect that returning a decimal by LPStruct or Currency works.

* Change handle-in-struct marshalling to expect a NotSupportedException thrown at marshal time instead of expecting a MarshalDirectiveException at signature time.

* Update Decimal Reverse-PInvoke tests.

* Disable some previously disabled return marshalling types and add a nice comment block explaining why they're disabled.

* Enable marshalling DateTime return values and add a test.

* Rename IsUnuspportedValueTypeReturn

* Add return test for ArrayWithOffset

* Remove extraneous P/Invoke.

* Fix spelling.

* Add test for successfully returning a struct that has one field of a type that is return-type blocked.

* Add explicit struct return test.

* Clean up tests.

* Fix grammer.

* Add test for struct whose managed layout doesn't require a stdcall return buffer but whose native layout does.

* Add test verifying HandleRef behavior.

* Clean up IsUnsupportedTypedefReturn per PR feedback.

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

5 years agoRemove the Smarty lst files from CoreCLR (dotnet/coreclr#21962)
Jarret Shook [Fri, 11 Jan 2019 18:37:37 +0000 (10:37 -0800)]
Remove the Smarty lst files from CoreCLR (dotnet/coreclr#21962)

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

5 years agoUse a blob feed specifically for coreclr (dotnet/coreclr#21947)
Sven Boemer [Fri, 11 Jan 2019 16:39:50 +0000 (08:39 -0800)]
Use a blob feed specifically for coreclr (dotnet/coreclr#21947)

This will reduce lock contention with other repos due to
https://github.com/dotnet/arcade/issues/1175.

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

5 years agoFlowing the nativeCodeVersion to DebuggerJitInfo (dotnet/coreclr#21925)
Andrew Au [Fri, 11 Jan 2019 16:34:21 +0000 (08:34 -0800)]
Flowing the nativeCodeVersion to DebuggerJitInfo (dotnet/coreclr#21925)

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

5 years agoAdd cleanup of the TypeIDMap at unload time (dotnet/coreclr#21943)
Jan Vorlicek [Fri, 11 Jan 2019 09:38:37 +0000 (10:38 +0100)]
Add cleanup of the TypeIDMap at unload time (dotnet/coreclr#21943)

The TypeIDMap is stored in the AppDomain and contains two hash maps -
id to MethodTable and MethodTable to id. We were missing removing
entries for MethodTables that belong to a LoaderAllocator that's being
destroyed. Thus we were leaking some memory, but also causing potential
issue. When at some point after the LoaderAllocator destruction a
MethodTable gets the same address as one of the MethodTables that was
destroyed in the past and was also recorded in the TypeIDMap, we would
incorrectly reuse the id. That is problematic in case the old
MethodTable didn't require fat id and the new does or vice versa.
I've hit assert due to that while running System.Numerics.Vectors.Tests
inside an unloadable AssemblyLoadContext.

The implementation of the fix is very primitive. It is expected that we
will be able to get rid of the TypeIDMap in a near future and so it is
not worth optimizing.

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

5 years agoMerge pull request dotnet/coreclr#21804 from briansull/fix-unbox-opt
Brian Sullivan [Fri, 11 Jan 2019 02:50:35 +0000 (18:50 -0800)]
Merge pull request dotnet/coreclr#21804 from briansull/fix-unbox-opt

Fix issue with devirtualization and tailcalls

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

5 years agoUpdate CoreFx, PgoData to preview.19060.1, master-20190110.3, respectively (dotnet...
dotnet-maestro-bot [Fri, 11 Jan 2019 02:48:43 +0000 (18:48 -0800)]
Update CoreFx, PgoData to preview.19060.1, master-20190110.3, respectively (dotnet/coreclr#21927)

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

5 years agoAdd WithCancellation for async enumerables (dotnet/coreclr#21939)
Stephen Toub [Fri, 11 Jan 2019 02:48:03 +0000 (21:48 -0500)]
Add WithCancellation for async enumerables (dotnet/coreclr#21939)

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

5 years agoMerge pull request dotnet/coreclr#21928 from fiigii/fixMulx
Carol Eidt [Fri, 11 Jan 2019 02:35:56 +0000 (18:35 -0800)]
Merge pull request dotnet/coreclr#21928 from fiigii/fixMulx

Don't optimize MultiplyNoFlags away

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

5 years agoJIT: fix byte range used by RangeCheck (dotnet/coreclr#21915)
Andy Ayers [Fri, 11 Jan 2019 01:55:09 +0000 (17:55 -0800)]
JIT: fix byte range used by RangeCheck (dotnet/coreclr#21915)

Range is -128 to 127, not -127 to 128.

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

5 years agoNormalize a few more spin-wait loops (dotnet/coreclr#21586)
Koundinya Veluri [Fri, 11 Jan 2019 01:51:53 +0000 (17:51 -0800)]
Normalize a few more spin-wait loops (dotnet/coreclr#21586)

Normalize a few more spin-wait loops

- Fixed a few more spin-waits to normalize the spin-wait duration between processors
- These spin-waits have so far not needed to be retuned to avoid unreasonably long spin-wait durations. They can be retuned as necessary in the future.
  - Added a version of YieldProcessorNormalized() that normalizes based on spin-wait counts tuned for pre-Skylake processors for spin-wait loops that have not been retuned.
- Moved some files around to make YieldProcessorNormalized() and the like available in more places. Initialization is still only done in the VM. Uses outside the VM will use the defaults, where there would be no significant change from before.
- Made YieldProcessor() private outside of the GC and added System_YieldProcessor() for when the system-defined implementation is intended to be used

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

5 years agoMerge pull request dotnet/coreclr#17733 from mikedn/cc-cond2
Brian Sullivan [Fri, 11 Jan 2019 00:29:42 +0000 (16:29 -0800)]
Merge pull request dotnet/coreclr#17733 from mikedn/cc-cond2

Expand GT_JCC/SETCC condition support

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

5 years agoMerge pull request dotnet/coreclr#21937 from BruceForstall/RemoveAltJitJobs
Bruce Forstall [Fri, 11 Jan 2019 00:29:25 +0000 (16:29 -0800)]
Merge pull request dotnet/coreclr#21937 from BruceForstall/RemoveAltJitJobs

Remove altjit jobs in CI

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

5 years agoCode Review feedback
Brian Sullivan [Fri, 11 Jan 2019 00:02:10 +0000 (16:02 -0800)]
Code Review feedback
Change test priority to 0

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

5 years agoDon't optimize BMI2 MultiplyNoFlags away
Fei Peng [Thu, 10 Jan 2019 23:36:37 +0000 (15:36 -0800)]
Don't optimize BMI2 MultiplyNoFlags away

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

5 years agodisable dynamo test on arm32/64 (dotnet/coreclr#21940)
Sung Yoon Whang [Thu, 10 Jan 2019 23:24:55 +0000 (15:24 -0800)]
disable dynamo test on arm32/64 (dotnet/coreclr#21940)

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

5 years agoNew test for DevDiv_754566
Brian Sullivan [Thu, 10 Jan 2019 19:22:12 +0000 (11:22 -0800)]
New test for DevDiv_754566

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

5 years agoMove public interface ISymDocumentWriter to shared location (dotnet/coreclr#21931)
Marek Safar [Thu, 10 Jan 2019 22:47:35 +0000 (23:47 +0100)]
Move public interface ISymDocumentWriter to shared location (dotnet/coreclr#21931)

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

5 years agoMove COMException to shared partition (dotnet/corertdotnet/coreclr#6803)
Marek Safar [Thu, 10 Jan 2019 19:01:43 +0000 (20:01 +0100)]
Move COMException to shared partition (dotnet/corertdotnet/coreclr#6803)

* Move COMException to shared partition

* Review feedback

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

5 years agoMerge pull request dotnet/coreclr#21864 from fiigii/fixscalarmem
Carol Eidt [Thu, 10 Jan 2019 21:39:26 +0000 (13:39 -0800)]
Merge pull request dotnet/coreclr#21864 from fiigii/fixscalarmem

Fix CRC32 instruction encoding on containment form

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

5 years agoAdd an exclusion for hugeexpr1 on arm32 under `JitOptimizationSensitive` . (dotnet...
Sergey Andreenko [Thu, 10 Jan 2019 19:53:32 +0000 (11:53 -0800)]
Add an exclusion for hugeexpr1 on arm32 under `JitOptimizationSensitive` . (dotnet/coreclr#21914)

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

5 years agoRemove altjit jobs in CI
Bruce Forstall [Thu, 10 Jan 2019 19:22:06 +0000 (11:22 -0800)]
Remove altjit jobs in CI

We have full native jobs for arm32 and arm64 for all scenarios, which
is a superset of everything we've run using altjit. So the altjit
jobs are no longer necessary. In addition, the altjit jobs,
especially the corefx jobs, have never run cleanly, for reasons
that have never been investigated or understood. Since we have
full native corefx runs, there is no reason to look into the altjit
failures.

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

5 years agoMerge pull request dotnet/coreclr#21815 from CarolEidt/Fix752890
Carol Eidt [Thu, 10 Jan 2019 19:01:48 +0000 (11:01 -0800)]
Merge pull request dotnet/coreclr#21815 from CarolEidt/Fix752890

[x86] Make copies of odd-size struct arguments

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