platform/upstream/dotnet/runtime.git
5 years agoAdd docs for rejit on attach and the new profiler attach mechanism (dotnet/coreclr...
David Mason [Fri, 7 Jun 2019 20:49:15 +0000 (13:49 -0700)]
Add docs for rejit on attach and the new profiler attach mechanism (dotnet/coreclr#24868)

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

5 years agoReduce indirect function calls (dotnet/coreclr#24980)
David Wrighton [Fri, 7 Jun 2019 18:38:49 +0000 (11:38 -0700)]
Reduce indirect function calls (dotnet/coreclr#24980)

* Reduce indirect dispatch in hot paths in metadata

* Remove allocation indirections in utilcode for coreclr
- we no longer have a multi-dll distribution of code that needs to share heaps

* Remove unused code in GetCLRFunction

* Remove virtual dispatch around impl/decl methodtable access in MethodData

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

5 years agoAddress nullable feedback for System.Runtime and System.Runtime.Extensions (dotnet...
Santiago Fernandez Madero [Fri, 7 Jun 2019 16:01:51 +0000 (11:01 -0500)]
Address nullable feedback for System.Runtime and System.Runtime.Extensions (dotnet/coreclr#25017)

* Address last nullable feedback from System.Runtime

* Address nullable feedback for System.Runtime.Extensions

* PR Feedback

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

5 years agoFix blr printing (dotnet/coreclr#24979)
Carol Eidt [Fri, 7 Jun 2019 13:59:55 +0000 (06:59 -0700)]
Fix blr printing (dotnet/coreclr#24979)

A blr instruction may have a result that is not a pointer size, but its target register is always EA_PTRSIZE.

Fix dotnet/coreclr#24940

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

5 years agoAdd [NotNull] to syncLock parameter of EnsureInitialized (dotnet/coreclr#25012)
Stephen Toub [Fri, 7 Jun 2019 01:54:29 +0000 (21:54 -0400)]
Add [NotNull] to syncLock parameter of EnsureInitialized (dotnet/coreclr#25012)

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

5 years agoAdd DisplayUnits property to DiagnosticCounter (dotnet/coreclr#24981)
Sung Yoon Whang [Fri, 7 Jun 2019 00:18:27 +0000 (17:18 -0700)]
Add DisplayUnits property to DiagnosticCounter (dotnet/coreclr#24981)

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

5 years agoMarking Vector128<T>.Count and Vector256<T>.Count as [Intrinsic] (dotnet/coreclr...
Tanner Gooding [Thu, 6 Jun 2019 23:06:22 +0000 (16:06 -0700)]
Marking Vector128<T>.Count and Vector256<T>.Count as [Intrinsic] (dotnet/coreclr#24991)

* Marking Vector128<T>.Count and Vector256<T>.Count as [Intrinsic]

* Fixing NI_Vector128_Count and NI_Vector256_Count to use clsHnd when getting the simdSize and baseType

* Applying the formatting patch.

* Changing some comments to just be "vector element count".

* Fixing impBaseIntrinsic to set the baseType so Vector128_Count and Vector256_Count don't return nullptr

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

5 years agoUse CMake's C# support to build DacTableGen instead of manually invoking csc.exe...
Jeremy Koritzinsky [Thu, 6 Jun 2019 21:43:54 +0000 (14:43 -0700)]
Use CMake's C# support to build DacTableGen instead of manually invoking csc.exe ourselves. (dotnet/coreclr#24342)

* Use CMake's C# support to build DacTableGen instead of manually invoking csc.exe ourselves.

* Fix x86 failures.

* Disable DAC generation when building with NMake Makefiles and issue an error since the CMake C# support is VS-only. We don't actually support building with NMake (only configure) so this is ok.

* Clean up rest of the macro=1's

PR Feedback.

* Fix Visual Studio generator matching.

* Explicitly specify anycpu32bitpreferred for DacTableGen so the ARM64 build doesn't accidentally make it 64-bit

* Fix bad merge

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

5 years agoMove COM object lifetime control tests to CoreCLR. (dotnet/coreclr#24990)
Jeremy Koritzinsky [Thu, 6 Jun 2019 21:39:42 +0000 (14:39 -0700)]
Move COM object lifetime control tests to CoreCLR. (dotnet/coreclr#24990)

* Add COM object lifetime control tests to CoreCLR.

* Combine cleanup control test into NETClientPrimitives.

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

5 years agoFix initializing BuildTools when the Platform environment variable is set (dotnet...
Elinor Fung [Thu, 6 Jun 2019 21:03:18 +0000 (14:03 -0700)]
Fix initializing BuildTools when the Platform environment variable is set (dotnet/coreclr#24998)

* Make build-test.cmd exit if init-tools.cmd fails

* Clear Platform variable before initializing BuildTools

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

5 years agoMerge pull request dotnet/coreclr#25011 from dotnet/revert-24987-ReenableStackTraceTest
Sergey Andreenko [Thu, 6 Jun 2019 20:52:48 +0000 (13:52 -0700)]
Merge pull request dotnet/coreclr#25011 from dotnet/revert-24987-ReenableStackTraceTest

Revert "Reenable StackTracePreserveTests."

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

5 years agoRevert "Reenable StackTracePreserveTests."
Sergey Andreenko [Thu, 6 Jun 2019 20:49:04 +0000 (13:49 -0700)]
Revert "Reenable StackTracePreserveTests."

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

5 years agoClear syncblock early when `VERIFY_HEAP && DEBUG` to prevent verification asserts...
Vladimir Sadov [Thu, 6 Jun 2019 19:12:55 +0000 (12:12 -0700)]
Clear syncblock early when `VERIFY_HEAP && DEBUG` to prevent verification asserts. (dotnet/coreclr#24992)

Fixes:dotnet/coreclr#24879

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

5 years agoReenable StackTracePreserveTests. (dotnet/coreclr#24987)
Sergey Andreenko [Thu, 6 Jun 2019 17:23:36 +0000 (10:23 -0700)]
Reenable StackTracePreserveTests. (dotnet/coreclr#24987)

I was not able to repro any failures, maybe they were fixed already. Lets see what ci thinks.

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

5 years agoExclude tests that do not work without tailcalls on arm32 Unix. (dotnet/coreclr#24995)
Sergey Andreenko [Thu, 6 Jun 2019 17:22:47 +0000 (10:22 -0700)]
Exclude tests that do not work without tailcalls on arm32 Unix. (dotnet/coreclr#24995)

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

5 years agoDelete unnecessary security transparency attributes (dotnet/coreclr#25007)
Jan Kotas [Thu, 6 Jun 2019 17:09:05 +0000 (10:09 -0700)]
Delete unnecessary security transparency attributes (dotnet/coreclr#25007)

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

5 years agoShortenning /Platform_Assemblies_Paths to just /p for convenience. Leaving the origin...
Fadi Hanna [Thu, 6 Jun 2019 17:05:09 +0000 (10:05 -0700)]
Shortenning /Platform_Assemblies_Paths to just /p for convenience. Leaving the original switch name for compatibility reasons. (dotnet/coreclr#24986)

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

5 years agoAdd R2R outerloop test mode without any stress modes (dotnet/coreclr#24961)
Fadi Hanna [Thu, 6 Jun 2019 17:04:36 +0000 (10:04 -0700)]
Add R2R outerloop test mode without any stress modes (dotnet/coreclr#24961)

* Add R2R outerloop test mode without any stress modes

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

5 years agoPInvoke stubs for Unix platforms (dotnet/coreclr#24834)
Fadi Hanna [Thu, 6 Jun 2019 17:03:52 +0000 (10:03 -0700)]
PInvoke stubs for Unix platforms (dotnet/coreclr#24834)

Enable pinvoke stub inlining on Unix
Exclude x86 Unix platforms from inlining pinvoke stubs (limited support)

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

5 years agoFix tmp dir in configure.cmake (dotnet/coreclr#25003)
Jan Vorlicek [Thu, 6 Jun 2019 13:47:53 +0000 (15:47 +0200)]
Fix tmp dir in configure.cmake (dotnet/coreclr#25003)

The ONE_SHARED_MAPPING_PER_FILEREGION_PER_PROCESS check was using a temp
path that had some non-existent components. While this works fine on Linux,
it fails to create the temp file on OSX.
The fix is to use temp dir in the CMake's output dir.

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

5 years agoDelete TwoKeywords test. (dotnet/coreclr#24982)
Sergey Andreenko [Thu, 6 Jun 2019 04:38:08 +0000 (21:38 -0700)]
Delete TwoKeywords test. (dotnet/coreclr#24982)

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

5 years agoMerge two equal exclusion groups for arm32 All OS. (dotnet/coreclr#24984)
Sergey Andreenko [Thu, 6 Jun 2019 04:37:23 +0000 (21:37 -0700)]
Merge two equal exclusion groups for arm32 All OS. (dotnet/coreclr#24984)

There were two:
<!-- Arm32 All OS -->
    <ItemGroup Condition="'$(XunitTestBinBase)' != '' and ('$(BuildArch)' == 'arm' or '$(AltJitArch)' == 'arm')">
and
<!-- arm32 All OS specific excludes -->
    <ItemGroup Condition="'$(XunitTestBinBase)' != '' and  ('$(BuildArch)' == 'arm' or '$(AltJitArch)' == 'arm')">

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

5 years agoLess work for OptimalMaxSpinWaitsPerSpinIteration fast-path (dotnet/coreclr#21702)
Ben Adams [Thu, 6 Jun 2019 00:36:16 +0000 (01:36 +0100)]
Less work for OptimalMaxSpinWaitsPerSpinIteration fast-path (dotnet/coreclr#21702)

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

5 years agoAPIs to allow profilers to use DoStackSnapShot on Linux (dotnet/coreclr#24968)
David Mason [Thu, 6 Jun 2019 00:30:46 +0000 (17:30 -0700)]
APIs to allow profilers to use DoStackSnapShot on Linux (dotnet/coreclr#24968)

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

5 years agoFix GCStress coverage for multi reg returns. (dotnet/coreclr#24826)
Sergey Andreenko [Thu, 6 Jun 2019 00:25:24 +0000 (17:25 -0700)]
Fix GCStress coverage for multi reg returns. (dotnet/coreclr#24826)

* Extract ReplaceInstrAfterCall.

* Avoid GCStress when return multireg with pointers.

Determinate when we need to protect the second register and do not cause GCStress in such cases.

* Add a repro test.

* Reenable MethodImplOptionsTests.

* Extract IsGcCoveregeInterruptInstruction.

That changes how we do checks for arm32 in `IsGcCoverageInterrupt`.

* Tolerate direct call to JIT_RareDisableHelper.

x86 ILStubClass:IL_STUB_PInvoke(byref,ref,int,byref):int generates it like:
Generating: N119 (  4,  7) [000118] ------------              *  RETURNTRAP int    REG NA
IN0021:        cmp      dword ptr [0F9BF9F8H], 0
New Basic Block BB10 [0009] created.
IN0022:        je       L_M6496_BB10
                                                        Call: GCvars=00000001 {V01}, gcrefRegs=00000000 {}, byrefRegs=00000000 {}
IN0023:        call     CORINFO_HELP_STOP_FOR_GC

* Support GC stress protect return 1/2/both Unix x64.

* Fix arm64.

Do not insert GC Stress instrucitons when we can't determinate the exact return kind.

* Fix review1.

* Fix review2.

* Change the test as Andy suggested.

* Fix some typos.

* Replace all SLOT with PBYTE.

* Disable assert that can fail because of multithreading.

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

5 years agoReenable StackTracePreserveTests.
Sergey Andreenko [Thu, 6 Jun 2019 00:12:26 +0000 (17:12 -0700)]
Reenable StackTracePreserveTests.

I was not able to repro any failures, maybe they were fixed already. Lets see what ci thinks.

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

5 years agoFix PAL_GetLogicalProcessorCacheSizeFromOS on mac (dotnet/coreclr#24777)
Andy Hanson [Wed, 5 Jun 2019 23:58:56 +0000 (16:58 -0700)]
Fix PAL_GetLogicalProcessorCacheSizeFromOS on mac (dotnet/coreclr#24777)

* Fix PAL_GetLogicalProcessorCacheSizeFromOS on mac

In a previous PR
(https://github.com/dotnet/coreclr/commit/dotnet/coreclr@ed52a006c01a582d4d34add40c318d6f324b99ba#diff-8447e54277bb962d167a77bb260760d7R1879),
GetCacheSizePerLogicalCpu was changed to no longer rely on cpuid on
amd64 systems; instead it uses GetLogicalProcessorCacheSizeFromOS().
Unfortunately that function consisted of a number of `#if`s, none of
which were active on macs, and we just returned 0. This caused us to
default to a gen0size of only 0.25MB, causing many GCs.

Fixed by adding a new case that uses `sysctlbyname`.

Fix dotnet/coreclr#24658

* Fixes from code review

* Check for function sysctlbyname instead of header

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

5 years agoShortenning /Platform_Assemblies_Paths to just /p for convenience. Leaving the origin...
fadimounir [Wed, 5 Jun 2019 23:50:14 +0000 (16:50 -0700)]
Shortenning /Platform_Assemblies_Paths to just /p for convenience. Leaving the original switch name for compatibility reasons.

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

5 years agoZero initReg in genSetGSSecurityCookie (dotnet/coreclr#24371)
Egor Chesakov [Wed, 5 Jun 2019 23:24:12 +0000 (16:24 -0700)]
Zero initReg in genSetGSSecurityCookie (dotnet/coreclr#24371)

Fix an issue that is reproduced when

1) a register is used in the prolog for initializing GSSecurityCookie (i.e. the register contains a random non-zero value) and
2) the same register holds a must-init GC variable in the next basic block and
3) the variable is live at the beginning of this basic block.

The register was not zeroed at the end of the prolog and this was causing segmentation fault during GC.Collect().

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

5 years agoMerge pull request dotnet/coreclr#24937 from safern/FixNullableAnnotationsApiReview
Santiago Fernandez Madero [Wed, 5 Jun 2019 22:55:52 +0000 (15:55 -0700)]
Merge pull request dotnet/coreclr#24937 from safern/FixNullableAnnotationsApiReview

Fix some nullable annotations from API Review

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

5 years agoCleanup block stores and test for 24846 (dotnet/coreclr#24950)
Carol Eidt [Wed, 5 Jun 2019 21:51:04 +0000 (14:51 -0700)]
Cleanup block stores and test for 24846 (dotnet/coreclr#24950)

* Cleanup block stores and test for 24846

Fix zero-length assert/bad codegen for initblk.
Remove redundant assertions in codegen and those that don't directly relate to codegen requirements.
Eliminate redundant LEA that was being generated by `genCodeForCpBlk`.
Rename `genCodeFor[Cp|Init]Blk` to `genCodeFor[Cp|Init]BlkHelper` to parallel the other forms.
Fix the test case for dotnet/coreclr#24846.

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

5 years agoAdd test verifying reliable SafeHandle unmarshalling (dotnet/coreclr#24959)
Jeremy Koritzinsky [Wed, 5 Jun 2019 21:49:17 +0000 (14:49 -0700)]
Add test verifying reliable SafeHandle unmarshalling (dotnet/coreclr#24959)

* Add test ensuring we correctly unmarshal a SafeHandle even when the stub throws an exception.

* PR Feedback.

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

5 years agoUse Modern CMake features instead of CMAKE_CXX_FLAGS (dotnet/coreclr#24861)
Jeremy Koritzinsky [Wed, 5 Jun 2019 21:48:55 +0000 (14:48 -0700)]
Use Modern CMake features instead of CMAKE_CXX_FLAGS (dotnet/coreclr#24861)

* Convert C++ standard settings and warning options from CMAKE_<LANG>_FLAGS to Modern CMake isms.

* More $<COMPILE_LANGUAGE> generator expressions instead of CMAKE_CXX_FLAGS.

* Use $<COMPILE_LANGUAGE:CXX> for all -fpermissive usage

* Fix generator expression that generates multiple flags

* Fix invalid use of CMAKE_CXX_FLAGS instead of CMAKE_C_FLAGS.

* Treat AppleClang as though it is Clang (match pre-3.0 behavior).

* Update our build system to understand that AppleClang is distinct from Clang and remove CMP0025 policy setting.

* PR Feedback.

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

5 years agoDisable corefx tests
Santiago Fernandez Madero [Wed, 5 Jun 2019 19:04:05 +0000 (12:04 -0700)]
Disable corefx tests

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

5 years agoSmall fixes around AST nodes. (dotnet/coreclr#24957)
Sergey Andreenko [Wed, 5 Jun 2019 18:52:47 +0000 (11:52 -0700)]
Small fixes around AST nodes. (dotnet/coreclr#24957)

* Fix MEASURE_NODE_SIZE and naming mistakes.

* The additional fields were deleted in dotnet/coreclr#14582 (~1.5 years ago).

* Fix  GT_INDEX_ADDR def.

We created them as `new (this, GT_INDEX_ADDR) GenTreeIndexAddr` but used smaller `GenTreeIndex` as nessecary size.

* Use LargeOpOpcode instead of GT_CALL.

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

5 years agoResolve Windows 10 Kits dir via the environment variable. (dotnet/coreclr#24960)
Jeremy Koritzinsky [Wed, 5 Jun 2019 16:58:04 +0000 (09:58 -0700)]
Resolve Windows 10 Kits dir via the environment variable. (dotnet/coreclr#24960)

* Resolve Windows 10 Kits dir via environment variable.

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

5 years agosignedness (dotnet/coreclr#24878)
Sinan Kaya [Wed, 5 Jun 2019 01:33:50 +0000 (21:33 -0400)]
signedness (dotnet/coreclr#24878)

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

5 years agoRemove stale Task async extension methods from TaskExtensions (dotnet/coreclr#24958)
Santiago Fernandez Madero [Wed, 5 Jun 2019 00:09:30 +0000 (17:09 -0700)]
Remove stale Task async extension methods from TaskExtensions (dotnet/coreclr#24958)

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

5 years agoRemove Collection<T> range APIs (dotnet/coreclr#24938)
Santiago Fernandez Madero [Tue, 4 Jun 2019 23:27:55 +0000 (16:27 -0700)]
Remove Collection<T> range APIs (dotnet/coreclr#24938)

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

5 years agoSynchronize managed and unmanaged Variant fields (dotnet/coreclr#24951)
Jan Kotas [Tue, 4 Jun 2019 22:38:47 +0000 (15:38 -0700)]
Synchronize managed and unmanaged Variant fields (dotnet/coreclr#24951)

* Synchronize managed and unmanaged Variant fields

Fixes dotnet/coreclr#24948

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

5 years agoMore PR Feedback
Santiago Fernandez Madero [Tue, 4 Jun 2019 22:26:31 +0000 (15:26 -0700)]
More PR Feedback

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

5 years agoMake sure we can enable auto-trace when the root level define is added (dotnet/corecl...
Andrew Au [Tue, 4 Jun 2019 21:48:13 +0000 (14:48 -0700)]
Make sure we can enable auto-trace when the root level define is added (dotnet/coreclr#24955)

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

5 years agoPR Feedback
Santiago Fernandez Madero [Tue, 4 Jun 2019 21:09:50 +0000 (14:09 -0700)]
PR Feedback

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

5 years agoEventPipe fixes (dotnet/coreclr#24952)
Andrew Au [Tue, 4 Jun 2019 20:17:51 +0000 (13:17 -0700)]
EventPipe fixes (dotnet/coreclr#24952)

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

5 years agoFix PGO on Windows (dotnet/coreclr#24949)
Jeremy Koritzinsky [Tue, 4 Jun 2019 18:49:51 +0000 (11:49 -0700)]
Fix PGO on Windows (dotnet/coreclr#24949)

* Add warning disables around InitJITHelpers1 for C4731

* Move configureoptimization up in configurecompiler.

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

5 years ago[master] Update dependencies from dotnet/corefx (dotnet/coreclr#24883)
dotnet-maestro[bot] [Tue, 4 Jun 2019 16:20:49 +0000 (09:20 -0700)]
[master] Update dependencies from dotnet/corefx (dotnet/coreclr#24883)

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

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

* Add Microsoft.Diagnostics.Runtime to CoreFx.depproj

* Remove removed commands from RunTests.cmd/sh

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

5 years agoUpdate to AutoTrace (dotnet/coreclr#24936)
John Salem [Tue, 4 Jun 2019 16:09:59 +0000 (09:09 -0700)]
Update to AutoTrace (dotnet/coreclr#24936)

* * Add license headers to autotrace.h|cpp
* use W() macro for getting correct string literal type
* formalize env vars to be COMPlus_* style
* add documentation
* modify cmake files to have the flag and set default value to 0

* Fix typo

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

5 years agoBeing consistent (dotnet/coreclr#24927)
Youssef1313 [Tue, 4 Jun 2019 15:30:26 +0000 (17:30 +0200)]
Being consistent (dotnet/coreclr#24927)

Being consistent using all if statement with curly braces.

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

5 years agofollow the ICU User Guide recommendation to optimize the perf of InvariantCultureIgno...
Adam Sitnik [Tue, 4 Jun 2019 13:20:28 +0000 (15:20 +0200)]
follow the ICU User Guide recommendation to optimize the perf of InvariantCultureIgnoreCase on Linux (dotnet/coreclr#24889)

* follow the ICU User Guide recommendation to optimize the perf of InvariantCultureIgnoreCase on Linux:

1. try to guess the max size and call ucol_getSortKey just once
2. if the buffer is not big enough, call the method again providing the actual sort key length

* handle 0 case

* handle integer overflow

* shorten the time the buffers are pinned

* use the cheapest pinning

* code review fixes: don't use variable length stackalloc, don't copy text from docs (licensing) + don't try to go with the fast path when it would require allocating more managed memory for big strings

* simplify the condition

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

5 years agoPR Feedback
Santiago Fernandez Madero [Tue, 4 Jun 2019 06:37:44 +0000 (23:37 -0700)]
PR Feedback

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

5 years agoFix some nullable annotations from API Review
Santiago Fernandez Madero [Tue, 4 Jun 2019 00:17:26 +0000 (17:17 -0700)]
Fix some nullable annotations from API Review

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

5 years agofix doc for stress run instructions (dotnet/coreclr#24941)
Maoni Stephens [Tue, 4 Jun 2019 04:28:01 +0000 (21:28 -0700)]
fix doc for stress run instructions (dotnet/coreclr#24941)

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

5 years agoSpecify TaskScheduler.Default in EventPipeEventDispatcher (dotnet/coreclr#24930)
Stephen Toub [Tue, 4 Jun 2019 03:56:17 +0000 (23:56 -0400)]
Specify TaskScheduler.Default in EventPipeEventDispatcher (dotnet/coreclr#24930)

Just in case there's a non-default TaskScheduler in play, explicitly specify TaskScheduler.Default so that we don't accidentally schedule this task to another scheduler, in which case it's up to that scheduler if and how to respect the LongRunning request.

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

5 years agoAdded scenario to test that CallGetTotalAllocatedBytes is monotonic in imprecise...
Vladimir Sadov [Tue, 4 Jun 2019 03:55:42 +0000 (20:55 -0700)]
Added scenario to test that CallGetTotalAllocatedBytes is monotonic in imprecise mode. (dotnet/coreclr#24935)

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

5 years agoAvoid moving the bitOffset twice when enumerating safepoints
Andrew Au [Sat, 1 Jun 2019 06:58:38 +0000 (23:58 -0700)]
Avoid moving the bitOffset twice when enumerating safepoints

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

5 years agoFix signature mismatch between managed and unmanaged GetCodeInfo signatures (dotnet...
Jan Kotas [Tue, 4 Jun 2019 02:38:02 +0000 (19:38 -0700)]
Fix signature mismatch between managed and unmanaged GetCodeInfo signatures (dotnet/coreclr#24932)

Fixes dotnet/coreclr#24925

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

5 years agoRemove some event trace asserts that can fail if tracing is stopped at a particular...
Koundinya Veluri [Tue, 4 Jun 2019 02:07:06 +0000 (19:07 -0700)]
Remove some event trace asserts that can fail if tracing is stopped at a particular point (dotnet/coreclr#24897)

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

5 years agoRemove unnecessary Shared<T> class from Task (dotnet/coreclr#24931)
Stephen Toub [Tue, 4 Jun 2019 01:00:04 +0000 (21:00 -0400)]
Remove unnecessary Shared<T> class from Task (dotnet/coreclr#24931)

It's just StrongBox<T>.

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

5 years agoAdjust several `where T : class?` constraints (dotnet/coreclr#24894)
Stephen Toub [Mon, 3 Jun 2019 20:26:24 +0000 (16:26 -0400)]
Adjust several `where T : class?` constraints (dotnet/coreclr#24894)

* Adjust several `where T : class?` constraints

* Address PR feedback

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

5 years agoRemoving the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41...
Tanner Gooding [Mon, 3 Jun 2019 19:15:32 +0000 (12:15 -0700)]
Removing the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41 class (dotnet/coreclr#24886)

* Removing the TestAllOnes, TestAllZeros, and TestMixOnesZeros methods from the Sse41 class

* Removing JIT support for the SSE41_TestAllOnes, SSE41_TestAllZeros, and SSE41_TestMixOnesZeros intrinsics

* Removing tests for the Sse41.TestAllOnes, Sse41.TestAllZeros, and Sse41.TestMixOnesZeros methods

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

5 years agoFix initialize methods to set m_Header correctly (dotnet/coreclr#24892)
John Salem [Mon, 3 Jun 2019 17:16:38 +0000 (10:16 -0700)]
Fix initialize methods to set m_Header correctly (dotnet/coreclr#24892)

* put check in to ensure incoming message header has reasonable size

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

5 years agoFix armel tests build (dotnet/coreclr#24678)
Gleb Balykov [Mon, 3 Jun 2019 16:29:39 +0000 (19:29 +0300)]
Fix armel tests build (dotnet/coreclr#24678)

* Fix build-tests script for cross build and fix tests for armel

* Handle case of -skipcrossgen for cross builds

* Fix build error in case of cross builds when ROOTFS_DIR is not passed explicitly

* Fix portable build parameter setup for armel tests build

* Move force of non-portable build for armel from build.sh/build-test.sh to init-distro-rid.sh

* Fix priority1 tests build for armel

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

5 years agoReenable tests
Juan Hoyos [Fri, 31 May 2019 19:40:44 +0000 (12:40 -0700)]
Reenable tests

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

5 years agoFix logic for deletion
Juan Hoyos [Fri, 31 May 2019 19:33:04 +0000 (12:33 -0700)]
Fix logic for deletion

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

5 years agoDisable event pipe tests for investigation
Juan Hoyos [Fri, 31 May 2019 17:44:00 +0000 (10:44 -0700)]
Disable event pipe tests for investigation

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

5 years agoReenable tests turned off in dotnet/coreclr#24772
Juan Sebastian Hoyos Ayala [Thu, 30 May 2019 18:16:00 +0000 (18:16 +0000)]
Reenable tests turned off in dotnet/coreclr#24772

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

5 years agoFix event pipe session provider list clear
Juan Sebastian Hoyos Ayala [Thu, 30 May 2019 18:12:41 +0000 (18:12 +0000)]
Fix event pipe session provider list clear

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

5 years agoJIT HW Intrinsic implementation doc (dotnet/coreclr#23622)
Carol Eidt [Mon, 3 Jun 2019 13:48:47 +0000 (06:48 -0700)]
JIT HW Intrinsic implementation doc (dotnet/coreclr#23622)

* JIT HW Intrinsic implementation doc

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

5 years agoFinal touch
Andrew Au [Fri, 31 May 2019 22:28:16 +0000 (15:28 -0700)]
Final touch

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

5 years agoProductize auto_trace
John Salem [Sat, 25 May 2019 00:13:06 +0000 (17:13 -0700)]
Productize auto_trace

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

5 years agoAutoTrace - launch dotnet trace to capture trace as soon as the runtime is available...
Andrew Au [Fri, 3 May 2019 22:43:43 +0000 (15:43 -0700)]
AutoTrace - launch dotnet trace to capture trace as soon as the runtime is available to trace

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

5 years agoImprove fatal err msg (dotnet/coreclr#24390)
Dan Moseley [Sun, 2 Jun 2019 13:53:55 +0000 (06:53 -0700)]
Improve fatal err msg (dotnet/coreclr#24390)

* Improve fatal err msg

* Match SO format

* a

* Remove dead define

* More adjustments to ex msg

* And PAL

* Remove special case for SOE

* Remove excess Debug.Assert newline

* Remove excess newline

* typo

* New format

* Remove DebugProvider redundancy

* Adjustments

* Remove preceding newline

* Make other SOE and OOM consistent

* Tidy up assertion msg

* Fix missing newline after inner exception divider

* CR when no inner exception

* ToString never CR terminated

* disable corefx tests temporarily

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

5 years agoMove EventPipeEventSource deletion to a better place (dotnet/coreclr#24901)
Sung Yoon Whang [Sat, 1 Jun 2019 00:17:12 +0000 (17:17 -0700)]
Move EventPipeEventSource deletion to a better place (dotnet/coreclr#24901)

* Move EventPipeEventSource deletion to a better place

* typo

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

5 years agoFix FileStream.FlushAsync() to behave like Flush() (dotnet/coreclr#24902)
Stephen Toub [Fri, 31 May 2019 23:41:59 +0000 (19:41 -0400)]
Fix FileStream.FlushAsync() to behave like Flush() (dotnet/coreclr#24902)

Flush() behaves like Flush(false) and writes out any buffered data but doesn't P/Invoke to FlushFileBuffers/FSync to flush the OS buffers.

But whereas FlushAsync() is supposed to just be an async equivalent of Flush(), it's actually behaving like Flush(true).  This makes FlushAsync() inconsistent and much more expensive.  (This is separate from FlushAsync not actually being async, which is an impactful problem to be solved separately.)

This changes FlushAsync to behave like Flush()/Flush(false) rather than Flush(true).  If someone wants the FlushFileBuffers/FSync behavior, they can call Flush(true).

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

5 years agoUpdate branding to preview7 in master (dotnet/coreclr#24895)
William Godbe [Fri, 31 May 2019 19:48:54 +0000 (12:48 -0700)]
Update branding to preview7 in master (dotnet/coreclr#24895)

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

5 years agoHandle a zero byte cpblk (dotnet/coreclr#24871)
Carol Eidt [Fri, 31 May 2019 18:02:02 +0000 (11:02 -0700)]
Handle a zero byte cpblk (dotnet/coreclr#24871)

Fix dotnet/coreclr#24846

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

5 years agoFix overlooked moduleIndex initial value (dotnet/coreclr#24881)
Jan Vorlicek [Fri, 31 May 2019 16:46:12 +0000 (18:46 +0200)]
Fix overlooked moduleIndex initial value (dotnet/coreclr#24881)

When adding the signature copying some time ago, I have overlooked one
place where the moduleIndex was set to -1 instead of MODULE_INDEX_NONE.
I was using the -1 during the development and replaced it by creating
MODULE_INDEX_NONE during final cleanup at all but one places.

This caused issues during crossgen even without large version bubble
enabled. Methods requiring generic constraint were not crossgen-ed due
to this.

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

5 years agoMakes GetTotalAllocatedBytes monotonic in nonprecise case. (dotnet/coreclr#24875)
Vladimir Sadov [Fri, 31 May 2019 14:45:03 +0000 (07:45 -0700)]
Makes GetTotalAllocatedBytes monotonic in nonprecise case. (dotnet/coreclr#24875)

* Makes GetTotalAllocatedBytes monotonic in nonprecise case.

Fixes:dotnet/coreclr#24615

* read `dead_threads_non_alloc_bytes` atomically on 32bit platforms

* Update src/vm/comutilnative.cpp

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

5 years agoDelete dead code (dotnet/coreclr#24876)
Jan Kotas [Fri, 31 May 2019 06:35:35 +0000 (23:35 -0700)]
Delete dead code (dotnet/coreclr#24876)

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

5 years agoCheck that we are using a valid IDispatch invocation flag earlier to limit the amount...
Jeremy Koritzinsky [Fri, 31 May 2019 03:40:51 +0000 (20:40 -0700)]
Check that we are using a valid IDispatch invocation flag earlier to limit the amount of work we do when we're going to return early anyway. (dotnet/coreclr#24872)

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

5 years agoFix dotnet/coreclr#24867 (dotnet/coreclr#24870)
Jarret Shook [Fri, 31 May 2019 02:07:50 +0000 (19:07 -0700)]
Fix dotnet/coreclr#24867 (dotnet/coreclr#24870)

Pre SDK 3.0, a project type that is not .csproj would not include Directory.Build.targets. Change empty.proj to empty.csproj to allow source build, which uses a 2.1 sdk to build, correctly import Directory.Build.targets.

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

5 years agoRemove unused code in vm/util.* (dotnet/coreclr#24863)
Aaron Robinson [Fri, 31 May 2019 01:38:33 +0000 (18:38 -0700)]
Remove unused code in vm/util.* (dotnet/coreclr#24863)

* Remove unused code in vm/util.*

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

5 years agoAdd information in docs for required Windows SDK version for test build. (dotnet...
Jeremy Koritzinsky [Fri, 31 May 2019 00:33:21 +0000 (17:33 -0700)]
Add information in docs for required Windows SDK version for test build. (dotnet/coreclr#24865)

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

5 years agoMerge pull request dotnet/coreclr#24869 from briansull/desktop-build-fixes
Brian Sullivan [Thu, 30 May 2019 23:49:40 +0000 (16:49 -0700)]
Merge pull request dotnet/coreclr#24869 from briansull/desktop-build-fixes

Fixes for building the Desktop JIT in CodegenMirror

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

5 years agoCreate NearDiffer in SuperPMI based on specified targetArchitecture (dotnet/coreclr...
Egor Chesakov [Thu, 30 May 2019 23:40:50 +0000 (16:40 -0700)]
Create NearDiffer in SuperPMI based on specified targetArchitecture (dotnet/coreclr#24860)

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

5 years agoSupport running SuperPMI with ARM protononjit.dll (dotnet/coreclr#24840)
Egor Chesakov [Thu, 30 May 2019 23:26:12 +0000 (16:26 -0700)]
Support running SuperPMI with ARM protononjit.dll (dotnet/coreclr#24840)

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

5 years agoRemove BuildTools from product build (dotnet/coreclr#24841)
Elinor Fung [Thu, 30 May 2019 21:58:09 +0000 (14:58 -0700)]
Remove BuildTools from product build (dotnet/coreclr#24841)

* Remove BuildTools imports from product build
* Split scripts for installing dotnet vs BuildTools

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

5 years agoFixes for building the Desktop JIT in CodegenMirror
Brian Sullivan [Thu, 30 May 2019 21:34:55 +0000 (14:34 -0700)]
Fixes for building the Desktop JIT in CodegenMirror

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

5 years agoAdd build-tools.cmd (dotnet/coreclr#24817)
Jan Vorlicek [Thu, 30 May 2019 20:07:06 +0000 (22:07 +0200)]
Add build-tools.cmd (dotnet/coreclr#24817)

* Add build-tools.cmd

This script builds selected tools in the src/tools directory (for the
time being, it builds just the runincontext tool). This is a preparation
step to enable nightly runs with unloadability tests. The
build-tools.cmd should build helper tools needed during test runs.

* Remove the build-tools.cmd

* Build the tools as part of the managed runtime build.
* Update the R2RDump project to put binaries into the bin/Product/...

* Update runincontext.cmd/sh scripts

Reflect the new location of the runincontext binary

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

5 years agoMove CI to supported queues
Russ Keldorph [Tue, 28 May 2019 20:05:54 +0000 (13:05 -0700)]
Move CI to supported queues

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

5 years agoUpdate CoreClr to preview6.19280.1 (dotnet/coreclr#24848)
dotnet-maestro-bot [Thu, 30 May 2019 17:09:48 +0000 (10:09 -0700)]
Update CoreClr to preview6.19280.1 (dotnet/coreclr#24848)

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

5 years agoAdd Environment.TickCount64 (dotnet/coreclr#24857)
Stephen Toub [Thu, 30 May 2019 16:54:55 +0000 (12:54 -0400)]
Add Environment.TickCount64 (dotnet/coreclr#24857)

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

5 years agoImplement R2R helpers for synchronized methods (dotnet/coreclr#24646)
Michal Strehovský [Thu, 30 May 2019 15:37:23 +0000 (17:37 +0200)]
Implement R2R helpers for synchronized methods (dotnet/coreclr#24646)

Synchronized methods show up when `Console` is used and the missing helper mapping would cause us not to AOT compile them.

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

5 years agoFrkaya/gcc fix 052919 (dotnet/coreclr#24845)
Sinan Kaya [Thu, 30 May 2019 08:35:37 +0000 (04:35 -0400)]
Frkaya/gcc fix 052919 (dotnet/coreclr#24845)

* fix compilation with gcc7.x

In file included from src/inc/sstring.h:1029:0,
                 from src/inc/ex.h:19,
                 from src/inc/stgpool.h:28,
                 from src/inc/../md/inc/metamodel.h:18,
                 from src/inc/../md/inc/metamodelro.h:19,
                 from src/inc/metadata.h:17,
                 from src/inc/corpriv.h:21,
                 from src/md/compiler/stdafx.h:20,
                 from src/md/compiler/mdutil.cpp:12:
src/inc/sstring.inl: In member function ‘const WCHAR* SString::GetUnicode() const’:
src/inc/sstring.inl:650:5: error: nonnull argument ‘this’ compared to NULL [-Werror=nonnull-compare]
     if (this == NULL)
     ^~

add version check

* Use the abstracted version of __nodebug__

* cc1: warning: command line option ‘-fpermissive’ is valid for C++/ObjC++ but not for C

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

5 years agoAllow generating HW intrinsics in crossgen (dotnet/coreclr#24689)
Michal Strehovský [Thu, 30 May 2019 07:48:07 +0000 (09:48 +0200)]
Allow generating HW intrinsics in crossgen (dotnet/coreclr#24689)

We currently don't precompile methods that use hardware intrinsics because we don't know the CPU that the generated code will run on. Jitting these methods slows down startup and accounts for 3% of startup time in PowerShell.
With this change, we're going to lift this restriction for CoreLib (the thing that matters for startup) and support generating HW intrinsics for our minimum supported target ISA (SSE/SSE2).

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

5 years agoRemove all uses of CanRunManagedCode() (dotnet/coreclr#24847)
Aaron Robinson [Thu, 30 May 2019 06:51:51 +0000 (23:51 -0700)]
Remove all uses of CanRunManagedCode() (dotnet/coreclr#24847)

* Remove all uses of CanRunManagedCode()

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

5 years agoUse /proc/<pid>/mem to read memory in remote DBI data target. It makes the test case...
Mike McLaughlin [Thu, 30 May 2019 06:39:31 +0000 (23:39 -0700)]
Use /proc/<pid>/mem to read memory in remote DBI data target. It makes the test case run at (dotnet/coreclr#24844)

least 4 to 5 times faster than before.

Fallback to old transport ReadMemory if /proc/<pid>/mem can't be opened. This happens
on attach because of permissions/access, but works fine on the launch (the most
important case).

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

5 years agoAdd COMPlus_LTTng environment variable (dotnet/coreclr#24733)
John Salem [Thu, 30 May 2019 01:59:27 +0000 (18:59 -0700)]
Add COMPlus_LTTng environment variable (dotnet/coreclr#24733)

* default value is 1, and when set to 0 will disable loading LTTng.

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

5 years agoSort out ARM load/store instruction size issues (dotnet/coreclr#20126)
mikedn [Thu, 30 May 2019 00:53:11 +0000 (03:53 +0300)]
Sort out ARM load/store instruction size issues (dotnet/coreclr#20126)

* Avoid using ins_Load/ins_Store with constant type

* Use ldr to load array lengths/lower bounds

genCodeForArrIndex and genCodeForArrOffset emit a ldrsw on ARM64 but that's not necessary. Array lengths are always positive. Lower bounds are signed but then the subsequent subtract is anyway EA_4BYTE so sign extension isn't actually needed. Just use ldr on both ARM32 and ARM64.

* Use ldr to load array length (part 2)

genCodeForIndexAddr's range check generation is messed up:
- It uses ldrsw to load array length on ARM64. Not needed, the length is positive.
- It uses sxtw to sign etxend the array length if the index is native int. But it was already extended by the load.
- It creates IND and LEA nodes out of thin air. Just call the appropiate emitter functions.
- It always generates a TYP_I_IMPL cmp, even when the index is TYP_INT. Well, that's just bogus.

* Stop the using the instruction size for immediate scaling on ARM32

The scaling of immediate operands is a property of the instruction and its encoding. It doesnt' make sense to throw the instruction size (emitAttr) into the mix, that's a codegen/emitter specific concept. On ARM32 it's also almost meaningless, at least in the case of integer types - all instructions are really EA_4BYTE, even ldrb, ldrh etc.

The ARM64 emitter already extracts the scaling factor from the instruction. It can't use the instruction size as on ARM64 the size is used to select between 32 bit and 64 bit instructions so it's never EA_1BYTE/EA_2BYTE.

* Stop using ldrsw for TYP_INT loads

ARM64's ins_Load returns INS_ldrsw for TYP_INT but there's nothing in the JIT type system that requires sign extending TYP_INT values on load. The fact that an indir node has TYP_INT doesn't even imply that the value to load is signed, it may be unsigned and indir nodes will never have type TYP_UINT nor have the GTF_UNSIGNED flag set.

XARCH uses a mov (rather than movsxd, the equivalent of ldrsw) so it zero extends. There's no reason for ARM64 to behave differently and doing so makes it more difficult to share codegen logic between XARCH and ARM64

Other ARM64 compilers also use ldr rather than ldrsw.

This requires patching up emitInsAdjustLoadStoreAttr so EA_4BYTE loads don't end up using EA_8BYTE, which ldrsw requires.

* Cleanup genCodeForIndir/genCodeForStoreInd

In particular, cleanup selection of acquire/release instructions. The existing code starts by selecting a "normal" instruction, only to throw it away and redo the type/size logic in the volatile case. And get it wrong in the process, it required that "targetType" be TYP_UINT or TYP_LONG to use ldar. But there are no TYP_UINT indirs.

Also rename "targetType" to "type", using "target" is misleading. The real target type would be genActualType(tree->TypeGet()).

* Remove ARM32/64 load/store instruction size inconsistencies

- Require EA_4BYTE for byte/halfword instructions on ARM32.
- Remove emitInsAdjustLoadStoreAttr on ARM64. Getting the correct instruction size simply requires using emitActualTypeSize, that will provide the correct size on both ARM32 and ARM64.
- Replace emitTypeSize with emitActualTypeSize as needed.

* Remove unnecessary insUnscaleImm parameter

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

5 years agoStop using %~dp0 in build scripts after args processing (dotnet/coreclr#24842)
Elinor Fung [Thu, 30 May 2019 00:10:41 +0000 (17:10 -0700)]
Stop using %~dp0 in build scripts after args processing (dotnet/coreclr#24842)

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