platform/upstream/coreclr.git
5 years agoReplace 'assert' with '_ASSERTE' (#25177)
Andy Hanson [Mon, 17 Jun 2019 09:21:50 +0000 (02:21 -0700)]
Replace 'assert' with '_ASSERTE' (#25177)

5 years agoUpdate linux-instructions.md (#25187)
Fadi Hanna [Mon, 17 Jun 2019 05:16:11 +0000 (22:16 -0700)]
Update linux-instructions.md (#25187)

Update ubuntu arm container version

5 years ago[master] Update dependencies from dotnet/core-setup (#25180)
dotnet-maestro[bot] [Mon, 17 Jun 2019 00:18:30 +0000 (20:18 -0400)]
[master] Update dependencies from dotnet/core-setup (#25180)

* Update dependencies from https://github.com/dotnet/core-setup build 20190614.05

- Microsoft.NETCore.App - 3.0.0-preview7-27814-05

* Update dependencies from https://github.com/dotnet/core-setup build 20190615.05

- Microsoft.NETCore.App - 3.0.0-preview7-27815-05

5 years agoavoid expensive ref counting for CompareInfo on Linux (#25117)
Adam Sitnik [Sun, 16 Jun 2019 04:22:12 +0000 (06:22 +0200)]
avoid expensive ref counting for CompareInfo on Linux (#25117)

* change SafeSortHandle to be CriticalSortHandle to avoid expensive ref counting

* seal the CriticalSortHandle class

* use IntPtr instead of CriticalHandle to avoid resurrection issues. It's ok to never free the handle

* introduce cache for sort handles to prevent from memory leak in certain scenarios

* move the  sort key logic to a dedicated helper type to avoid static field initialization order issues

* lock the dictionary

* simplify the code

* set the charset to Ansi

* Apply suggestions from code review

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
* don't use var

5 years agoDo not export GC entrypoints outside standalone build (#25184)
Michal Strehovský [Sun, 16 Jun 2019 04:20:45 +0000 (06:20 +0200)]
Do not export GC entrypoints outside standalone build (#25184)

It doesn't seem like something we would want to export outside standalone build.

5 years agoAdd active timer counter (#25186)
Sung Yoon Whang [Sat, 15 Jun 2019 23:46:02 +0000 (16:46 -0700)]
Add active timer counter (#25186)

* Add active timer counter

* fix typo

5 years agodon't use var
Adam Sitnik [Sat, 15 Jun 2019 13:10:04 +0000 (13:10 +0000)]
don't use var

5 years agoApply suggestions from code review
Adam Sitnik [Sat, 15 Jun 2019 12:42:52 +0000 (14:42 +0200)]
Apply suggestions from code review

Co-Authored-By: Jan Kotas <jkotas@microsoft.com>
5 years agoset the charset to Ansi
Adam Sitnik [Sat, 15 Jun 2019 09:23:27 +0000 (09:23 +0000)]
set the charset to Ansi

5 years agosimplify the code
Adam Sitnik [Sat, 15 Jun 2019 06:48:50 +0000 (06:48 +0000)]
simplify the code

5 years agoFix duplicate imports in managed product build (#25174)
Elinor Fung [Sat, 15 Jun 2019 05:32:22 +0000 (22:32 -0700)]
Fix duplicate imports in managed product build (#25174)

5 years agoDon't change LCL_FLD node type when replacing param with its shadow copy (#20900)
Egor Chesakov [Sat, 15 Jun 2019 03:30:51 +0000 (20:30 -0700)]
Don't change LCL_FLD node type when replacing param with its shadow copy (#20900)

Fix an issue that is reproduced when:

1) a method requires GSSecurityCookie (e.g. when allocating unsafe buffer using localloc) and

2) one of the method parameters is "vulnerable" and requires a shadow variable to be created and used instead of the original parameter variable and

3) the method parameter has small signed integer type (i.e. int8 or int16) and

4) the value of the parameter is converted to unsigned type (e.g. uint8 or uint16).

5 years agoabort build-tests if failed to restore stress dependencies (#25140)
Sergey Andreenko [Sat, 15 Jun 2019 01:19:13 +0000 (18:19 -0700)]
abort build-tests if failed to restore stress dependencies (#25140)

* abort build-tests if failed to restore stress dependencies

* Fix arm condition.

* Add arm64 condition.

* Skip runtime dependencies for arm32/arm64.

5 years agoMerge pull request #25162 from sandreenko/FixGCStressSettingForTheTest
Sergey Andreenko [Sat, 15 Jun 2019 01:18:49 +0000 (18:18 -0700)]
Merge pull request #25162 from sandreenko/FixGCStressSettingForTheTest

Do not force GcStress=0xc for GitHub_23199 on OSX.

5 years agoMove parts of RuntimeType to shared partition (#25176)
Marek Safar [Sat, 15 Jun 2019 01:12:52 +0000 (03:12 +0200)]
Move parts of RuntimeType to shared partition (#25176)

5 years agoMoving non-EventPipe types out of eventpipe.* (#25161)
José Rivero [Fri, 14 Jun 2019 20:47:04 +0000 (13:47 -0700)]
Moving non-EventPipe types out of eventpipe.* (#25161)

* Replace runtime check with compile time assert.
* Move EventPipeEventPayload to its own file.
* Move `StackContents` to its own file.
* Move other classes declaration/definition out of eventpipe.*

5 years agoDelete OSX condition.
Sergey Andreenko [Fri, 14 Jun 2019 20:38:41 +0000 (13:38 -0700)]
Delete OSX condition.

5 years agoDo not force GCStress at all.
Sergey Andreenko [Fri, 14 Jun 2019 19:49:29 +0000 (12:49 -0700)]
Do not force GCStress at all.

It doesn't work on OSX and Alpine.
It shows random failures on Windows as well, that we do not want to see in our PR/CI outerloop testing.

5 years agoFix crash/corruption in VSD hash tables when backpatching entry point slots is enable...
Koundinya Veluri [Fri, 14 Jun 2019 19:48:45 +0000 (12:48 -0700)]
Fix crash/corruption in VSD hash tables when backpatching entry point slots is enabled (#25158)

Fixes https://github.com/dotnet/coreclr/issues/25080
- The prober used to look for an item (`DispatchStub` or `ResolveCacheElem`) stores information specific to the table
- Cooperative GC mode guarantees that the information stored in the prober remains valid when the prober is reused to add a new item when one is not found
- The lock taken to record/backpatch an item's slot exits and reenters cooperative GC mode, which can cause the table to be reclaimed and replaced with a new table, and the prober still refers to the old table
- Upon adding the new item it may crash or corrupt some other memory
- Fixed by resetting the prober if a path is taken that may reenter cooperative GC mode

5 years agoAdd a build option to skip building managed tools (#25171)
Jarret Shook [Fri, 14 Jun 2019 18:45:46 +0000 (11:45 -0700)]
Add a build option to skip building managed tools (#25171)

This specifically will set __BuildManagedTools=0 and skip building R2RDump and runincontext.

5 years agoUpdate dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimizati...
dotnet-maestro[bot] [Fri, 14 Jun 2019 18:12:09 +0000 (11:12 -0700)]
Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20190614.1 (#25170)

- optimization.IBC.CoreCLR - 99.99.99-master-20190614.1
- optimization.PGO.CoreCLR - 99.99.99-master-20190614.1

5 years agoUpdate the SDK version (#25141)
Tarek Mahmoud Sayed [Fri, 14 Jun 2019 18:04:34 +0000 (19:04 +0100)]
Update the SDK version (#25141)

* Update the SDK version

The updated SDK version has a fix for the issue causing msbuild to crash during the build on Linux environment.

* Use the version recommended by Eric

5 years agolock the dictionary
Adam Sitnik [Fri, 14 Jun 2019 17:38:07 +0000 (17:38 +0000)]
lock the dictionary

5 years agomove the sort key logic to a dedicated helper type to avoid static field initializat...
Adam Sitnik [Fri, 14 Jun 2019 17:34:24 +0000 (17:34 +0000)]
move the  sort key logic to a dedicated helper type to avoid static field initialization order issues

5 years agoMake DisplayUnits string.Empty by default instead of null (#25104)
Sung Yoon Whang [Fri, 14 Jun 2019 17:30:31 +0000 (10:30 -0700)]
Make DisplayUnits string.Empty by default instead of null (#25104)

* Make DisplayUnits string.Empty by default instead of null

* PR feedback on DisplayName and setter validation

5 years agoFix French Decimal number parsing (#25154)
Tarek Mahmoud Sayed [Fri, 14 Jun 2019 16:56:53 +0000 (17:56 +0100)]
Fix French Decimal number parsing (#25154)

5 years agoUpdate dependencies from https://github.com/dotnet/core-setup build 20190613.08 ...
dotnet-maestro[bot] [Fri, 14 Jun 2019 16:31:56 +0000 (12:31 -0400)]
Update dependencies from https://github.com/dotnet/core-setup build 20190613.08 (#25169)

- Microsoft.NETCore.App - 3.0.0-preview7-27813-08

5 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20190613.18 (#25168)
dotnet-maestro[bot] [Fri, 14 Jun 2019 16:29:34 +0000 (12:29 -0400)]
Update dependencies from https://github.com/dotnet/arcade build 20190613.18 (#25168)

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19313.18
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19313.18
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19313.18
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19313.18

5 years agoMerge pull request #25138 from jashook/write_pgo_opt_version_to_intermediates_dir
Jarret Shook [Fri, 14 Jun 2019 15:31:47 +0000 (08:31 -0700)]
Merge pull request #25138 from jashook/write_pgo_opt_version_to_intermediates_dir

Change how build.sh/build.cmd parse the PGO and IBC versions

5 years agoAddress all feedback
jashook [Fri, 14 Jun 2019 14:53:24 +0000 (07:53 -0700)]
Address all feedback

5 years agointroduce cache for sort handles to prevent from memory leak in certain scenarios
Adam Sitnik [Fri, 14 Jun 2019 14:34:38 +0000 (14:34 +0000)]
introduce cache for sort handles to prevent from memory leak in certain scenarios

5 years agoOptimize Activator.CreateInstance (#25145)
Jan Kotas [Fri, 14 Jun 2019 11:29:25 +0000 (04:29 -0700)]
Optimize Activator.CreateInstance (#25145)

* Optimize Activator.CreateInstance
- Short-circuit Activator.CreateInstance<T>() for value types without default constructor
- Cache default constructor delegate on RuntimeType instead of fixed-size singleton cache

5 years agouse IntPtr instead of CriticalHandle to avoid resurrection issues. It's ok to never...
Adam Sitnik [Fri, 14 Jun 2019 07:01:52 +0000 (07:01 +0000)]
use IntPtr instead of CriticalHandle to avoid resurrection issues. It's ok to never free the handle

5 years agoPartially address comments
jashook [Fri, 14 Jun 2019 05:33:08 +0000 (22:33 -0700)]
Partially address comments

5 years agoUpdate Corelib to adapt to compiler nullability updates
Stephen Toub [Thu, 13 Jun 2019 14:03:40 +0000 (10:03 -0400)]
Update Corelib to adapt to compiler nullability updates

5 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20190612.21
dotnet-maestro [Thu, 13 Jun 2019 12:26:02 +0000 (12:26 +0000)]
Update dependencies from https://github.com/dotnet/arcade build 20190612.21

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19312.21
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19312.21
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19312.21
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19312.21

5 years agoFix code version table lock / coop GC mode switch ordering (#25129)
Koundinya Veluri [Fri, 14 Jun 2019 01:50:11 +0000 (18:50 -0700)]
Fix code version table lock / coop GC mode switch ordering (#25129)

Fixes https://github.com/dotnet/coreclr/issues/25086
- The lock is taken inside other unsafe locks in coop mode, in some paths it may not be legal to switch to preemptive mode before taking the lock
- Iterating over the cross loader allocator hash table to backpatch entry point slots needs coop GC mode, and was being done inside the lock
- Moved the switch to coop GC mode to before acquiring the lock to maintain consistent ordering between the two

5 years agoDo not force GcStress=0xc for GitHub_23199.
Sergey Andreenko [Fri, 14 Jun 2019 00:50:15 +0000 (17:50 -0700)]
Do not force GcStress=0xc for GitHub_23199.

There was a typo for Unix (it is COMPlus_GCStress, not COMPlus_GcStress, but COMPlus_GcStressOnDirectCalls was correct). That was why the test passed on OSX.

5 years agoAdd platformGroup parameter to platform-matrix.yml (#25111)
Egor Chesakov [Thu, 13 Jun 2019 23:33:42 +0000 (16:33 -0700)]
Add platformGroup parameter to platform-matrix.yml (#25111)

5 years agoAllow pregenerating most HW intrinsics in CoreLib (#24917)
Michal Strehovský [Thu, 13 Jun 2019 22:24:59 +0000 (00:24 +0200)]
Allow pregenerating most HW intrinsics in CoreLib (#24917)

* Allow pregenerating all HW intrinsics in CoreLib

This is a follow up to #24689 that lets us pregenerate all hardware intrinsics in CoreLib.

We ensures the potentially unsupported code will never be reachable at runtime on CPUs that don't support it by not reporting the `IsSupported` property as intrinsic in crossgen. This ensures the support checks are always JITted. JITting the support checks is very cheap.

There is cost in the form of an extra call and failure to do constant propagation of the return value, but the cost is negligible in practice and gets eliminated once the tiered JIT tiers the method up.

We only do this in CoreLib because user code could technically not guard intrinsic use in `IsSupported` checks and pregenerating the code could lead to illegal instruction traps at runtime (instead of `PlatformNotSupportedException` throws) - it's a bad user experience.

5 years ago[master] Update dependencies from dotnet/core-setup (#25121)
dotnet-maestro[bot] [Thu, 13 Jun 2019 22:11:10 +0000 (18:11 -0400)]
[master] Update dependencies from dotnet/core-setup (#25121)

* Update dependencies from https://github.com/dotnet/core-setup build 20190612.01

- Microsoft.NETCore.App - 3.0.0-preview7-27812-01

* Update dependencies from https://github.com/dotnet/core-setup build 20190612.11

- Microsoft.NETCore.App - 3.0.0-preview7-27812-11

5 years ago[master] Update dependencies from dnceng/internal/dotnet-optimization (#25122)
dotnet-maestro[bot] [Thu, 13 Jun 2019 22:10:37 +0000 (18:10 -0400)]
[master] Update dependencies from dnceng/internal/dotnet-optimization (#25122)

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20190612.1

- optimization.IBC.CoreCLR - 99.99.99-master-20190612.1
- optimization.PGO.CoreCLR - 99.99.99-master-20190612.1

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20190613.1

- optimization.IBC.CoreCLR - 99.99.99-master-20190613.1
- optimization.PGO.CoreCLR - 99.99.99-master-20190613.1

5 years agoUpdate crossgen.md
Fadi Hanna [Thu, 13 Jun 2019 21:59:12 +0000 (14:59 -0700)]
Update crossgen.md

Add instructions on how to use the /r switch. Update instructions to use /p instead of /Platform_Assemblies_Paths (shorter version)

5 years agoMerge pull request #25137 from fadimounir/SuppressWarnings
Fadi Hanna [Thu, 13 Jun 2019 21:26:12 +0000 (14:26 -0700)]
Merge pull request #25137 from fadimounir/SuppressWarnings

Add a switch to suppress crossgen warnings

5 years agoIntrinsicify SpanHelpers.IndexOf(char) (#22505)
Ben Adams [Thu, 13 Jun 2019 21:21:40 +0000 (22:21 +0100)]
Intrinsicify SpanHelpers.IndexOf(char) (#22505)

* Helpers to support Intrinsics in SpanHelpers.Char

* Intrinsicify SpanHelpers.IndexOf(char)

* Feedback

* fix

* Fix assert

* Improve comment warning

* fix

* fix

* Fix

* Fix

5 years agoRemove duplicate not
jashook [Thu, 13 Jun 2019 21:02:53 +0000 (14:02 -0700)]
Remove duplicate not

5 years agoAddress PR feedback.
jashook [Thu, 13 Jun 2019 20:29:27 +0000 (20:29 +0000)]
Address PR feedback.

5 years agoMultiple EventPipe related bugs/issues (#25112)
José Rivero [Thu, 13 Jun 2019 18:14:03 +0000 (11:14 -0700)]
Multiple EventPipe related bugs/issues (#25112)

* Taking the event pipe lock around s_tracingInitialized.
https://github.com/dotnet/coreclr/pull/24896#discussion_r291790885
* Remove unused `EventPipe::s_fileSwitchTimerHandle` and `EventPipe::s_lastFlushTime` static variables.
* Improve `EventPipe::Shutdown` thread-safety (This is not complete yet as shutting down configuration might cause an AV if WriteEvent happens during or after `EventPipe::Shutdown`).
* Make sure we call `EventPipe::Shutdown` only once (the first time around).
* Move two EventPipe methods to `private`

5 years agoAdd a switch to suppress crossgen warnings
fadimounir [Wed, 12 Jun 2019 22:05:56 +0000 (15:05 -0700)]
Add a switch to suppress crossgen warnings

5 years agoDon't try to fold constants for GT_HWIntrinsic (#25139)
Carol Eidt [Thu, 13 Jun 2019 17:28:58 +0000 (10:28 -0700)]
Don't try to fold constants for GT_HWIntrinsic (#25139)

Fix #25133

5 years agoAdd more context to the nmake comment
jashook [Thu, 13 Jun 2019 16:31:33 +0000 (16:31 +0000)]
Add more context to the nmake comment

5 years agoFix nmake build
jashook [Thu, 13 Jun 2019 16:05:53 +0000 (16:05 +0000)]
Fix nmake build

5 years agoEmit a message when skipping a method in crossgen (#25125)
Michal Strehovský [Thu, 13 Jun 2019 07:58:50 +0000 (09:58 +0200)]
Emit a message when skipping a method in crossgen (#25125)

Since crossgen normally prints a message when the compilation didn't happen (because e.g. something is not supported), we should print something here too. Otherwise the `/verbose` log makes it look like pregeneration succeeded and sends someone down a wrong path investigating why it's not picked up at runtime...

5 years agoFix set syntax
jashook [Thu, 13 Jun 2019 05:11:49 +0000 (05:11 +0000)]
Fix set syntax

5 years agoAlso use WriteLinesToFile for IBC merge and read in the file in build.cmd
jashook [Thu, 13 Jun 2019 04:29:29 +0000 (04:29 +0000)]
Also use WriteLinesToFile for IBC merge and read in the file in build.cmd

5 years agoAdd ${__CommonMSBuildArgs} to pass buildtype and arch
jashook [Thu, 13 Jun 2019 03:59:50 +0000 (03:59 +0000)]
Add ${__CommonMSBuildArgs} to pass buildtype and arch

5 years agoFix a couple of annotations on Type (#25136)
Santiago Fernandez Madero [Thu, 13 Jun 2019 01:12:07 +0000 (20:12 -0500)]
Fix a couple of annotations on Type (#25136)

* Fix a couple of annotations on Type

* PR Feedback

5 years agoAlso set the *__TRYRUN_OUTPUT cache value to something. (#24631)
Kai Ruhnau [Thu, 13 Jun 2019 00:23:20 +0000 (02:23 +0200)]
Also set the *__TRYRUN_OUTPUT cache value to something. (#24631)

CMake 3.14 fails in a cross-compilation ARM build and complains
that both both *_EXITCODE and *_EXITCODE__TRYRUN_OUTPUT have
to be set. Doing this re-enables the build.

5 years agouse nodeReuse:false in build.sh and build-test.sh. (#25101)
Jarret Shook [Wed, 12 Jun 2019 22:17:07 +0000 (15:17 -0700)]
use nodeReuse:false in build.sh and build-test.sh. (#25101)

* use nodeReuse:false in build.sh and build-test.sh.

* Address feedback

5 years agoChange how build.sh/build.cmd parse the PGO and IBC versions
jashook [Wed, 12 Jun 2019 22:16:40 +0000 (22:16 +0000)]
Change how build.sh/build.cmd parse the PGO and IBC versions

This will reduce fragility in our build pipeline, by explicitely controlling the output of dotnet msbuild. It also unblocks the source-build effort, as source-build will write extra console output breaking our old parsing.

5 years agoReplace 'where T : object` with `where T : notnull`
Stephen Toub [Wed, 12 Jun 2019 19:09:49 +0000 (15:09 -0400)]
Replace 'where T : object` with `where T : notnull`

5 years agoUpdate dependencies from dotnet/arcade (dotnet/corefx#38474)
dotnet-maestro[bot] [Wed, 12 Jun 2019 17:41:32 +0000 (10:41 -0700)]
Update dependencies from dotnet/arcade (dotnet/corefx#38474)

* Update dependencies from https://github.com/dotnet/arcade build 20190611.2

- Microsoft.DotNet.XUnitExtensions - 2.4.1-beta.19311.2
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.19311.2
- Microsoft.DotNet.VersionTools.Tasks - 1.0.0-beta.19311.2
- Microsoft.DotNet.ApiCompat - 1.0.0-beta.19311.2
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Configuration - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19311.2
- Microsoft.DotNet.CodeAnalysis - 1.0.0-beta.19311.2
- Microsoft.DotNet.CoreFxTesting - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenAPI - 1.0.0-beta.19311.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19311.2
- Microsoft.DotNet.RemoteExecutor - 1.0.0-beta.19311.2
- Microsoft.DotNet.GenFacades - 1.0.0-beta.19311.2

* Update `where T : object` constraint to be `where T : notnull`

* Update several TODO-NULLABLE comments

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoFix nullable annotations on Binder.ReorderArgumentArray
Stephen Toub [Wed, 12 Jun 2019 15:12:31 +0000 (11:12 -0400)]
Fix nullable annotations on Binder.ReorderArgumentArray

5 years agoRemove defunct !s and update some TODO-NULLABLE comments
Stephen Toub [Wed, 12 Jun 2019 15:00:51 +0000 (11:00 -0400)]
Remove defunct !s and update some TODO-NULLABLE comments

5 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20190611.2
dotnet-maestro [Wed, 12 Jun 2019 12:25:40 +0000 (12:25 +0000)]
Update dependencies from https://github.com/dotnet/arcade build 20190611.2

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19311.2
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19311.2
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19311.2

5 years agoAllocate handles for custom marshalers in ALCs instead of in the AppDomain. (#25105)
Jeremy Koritzinsky [Wed, 12 Jun 2019 17:16:42 +0000 (10:16 -0700)]
Allocate handles for custom marshalers in ALCs instead of in the AppDomain. (#25105)

5 years agoEnable coreclr-runincontext in azure pipelines (#25073)
Jan Vorlicek [Wed, 12 Jun 2019 17:15:22 +0000 (19:15 +0200)]
Enable coreclr-runincontext in azure pipelines (#25073)

* Enable coreclr-runincontext in azure pipelines

5 years agoAddress feedback
jashook [Wed, 12 Jun 2019 17:07:38 +0000 (17:07 +0000)]
Address feedback

5 years agoSuperPMI: Fix `getFieldType` (#25102)
Carol Eidt [Wed, 12 Jun 2019 16:07:32 +0000 (09:07 -0700)]
SuperPMI: Fix `getFieldType` (#25102)

* SuperPMI: Fix `getFieldType`

The `structType` out parameter is optional (i.e. it may be null), but it's not used as a key, so we need to update the map if we've saved a null but encounter a non-null.

5 years agoConvert PermissionSet NIE to PlatformNotSupportedException (#25114)
Marek Safar [Wed, 12 Jun 2019 14:33:18 +0000 (16:33 +0200)]
Convert PermissionSet NIE to PlatformNotSupportedException (#25114)

5 years agoExpose readonly heap segments to DAC (#25113)
Michal Strehovský [Wed, 12 Jun 2019 14:32:53 +0000 (16:32 +0200)]
Expose readonly heap segments to DAC (#25113)

This was in CoreRT's copy of gcinterface.dac.h, but got lost in dotnet/corert#7517.

5 years agoAdd missing TraceOperationCreation log event in GetStateMachineBox (#25097)
Stephen Toub [Wed, 12 Jun 2019 13:42:08 +0000 (06:42 -0700)]
Add missing TraceOperationCreation log event in GetStateMachineBox (#25097)

This was removed accidentally as part of overhauling the async infrastructure in 2.1. VS depends on it for some task tracking logic.

5 years agoFix Module::IsInSameVersionBubble contract (#25106)
Jan Vorlicek [Wed, 12 Jun 2019 11:27:12 +0000 (13:27 +0200)]
Fix Module::IsInSameVersionBubble contract (#25106)

* Fix Module::IsInSameVersionBubble contract

The function had an incorrect contract indicating that it cannot throw
and that it cannot trigger GC. This is not true in case the underlying
GetNativeAssemblyImport loads the manifest.
Change the contract to STANDARD_VM_CONTRACT

5 years agoseal the CriticalSortHandle class
Adam Sitnik [Wed, 12 Jun 2019 09:53:35 +0000 (11:53 +0200)]
seal the CriticalSortHandle class

5 years agochange SafeSortHandle to be CriticalSortHandle to avoid expensive ref counting
Adam Sitnik [Wed, 12 Jun 2019 09:18:39 +0000 (11:18 +0200)]
change SafeSortHandle to be CriticalSortHandle to avoid expensive ref counting

5 years agoCoreRT change
Suchiman [Tue, 11 Jun 2019 19:38:23 +0000 (21:38 +0200)]
CoreRT change

5 years agoEnsure gen0_max_size to be initially >= gen0_min_size
Suchiman [Sun, 9 Jun 2019 16:18:44 +0000 (18:18 +0200)]
Ensure gen0_max_size to be initially >= gen0_min_size

Otherwise, gen0_min_size is eventually capped by gen0_max_size, which makes it impossible to raise gen0 size above the default max sizes for gen0.
This is required for some scenarios (CppCodeGen, WASM) in CoreRT.

5 years agoMultiple CoreRT changes
Suchiman [Tue, 11 Jun 2019 19:32:51 +0000 (21:32 +0200)]
Multiple CoreRT changes

5 years agoFix casts
Suchiman [Tue, 11 Jun 2019 19:30:57 +0000 (21:30 +0200)]
Fix casts

5 years agoFix Redhawk defines
Suchiman [Tue, 11 Jun 2019 19:17:46 +0000 (21:17 +0200)]
Fix Redhawk defines

5 years agoUNREFERENCED_PARAMETER
Suchiman [Tue, 11 Jun 2019 19:14:57 +0000 (21:14 +0200)]
UNREFERENCED_PARAMETER

5 years agoPort typo fixes from CoreRT
Suchiman [Tue, 11 Jun 2019 18:18:39 +0000 (20:18 +0200)]
Port typo fixes from CoreRT

5 years agoJIT: use stress mode tail call validation info for implicit tail calls (#25093)
Andy Ayers [Wed, 12 Jun 2019 01:17:47 +0000 (18:17 -0700)]
JIT: use stress mode tail call validation info for implicit tail calls (#25093)

If a call site fails tail call stress validation, don't consider it for
implicit tail calling either.

In normal jitting we defer this level of validation until impImportCall
to avoid duplicating work.

This avoids an assert when we have invalid IL.

Fixes #25027.

5 years agoFix context restore for ARM/ARM64 debugging (#25089)
Juan Hoyos [Wed, 12 Jun 2019 00:16:25 +0000 (17:16 -0700)]
Fix context restore for ARM/ARM64 debugging (#25089)

5 years agoFall back to CpuId if failed to get cache size from OS (#24989)
Andy Hanson [Tue, 11 Jun 2019 23:20:29 +0000 (16:20 -0700)]
Fall back to CpuId if failed to get cache size from OS (#24989)

* Fall back to CpuId if failed to get cache size from OS

It's possible for GetLogicalProcessorCacheSizeFromOS() to fail;
this happens on alpine linux where it compiles to just `return 0;`.

As a fallback, we can get the cache size from CpuId. Previously that
was specific to x86; this PR preserves the behavior that we never call
GetLogicalProcessorCacheSizeFromOS on x86.

CpuId only works on x86 and amd64; on other systems we may still return
0 from here. Then GC defaults to a cache size of only 0.25MB.

Note: Removed the code in an `#ifdef _WIN64` that was nested inside of
`#if defined (_TARGET_X86_)`. Presuming that is dead code.

* Fix exception handler

5 years agoFix ForeignThreadExceptions test (#25074)
Jan Vorlicek [Tue, 11 Jun 2019 22:42:46 +0000 (00:42 +0200)]
Fix ForeignThreadExceptions test (#25074)

This test creates a native thread on which it calls a managed callback. It uses
std::thread to create the thread. The problem is that on MUSL based Linux distros,
the default stack size for secondary threads is 80kB, which is not enough for this
test.
Since std::thread has no way to set the thread stack size, the fix is to use
pthreads on Unix and keep the std::thread for Windows only.

5 years agouse nodeReuse:false in build.sh and build-test.sh.
jashook [Tue, 11 Jun 2019 21:57:57 +0000 (21:57 +0000)]
use nodeReuse:false in build.sh and build-test.sh.

5 years agoImprove corefx testing (#24962)
Bruce Forstall [Tue, 11 Jun 2019 21:18:08 +0000 (14:18 -0700)]
Improve corefx testing (#24962)

CoreFX tests are now used to test CoreCLR on Windows/x64 and Linux/x64.
PR testing includes normal and no-tiered modes. CI testing will include
all JIT stress modes that apply to CoreCLR testing. Many tests have been
disabled to allow the jobs to (mostly) run error-free.

Support for other platforms requires fixes to the testhost generation.

5 years agoCompilation fixes (#25084)
Sinan Kaya [Tue, 11 Jun 2019 21:08:08 +0000 (17:08 -0400)]
Compilation fixes (#25084)

5 years agoTrack timer count and add Timer.ActiveCount (#25061)
Koundinya Veluri [Tue, 11 Jun 2019 20:56:40 +0000 (13:56 -0700)]
Track timer count and add Timer.ActiveCount (#25061)

* Track timer count and add Timer.Count

Part of https://github.com/dotnet/corefx/issues/38422

* Use lock to prevent tearing

* Add assert

* Rename Count to ActiveCount

* Fix build

5 years agoUse the per session configuration to invoke the EventPipeProvider callbacks (#25088)
Andrew Au [Tue, 11 Jun 2019 20:51:09 +0000 (13:51 -0700)]
Use the per session configuration to invoke the EventPipeProvider callbacks (#25088)

* Use the per session configuration to invoke the EventPipeProvider callbacks

* Avoid making the callback if the session does not have the provider

5 years agoDelete dead code (#25066)
Jan Kotas [Tue, 11 Jun 2019 20:18:03 +0000 (13:18 -0700)]
Delete dead code (#25066)

5 years agoR2R ilstubs (#24823)
David Wrighton [Tue, 11 Jun 2019 20:13:09 +0000 (13:13 -0700)]
R2R ilstubs (#24823)

* Basic support for precompiled pinvoke stubs

* Generate R2R file with multiple references to same IL stub (one per method which the IL stub is associated with)
* Not all il stubs are p/invokes. Don't fail when they aren't.
* Consistently use IsDynamicScope and GetModule to avoid unsafe memory access in IL stub compilation paths
* Enable full p/invoke il stubs when compiling System.Private.Corelib
* Disable IL Stub generation in crossgen for ARM32.
- The cross bitness logic is not correct for IL Stub generation

5 years agoUpdate dependencies from https://github.com/dotnet/core-setup build 20190611.01 ...
dotnet-maestro[bot] [Tue, 11 Jun 2019 19:00:31 +0000 (12:00 -0700)]
Update dependencies from https://github.com/dotnet/core-setup build 20190611.01 (#25078)

- Microsoft.NETCore.App - 3.0.0-preview7-27811-01

5 years agoMake GetSessionProvider const (#25085)
Andrew Au [Tue, 11 Jun 2019 18:00:34 +0000 (11:00 -0700)]
Make GetSessionProvider const (#25085)

5 years agoRefactor one-time ETL rundown event firing (#24993)
Koundinya Veluri [Tue, 11 Jun 2019 17:58:05 +0000 (10:58 -0700)]
Refactor one-time ETL rundown event firing (#24993)

- Moved the `RuntimeInformation` and `TieredCompilation/Settings` events to fire on rundown on attach/detach

5 years agoUpdate IEquatable/IComparable<T> for nullability (#25053)
Stephen Toub [Tue, 11 Jun 2019 16:08:18 +0000 (09:08 -0700)]
Update IEquatable/IComparable<T> for nullability (#25053)

We need to revise our use of nullable for `IComparable<T>` and `IEquatable<T>`:
- For reference types that implement `IComparable<T>`, the implementation should use `IComparable<T?>`, e.g. `String : IComparable<String?>`, so that the type can be used in methods with a `where T : IComparable<T>` constraint: `IComparable<T>`'s contravariance then allows both `T` and `T?` to work as generic type arguments.
- For reference types that implement `IEquatable<T>`, we can't take advantage of such contravariance, as by design `IEquatable<T>` is invariant (it would be a breaking change to make it contravariant, and even if it wasn't doing so is of questionable design given that equality and inheritance don't mix well).  Given the current language design, we have little option but to explicitly make any reference type implementations of `IEquatable<T>` be oblivious, and also make all `where T : IEquatable<T>` constraints be oblivious.  Otherwise, regardless nullable annotations, a developer will get a warning for using either or both of `T`/`T?` with any given method employing such a constraint.

5 years agoUpdate dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimizati...
dotnet-maestro[bot] [Tue, 11 Jun 2019 14:22:26 +0000 (14:22 +0000)]
Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20190610.3 (#25079)

- optimization.IBC.CoreCLR - 99.99.99-master-20190610.3
- optimization.PGO.CoreCLR - 99.99.99-master-20190610.3

5 years agoUpdate dependencies from https://github.com/dotnet/corefx build 20190611.1 (#25077)
dotnet-maestro[bot] [Tue, 11 Jun 2019 14:08:08 +0000 (07:08 -0700)]
Update dependencies from https://github.com/dotnet/corefx build 20190611.1 (#25077)

- Microsoft.Bcl.AsyncInterfaces - 1.0.0-preview7.19311.1
- Microsoft.NETCore.Platforms - 3.0.0-preview7.19311.1
- Microsoft.Private.CoreFx.NETCoreApp - 4.6.0-preview7.19311.1

5 years agoUpdate dependencies from https://github.com/dotnet/arcade build 20190610.24 (#25076)
dotnet-maestro[bot] [Tue, 11 Jun 2019 14:07:54 +0000 (07:07 -0700)]
Update dependencies from https://github.com/dotnet/arcade build 20190610.24 (#25076)

- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19310.24
- Microsoft.DotNet.Build.Tasks.Feed - 2.2.0-beta.19310.24
- Microsoft.DotNet.Build.Tasks.Packaging - 1.0.0-beta.19310.24
- Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19310.24