platform/upstream/dotnet/runtime.git
6 years agoMerge pull request dotnet/coreclr#18356 from CarolEidt/Fix_GT_START_NONGC
Carol Eidt [Thu, 7 Jun 2018 23:53:45 +0000 (16:53 -0700)]
Merge pull request dotnet/coreclr#18356 from CarolEidt/Fix_GT_START_NONGC

GT_START_NONGC has no kill set

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

6 years agoSkip old time zones adjustments with offsets higher than 14h (dotnet/coreclr#18305)
Krzysztof Wicher [Thu, 7 Jun 2018 22:55:54 +0000 (15:55 -0700)]
Skip old time zones adjustments with offsets higher than 14h (dotnet/coreclr#18305)

* Skip old time zones with offsets higher than 14h

* apply offline feedback

* fix braces

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

6 years agoGT_START_NONGC has no kill set
Carol Eidt [Thu, 7 Jun 2018 20:58:22 +0000 (13:58 -0700)]
GT_START_NONGC has no kill set

It was mistakenly added to the `GT_PROF_HOOK` case in the recent LSRA changes.

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

6 years agoAllow ILCodeVersion to fallback to default IL (dotnet/coreclr#18322)
Noah Falk [Thu, 7 Jun 2018 19:53:08 +0000 (12:53 -0700)]
Allow ILCodeVersion to fallback to default IL (dotnet/coreclr#18322)

For compat with profilers that used our APIs in unexpected ways we can allow
the ILCodeVersion to fallback to the default IL code when no IL was explicitly
given.

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

6 years agoMoves CurrentSystemTimeZone, ICastable, RegistryView and RegistryValueKind to shared...
Maryam Ariyan [Thu, 7 Jun 2018 19:40:40 +0000 (12:40 -0700)]
Moves CurrentSystemTimeZone, ICastable, RegistryView and RegistryValueKind to shared (dotnet/coreclr#18337)

* Moves CurrentSystemTimeZone to shared completely

* Moves ICastable to shared

* Moves RegistryView and RegistryValueKind to shared

* Moves ICastableHelpers to its own file

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

6 years agoForce short date pattern to use yyyy on Linux (dotnet/coreclr#18316)
Tarek Mahmoud Sayed [Thu, 7 Jun 2018 18:01:26 +0000 (11:01 -0700)]
Force short date pattern to use yyyy on Linux (dotnet/coreclr#18316)

* Force short date pattern to use yyyy on Linux

The default pattern we get is using yy which causes the years  to be displayed  as 2 digits. This is not acceptable for many users. The fix here is to force 4-digit year as a default and still keep the original pattern which has 2-digits year in the optional list

* Address the review feedback

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

6 years agoRemove dead case from string.Compare (dotnet/coreclr#18345)
Stephen Toub [Thu, 7 Jun 2018 17:24:11 +0000 (13:24 -0400)]
Remove dead case from string.Compare (dotnet/coreclr#18345)

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

6 years agoGuard Windows code under PLATFORM_WINDOWS (dotnet/coreclr#18344)
Marek Safar [Thu, 7 Jun 2018 17:07:47 +0000 (10:07 -0700)]
Guard Windows code under PLATFORM_WINDOWS (dotnet/coreclr#18344)

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

6 years agoFixed a couple of comments about ArgumentException on timeout parameters (dotnet...
Alfred Myers [Thu, 7 Jun 2018 07:06:45 +0000 (04:06 -0300)]
Fixed a couple of comments about ArgumentException on timeout parameters (dotnet/coreclr#18335)

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

6 years agoRemove a dead branch from __DTString (dotnet/coreclr#18334)
Stephen Toub [Thu, 7 Jun 2018 07:06:09 +0000 (03:06 -0400)]
Remove a dead branch from __DTString (dotnet/coreclr#18334)

All call sites to the ctor validate that the DateTimeFormatInfo has been created.

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

6 years agoDelete FormatterConverter from CoreLib (dotnet/coreclr#18336)
Stephen Toub [Thu, 7 Jun 2018 07:04:30 +0000 (03:04 -0400)]
Delete FormatterConverter from CoreLib (dotnet/coreclr#18336)

It's not used in the library.  The type is implemented/exposed from corefx.

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

6 years agoCross-bitness support in JitInterface (dotnet/coreclr#18329)
Egor Chesakov [Thu, 7 Jun 2018 06:49:48 +0000 (23:49 -0700)]
Cross-bitness support in JitInterface (dotnet/coreclr#18329)

* Replace sizeof(tailCallType) / sizeof(tailCallType[0]) with _countof(tailCallType)

* Remove TransparentProxyObject and RealProxyObject

* InlinedCallFrame::GetEEInfo should not be used for R2R compilation

* Hardcode constants used in CEEInfo::getEEInfo

* Thread fields should not be used for R2R compilation

* Zero pEEInfoOut->inlinedCallFrameInfo when compiling R2R code

* Rename OFFSETOF__PtrArray__m_Array to avoid compilation conflicts with asmconstants

* Add assertions enabled in every non-crossbitness scenario

* Define and use CROSSBITNESS_COMPILE macro

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

6 years agoFix ARM cast codegen (dotnet/coreclr#18063)
mikedn [Thu, 7 Jun 2018 05:18:59 +0000 (08:18 +0300)]
Fix ARM cast codegen (dotnet/coreclr#18063)

* Fix ARM cast codegen

ARM cast codegen is rather convoluted and sometimes does the wrong thing by applying GTF_UNSIGNED to the destination type even though this flag is only about the source type.

* Add more conversion tests

These tests are intended to support casts with contained operands. They're also useful to catch issues caused by load nodes having small types and generally improve test coverage for casts.

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

6 years agoAdding containment support for more x86 hardware intrinsics (dotnet/coreclr#18297)
Tanner Gooding [Thu, 7 Jun 2018 01:24:04 +0000 (18:24 -0700)]
Adding containment support for more x86 hardware intrinsics (dotnet/coreclr#18297)

* Adding containment support to one-operand scalar HWIntrinsics (x86)

* Adding containment support to two-operand imm HWIntrinsics (x86)

* Adding containment support to three-operand imm HWIntrinsics (x86)

* Updating hwintrinsiccodegenxarch to properly mask Sse41.Insert for TYP_FLOAT

* Updating the Sse41.Insert tests for TYP_FLOAT

* Adding containment support for Sse2.CompareLessThan and BlendVariable (Sse41/Avx/Avx2)

* Fixing `genHWIntrinsic_R_RM_I` to call `emitIns_SIMD_R_R_I`, rather than `emitIns_R_R_I`

* Updating emitOutputSV to not modify the code for IF_RWR_RRD_SRD_CNS

* Cleaning up some of the emitxarch code.

* Moving roundps and roundpd into the IsDstSrcImm check

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

6 years agoR2RDump - Unwind Info (dotnet/coreclr#18248)
Amy [Wed, 6 Jun 2018 21:19:56 +0000 (14:19 -0700)]
R2RDump - Unwind Info (dotnet/coreclr#18248)

* Extract unwind info from image

* Use typeDef.Namespace to get full namespace, move to separate function

* Avoid passing R2RReader to R2RMethod and RuntimeFunction constructors

* Dump unwind info

* Changes to unwindInfo output format

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

6 years agoFix issue in Compiler::impImportStaticFieldAccess (dotnet/coreclr#18328)
Jan Vorlicek [Wed, 6 Jun 2018 20:39:47 +0000 (22:39 +0200)]
Fix issue in Compiler::impImportStaticFieldAccess (dotnet/coreclr#18328)

When CORINFO_FIELD_STATIC_SHARED_STATIC_HELPER accessor is being processed for
structs, the method creates a GT_IND node instead of GT_OBJ node. For structs
that can be normalized to a specific type (like TYP_SIMD8), it causes an assert
in Compiler::impNormStructVal in the switch case for GT_IND.

This change modifies the node creation to work the same way as in the default
case for accessors, creating GT_OBJ for structs and GT_IND otherwise.

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

6 years agoJIT: implement assembly name dissassembly filtering (dotnet/coreclr#18306)
Andy Ayers [Wed, 6 Jun 2018 19:37:09 +0000 (12:37 -0700)]
JIT: implement assembly name dissassembly filtering (dotnet/coreclr#18306)

Add `COMPlus_JitDisasmAssemblies` to specify a whitelist of assemblies
whose methods will be disassembled (also filters out order, EH, GC, and
unwind info dumps too).

Intended use is for PMI asm diffing. Since PMI runs in process, current
disassembly will dissassemble various methods in PMI itself as well
as framework methods that did not get prejitted.

With this new config option we can restrict disassembly to just the assemblies
that we're processing via PMI.

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

6 years agoMoves FastResourceComparer and TaskAwaiter to shared (dotnet/coreclr#18283)
Maryam Ariyan [Wed, 6 Jun 2018 17:15:19 +0000 (10:15 -0700)]
Moves FastResourceComparer and TaskAwaiter to shared (dotnet/coreclr#18283)

* Reduces diff in BinaryReader

* Moves FastResourceComparer to shared

* Reduces diff in FileBasedResourceGroveler

* Minor comment diff in ManifestBasedResourceGroveler

* Reducing diff by removing extra blank lines in ResourceReader

* Reduces diff by renaming private fields in AssemblyName

* String to string and Object to object in AssemblyName

* Reduces diff in TaskAwaiter

* Moves TaskAwaiter to shared

* Apply code review feedback

* Fixes failure in corert

* Revert Renaming fields in AssemblyName

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

6 years agoIncrease timeout and log the result for some WaitAny tests that expect AbandonedMutex...
Koundinya Veluri [Wed, 6 Jun 2018 17:09:29 +0000 (10:09 -0700)]
Increase timeout and log the result for some WaitAny tests that expect AbandonedMutexException (dotnet/coreclr#18312)

Follow-up to https://github.com/dotnet/coreclr/pull/13298, missed a few cases.

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

6 years agoAdd instructions for making idl file changes (dotnet/coreclr#18188)
Noah Falk [Wed, 6 Jun 2018 03:40:12 +0000 (20:40 -0700)]
Add instructions for making idl file changes (dotnet/coreclr#18188)

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

6 years agoMerge pull request dotnet/coreclr#18313 from dotnet-bot/from-tfs
Brian Sullivan [Wed, 6 Jun 2018 00:58:21 +0000 (17:58 -0700)]
Merge pull request dotnet/coreclr#18313 from dotnet-bot/from-tfs

Merge changes from TFS

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

6 years agoMerge pull request dotnet/coreclr#18303 from mikedn/lockadd4
Carol Eidt [Wed, 6 Jun 2018 00:31:31 +0000 (17:31 -0700)]
Merge pull request dotnet/coreclr#18303 from mikedn/lockadd4

Use the actual type of LOCKADD's data operand

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

6 years agoFix a warning as error issue that causes a build break on the Desktop CLR
Brian Sullivan [Tue, 5 Jun 2018 22:11:08 +0000 (15:11 -0700)]
Fix a warning as error issue that causes a build break on the Desktop CLR

[tfs-changeset: 1702868]

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

6 years agoUse sysconf(_SC_NPROCESSORS_CONF) instead of sysconf(_SC_NPROCESSORS_ONLN) in PAL...
Egor Chesakov [Tue, 5 Jun 2018 18:38:56 +0000 (11:38 -0700)]
Use sysconf(_SC_NPROCESSORS_CONF) instead of sysconf(_SC_NPROCESSORS_ONLN) in PAL and GC ONLY on ARM and ARM64 (dotnet/coreclr#18289)

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

6 years agoUse the actual type of LOCKADD's data operand
Mike Danes [Tue, 5 Jun 2018 16:29:22 +0000 (19:29 +0300)]
Use the actual type of LOCKADD's data operand

The data operand can theoretically be a small int so we need to use its actual type to determine instruction size.

In practice this issue does not seem to happen as the importer is pretty insistent in spilling interlocked arguments to lclvars that have the proper type. Even when the data argument is already a small int lclvar (e.g. short method argument) this still doesn't cause problems because there's a cast between the method argument and LOCKADD.

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

6 years agoUpdate SDK used to build jitutils to 2.1 RC (dotnet/coreclr#18290)
Andy Ayers [Tue, 5 Jun 2018 14:52:35 +0000 (07:52 -0700)]
Update SDK used to build jitutils to 2.1 RC (dotnet/coreclr#18290)

In anticipation of taking a dependence on netcoreapp2.1 for the
forthcoming PMI work from jitutils.

Also make sure to shut down build servers before cleaning up the SDK.

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

6 years agoUse WChar instead of char (dotnet/coreclr#18294)
Luqun Lou [Tue, 5 Jun 2018 13:40:34 +0000 (06:40 -0700)]
Use WChar instead of char (dotnet/coreclr#18294)

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

6 years agoJIT: tolerate byref/nint return type mismatches during inlining (dotnet/coreclr#18274)
Andy Ayers [Mon, 4 Jun 2018 23:02:01 +0000 (16:02 -0700)]
JIT: tolerate byref/nint return type mismatches during inlining (dotnet/coreclr#18274)

Have the jit tolerate byref/nint return type mismatches for inlines
same way that it tolerates them for ret instructions.

Fixes dotnet/coreclr#18270.

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

6 years agoAdding function headers to the 'emitIns_SIMD_*' methods and clarifying comments on...
Tanner Gooding [Sun, 3 Jun 2018 03:53:03 +0000 (20:53 -0700)]
Adding function headers to the 'emitIns_SIMD_*' methods and clarifying comments on related code.

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

6 years agoUpdating the x86 HWIntrinsics to support containment for most one-operand intrinsics.
Tanner Gooding [Sun, 3 Jun 2018 03:41:06 +0000 (20:41 -0700)]
Updating the x86 HWIntrinsics to support containment for most one-operand intrinsics.

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

6 years agoFixing up ContainCheckHWIntrinsic to use intrinsicId and to switch on the category...
Tanner Gooding [Sun, 3 Jun 2018 01:55:51 +0000 (18:55 -0700)]
Fixing up ContainCheckHWIntrinsic to use intrinsicId and to switch on the category for 1/3 arg intrinsics

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

6 years agoFixing the name of the paramters in the emitIns_SIMD_* methods.
Tanner Gooding [Sun, 3 Jun 2018 01:53:20 +0000 (18:53 -0700)]
Fixing the name of the paramters in the emitIns_SIMD_* methods.

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

6 years agoMerge pull request dotnet/coreclr#18267 from mikedn/lockadd3
Carol Eidt [Mon, 4 Jun 2018 21:57:09 +0000 (14:57 -0700)]
Merge pull request dotnet/coreclr#18267 from mikedn/lockadd3

Cleanup LOCKADD handling

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

6 years agoMake Encoding.Unicode.GetString faster on 64-bit platforms (dotnet/coreclr#18263)
Jan Kotas [Mon, 4 Jun 2018 20:09:29 +0000 (13:09 -0700)]
Make Encoding.Unicode.GetString faster on 64-bit platforms (dotnet/coreclr#18263)

UnicodeEncoding was taking fast path only when both source and destination were 8-byte aligned. It was not
the case for Unicode.GetString.

The fix is to just check the source alignment as fast path precondition, and use unaligned write for destination.

Also removed alternative fast path that is not needed anymore, tweaked local variable assignments for better
register allocation, and fixed performance issue introduced by recent big endian portability fix.

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

6 years agoR2RDump - Dump AvailableTypes section contents (dotnet/coreclr#18227)
Amy [Mon, 4 Jun 2018 18:40:58 +0000 (11:40 -0700)]
R2RDump - Dump AvailableTypes section contents (dotnet/coreclr#18227)

* Move R2RReader constructor to separate functions, parse READYTORUN_SECTION_AVAILABLE_TYPES

* Fix bug from merging, output formatting changes

* Rename availableTypes variables, save availableTypes as string instead of tuple

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

6 years agoCleanup LOCKADD handling
Mike Danes [Sun, 3 Jun 2018 21:50:17 +0000 (00:50 +0300)]
Cleanup LOCKADD handling

LOCKADD nodes are generated rather early and there's no reason for that:
* The CORINFO_INTRINSIC_InterlockedAdd32/64 intrinsics are not actually used. Even if they would be used we can still import them as XADD nodes and rely on lowering to generate LOCKADD when needed.
* gtExtractSideEffList transforms XADD into LOCKADD but this can be done in lowering. LOCKADD is an XARCH specific optimization after all.

Additionally:
* Avoid the need for special handling in LSRA by making GT_LOCKADD a "no value" oper.
* Split LOCKADD codegen from XADD/XCHG codegen, attempting to use the same code for all 3 just makes things more complex.
* The address is always in a register so there's no real need to create an indir node on the fly, the relevant emitter functions can be called directly.

The last point above is actually a CQ issue - we always generate `add [reg], imm`, more complex address modes are not used. Unfortunately this problem starts early, when the importer spills the address to a local variable. If that ever gets fixed then we'll could probably generate a contained LEA in lowering.

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

6 years agoFixed a couple of comments on TimeSpan.SecondsPerTick and Thread.SleepInternal (dotne...
Alfred Myers [Mon, 4 Jun 2018 18:01:50 +0000 (15:01 -0300)]
Fixed a couple of comments on TimeSpan.SecondsPerTick and Thread.SleepInternal (dotnet/coreclr#18276)

* Fixed comment for TimeSpan.SecondsPerTick

* Fixed comment on Thread.SleepInternal

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

6 years agoOptimise HtmlEncode to produce less garbage
Benjamin Hodgson [Mon, 19 Feb 2018 14:20:05 +0000 (14:20 +0000)]
Optimise HtmlEncode to produce less garbage

do the same optimisation for HtmlDecode

remove now-unneeded reference

Add tests for new ValueStringBuilder methods

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

6 years agoFlow EventSources to EventPipe on Windows (dotnet/coreclr#18217)
Brian Robbins [Mon, 4 Jun 2018 17:26:53 +0000 (10:26 -0700)]
Flow EventSources to EventPipe on Windows (dotnet/coreclr#18217)

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

6 years agoWork in VM towards cross-bitness crossgen (dotnet/coreclr#18245)
Egor Chesakov [Mon, 4 Jun 2018 17:08:22 +0000 (10:08 -0700)]
Work in VM towards cross-bitness crossgen (dotnet/coreclr#18245)

* Replace sizeof expressions with target-specific constants:

* sizeof(ObjHeader) -> OBJHEADER_SIZE
* sizeof(Object) -> OBJECT_SIZE
* ObjSizeOf(Object) -> OBJECT_BASESIZE
* sizeof(ArrayBase) -> ARRAYBASE_SIZE
* ObjSizeOf(ArrayBase) -> ARRAYBASE_BASESIZE

* Remove ObjSizeOf macro

* Use OBJECT_SIZE in ArrayBase::GetBoundsOffset

* Cast ppObj to CORCOMPILE_GCREFMAP_TOKENS* before dereferencing in FakePromote

* LOG2_PTRSIZE should depend on _TARGET_64BIT_

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

6 years agoFix error during compilation with /permissive- (dotnet/coreclr#18272)
Andrey Kurdyumov [Mon, 4 Jun 2018 16:24:37 +0000 (22:24 +0600)]
Fix error during compilation with /permissive- (dotnet/coreclr#18272)

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

6 years agoBe more aggressive with Partial NGen (dotnet/coreclr#18240)
Michelle McDaniel [Mon, 4 Jun 2018 16:06:09 +0000 (09:06 -0700)]
Be more aggressive with Partial NGen (dotnet/coreclr#18240)

* Be more aggressive with partial ngen

In partial ngen, we only compile those methods that both have profile
data and have the ReadMethodCode flag set in the profile flags. That
means that we miss some functions that do have counts, which affects the
performance of assemblies crossgened with partial ngen. This change
makes partial ngen more aggressive by, in the cold path, first checking
to see if we already considered this method in the hot section, which
means that it has profile data, and only rejecting those methods that
were not already considered.

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

6 years agoMerge pull request dotnet/coreclr#18264 from luqunl/18192
Carol Eidt [Mon, 4 Jun 2018 15:27:39 +0000 (08:27 -0700)]
Merge pull request dotnet/coreclr#18264 from luqunl/18192

Set GTF_RELOP_QMARK in gtNewQmarkNode

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

6 years agoFix build break (dotnet/coreclr#18278) (dotnet/coreclr#18279)
Russ Keldorph [Mon, 4 Jun 2018 15:11:18 +0000 (08:11 -0700)]
Fix build break (dotnet/coreclr#18278) (dotnet/coreclr#18279)

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

6 years agoDelete unused file (dotnet/coreclr#18271)
Jan Kotas [Mon, 4 Jun 2018 05:12:21 +0000 (22:12 -0700)]
Delete unused file (dotnet/coreclr#18271)

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

6 years agoTypo (dotnet/coreclr#18266)
John Doe [Sun, 3 Jun 2018 22:07:51 +0000 (15:07 -0700)]
Typo (dotnet/coreclr#18266)

* addres -> address

* depedant -> dependent

* gaurantee -> guarantee

* gaurantees -> guarantees

* lable -> label

* lazieness -> laziness

* lcoation -> location

* enquing -> enqueuing

* enregsitered -> enregistered

* ensurin -> ensuring

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

6 years agoWarnings cleanup (dotnet/coreclr#18260)
Robin Sue [Sun, 3 Jun 2018 18:12:26 +0000 (20:12 +0200)]
Warnings cleanup (dotnet/coreclr#18260)

* Cleanup all disabled warnings that do not trigger

* Fix warning about line continuation in single line comment

* Eliminiate all unreferenced local variables and reenable warning

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

6 years agoSet GTF_RELOP_QMARK in gtNewQmarkNode
luqunl [Sun, 3 Jun 2018 16:51:50 +0000 (09:51 -0700)]
Set GTF_RELOP_QMARK in gtNewQmarkNode

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

6 years agoTypo (dotnet/coreclr#18261)
John Doe [Sun, 3 Jun 2018 02:03:47 +0000 (19:03 -0700)]
Typo (dotnet/coreclr#18261)

* accomodate -> accommodate

* accross -> across

* adddress -> address

* bookeeping -> bookkeeping

* arbitary -> arbitrary

* calulating -> calculating

* fromClas -> fromClass

* comand -> command

* comming -> coming

* comparisions -> comparisons

* configuiration -> configuration

* contraints -> constraints

* datastructures -> data structures

* defintely -> definitely

* defered -> deferred

* diassemble -> disassemble

* Emptry -> Empty

* everytime -> every time

* fragmetation -> fragmentation

* instaces -> instances

* interpretting -> interpreting

* intialize -> initialize

* loction -> location

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

6 years agoTry to fix issues with Unicode on big endian OSes (dotnet/coreclr#18254)
Calvin [Sun, 3 Jun 2018 02:03:12 +0000 (23:03 -0300)]
Try to fix issues with Unicode on big endian OSes (dotnet/coreclr#18254)

Mono had some patches in their fork of referencesource to resolve
issues on big endian. Essentially, compile-time endianness handling
is no good for big endian platforms, because they have to consume a
Monolite intended for all platforms in order to bootstrap. So then,
all big endian platforms are now consuming a bootstrap tarball made
on little endian systems, and bad things happen as a result.

This makes it so that endianness is checked at runtime by using
System.BitConverter.IsLittleEndian, not by a compiler definition.

This integrates mono/mono@1f9b218 and mono/mono@92cec46, which won't
apply cleanly to current CoreFX.

mono/monodotnet/coreclr#8679 may get fixed by this, but as the comments say,
there could be more patches missing. This just integrates the
patches known to me on UnicodeEncoding and UTF8Encoding.

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

6 years agoCleanup and remove unused parameters from genCreateAddrMode (dotnet/coreclr#18258)
Robin Sue [Sat, 2 Jun 2018 22:40:54 +0000 (00:40 +0200)]
Cleanup and remove unused parameters from genCreateAddrMode (dotnet/coreclr#18258)

* Cleanup and remove unused parameters from genCreateAddrMode, fixes dotnet/coreclr#18177

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

6 years agoEnable tailcall_v4\smallFrame\smallFrame (dotnet/coreclr#18246)
Sergey Andreenko [Sat, 2 Jun 2018 22:40:13 +0000 (15:40 -0700)]
Enable tailcall_v4\smallFrame\smallFrame (dotnet/coreclr#18246)

* the bad il was removed

PR dotnet/coreclr#11316  removed the bad IL sequences from this test.

* reenable for linux

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

6 years agoMerge BCryptGenRandom.cs (dotnet/coreclr#18233)
Marco Rossignoli [Sat, 2 Jun 2018 21:57:59 +0000 (23:57 +0200)]
Merge BCryptGenRandom.cs (dotnet/coreclr#18233)

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

6 years agoFixing some flags that were queried incorrectly.
Tanner Gooding [Sat, 2 Jun 2018 19:15:26 +0000 (12:15 -0700)]
Fixing some flags that were queried incorrectly.

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

6 years agoApplying the formatting patch.
Tanner Gooding [Sat, 2 Jun 2018 18:34:14 +0000 (11:34 -0700)]
Applying the formatting patch.

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

6 years agoUpdating the x86 HWIntrinsics to query flags via explicit methods.
Tanner Gooding [Sat, 2 Jun 2018 18:19:57 +0000 (11:19 -0700)]
Updating the x86 HWIntrinsics to query flags via explicit methods.

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

6 years agoMoving more methods to be static methods on HWIntrinsicInfo
Tanner Gooding [Sat, 2 Jun 2018 17:44:17 +0000 (10:44 -0700)]
Moving more methods to be static methods on HWIntrinsicInfo

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

6 years agoMoving the simdSizeOfHWIntrinsic and numArgsOfHWIntrinsic methods to be static method...
Tanner Gooding [Sat, 2 Jun 2018 16:49:04 +0000 (09:49 -0700)]
Moving the simdSizeOfHWIntrinsic and numArgsOfHWIntrinsic methods to be static methods on HWIntrinsicInfo

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

6 years agoMoving various x86 HWIntrinsicInfo lookup methods to be static methods on HWIntrinsicInfo
Tanner Gooding [Sat, 2 Jun 2018 16:29:47 +0000 (09:29 -0700)]
Moving various x86 HWIntrinsicInfo lookup methods to be static methods on HWIntrinsicInfo

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

6 years agoMoving the x86 lookupHWIntrinsic and lookupHWIntrinsicISA methods to be static method...
Tanner Gooding [Sat, 2 Jun 2018 16:07:31 +0000 (09:07 -0700)]
Moving the x86 lookupHWIntrinsic and lookupHWIntrinsicISA methods to be static methods on HWIntrinsicInfo

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

6 years agoMoving the getHWIntrinsicInfo and getHWIntrinsicName methods to be static methods...
Tanner Gooding [Sat, 2 Jun 2018 15:29:36 +0000 (08:29 -0700)]
Moving the getHWIntrinsicInfo and getHWIntrinsicName methods to be static methods on HWIntrinsicInfo

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

6 years agoMoving the xarch HWIntrtinsicInfo type into its own header file.
Tanner Gooding [Sat, 2 Jun 2018 15:02:29 +0000 (08:02 -0700)]
Moving the xarch HWIntrtinsicInfo type into its own header file.

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

6 years agoJIT: Eliminate RegTracker (dotnet/coreclr#18179) (dotnet/coreclr#18230)
Andrew Au [Sat, 2 Jun 2018 19:49:28 +0000 (12:49 -0700)]
JIT: Eliminate RegTracker (dotnet/coreclr#18179) (dotnet/coreclr#18230)

* Replace regTracker.rsTrackRegTrash with regSet.verifyRegUsed

* Replace regTracker.rsTrackRegCopy with regSet.verifyRegUsed

* Replace regTracker.rsTrackRegIntCns with regSet.verifyRegUsed

* Replace regTracker.rsTrashRegSet with regSet.verifyRegistersUsed

* Move verifyReg* method implementation from header file to implementation file

* Replace regTracker.rsTrackRegLclVar with regSet.verifyRegistersUsed

* Eliminate RegTracker

* Fixed the funclet prolog special case

* Experiment - Changing the verification code to actually set the mask

* Adding function headers

* Removed a few trailing spaces

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

6 years agoImplement corefx/dotnet/coreclr#16619 Add FormattableString.CurrentCulture (dotnet...
Mikhail Shilkov [Sat, 2 Jun 2018 17:34:04 +0000 (19:34 +0200)]
Implement corefx/dotnet/coreclr#16619 Add FormattableString.CurrentCulture (dotnet/coreclr#18253)

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

6 years agoEnable Alpine cross build for arm and arm64 (dotnet/coreclr#18234)
Jan Vorlicek [Sat, 2 Jun 2018 08:23:10 +0000 (10:23 +0200)]
Enable Alpine cross build for arm and arm64 (dotnet/coreclr#18234)

* Enable Alpine cross build for arm and arm64

This change enables cross build and rootfs creation for
Alpine Linux ARM / ARM64 targets.

Besides that, I've cleaned up the toolchain.cmake and got rid
of the explicit specification of GCC version specific include
and lib folders for all targets except of Tizen. Clang is able
to figure that out on its own the same way as it does when doing
regular non-cross builds, but it needed one more option for that.

I've also fixed a bug in the `add_compile_param` macro that caused
ignoring of parameters in cases where another parameter that was
a substring of the one being added was already present. So for example
if an option `-L${CMAKE_SYSROOT}/usr/lib/gcc` was already added,
attempt to add option `-L${CMAKE_SYSROOT}/usr/lib` would do nothing.

* Fix to  make it work with cmake 2.8 too

The older cmake that is still in use on Ubuntu 14.04 doesn't have
support for specifying sysroot and target via cmake variables.
So I've replaced those by explicit setting of the compiler / linker
options instead.

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

6 years agoJIT: fix issue with zero-length stackalloc (dotnet/coreclr#18183)
Andy Ayers [Sat, 2 Jun 2018 07:25:23 +0000 (00:25 -0700)]
JIT: fix issue with zero-length stackalloc (dotnet/coreclr#18183)

Defer calling `setNeedsGSSecurityCookie` until we know for sure that
the jit won't do the zero-length stackalloc optimization.

Closes dotnet/coreclr#18176.

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

6 years agoAdding more NoContainment flags to the x86 hwintrinsic list
Tanner Gooding [Fri, 1 Jun 2018 15:59:23 +0000 (08:59 -0700)]
Adding more NoContainment flags to the x86 hwintrinsic list

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

6 years agoUpdating the x86 hwintrinsic code to better check for containment support.
Tanner Gooding [Fri, 1 Jun 2018 15:47:52 +0000 (08:47 -0700)]
Updating the x86 hwintrinsic code to better check for containment support.

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

6 years agoReduce race risk in MutexWaitOne2::PosTest4() (dotnet/coreclr#18195)
Steve MacLean [Sat, 2 Jun 2018 02:04:39 +0000 (22:04 -0400)]
Reduce race risk in MutexWaitOne2::PosTest4() (dotnet/coreclr#18195)

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

6 years agoMerge pull request dotnet/coreclr#18059 from helloguo/fix18039
Carol Eidt [Fri, 1 Jun 2018 23:56:59 +0000 (16:56 -0700)]
Merge pull request dotnet/coreclr#18059 from helloguo/fix18039

Fix issue18039: Add SSE2 intrinsic MoveScalar for type long and ulong

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

6 years ago[arm64] Disable `a % b = a & (b - 1);` optimization. (dotnet/coreclr#18206)
Sergey Andreenko [Fri, 1 Jun 2018 23:19:18 +0000 (16:19 -0700)]
[arm64] Disable `a % b = a & (b - 1);` optimization. (dotnet/coreclr#18206)

* Disable `a % b = a & (b - 1);` optimization on arm64

Morph can't relay on Lower optimization that it can't guarantee.

* improve checks in lower

We do not expect MOD/UMOD for integer/long types in lower for arm64.

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

6 years agoUpdating the HWIntrinsic codegen to ensure ival always fits in a byte.
Tanner Gooding [Fri, 1 Jun 2018 14:08:02 +0000 (07:08 -0700)]
Updating the HWIntrinsic codegen to ensure ival always fits in a byte.

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

6 years agoFix CoreRT build breaks in Stream moved to shared
Jan Kotas [Fri, 1 Jun 2018 15:59:27 +0000 (08:59 -0700)]
Fix CoreRT build breaks in Stream moved to shared

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

6 years agoAdded disassembler CoreDisTools to dump runtime functions (dotnet/coreclr#18180)
Amy [Fri, 1 Jun 2018 20:44:28 +0000 (13:44 -0700)]
Added disassembler CoreDisTools to dump runtime functions (dotnet/coreclr#18180)

Remove obsolete targets

Remove unused NewDiffer function, fix error with uninitialized declaringTypeHandle

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

6 years agorebase
helloguo [Fri, 1 Jun 2018 20:06:24 +0000 (13:06 -0700)]
rebase

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

6 years agofix SSE2 intrinsic MoveScalar for type long and ulong
helloguo [Sat, 19 May 2018 00:25:39 +0000 (17:25 -0700)]
fix SSE2 intrinsic MoveScalar for type long and ulong

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

6 years agoNative lib relative path (dotnet/coreclr#18239)
Aaron Robinson [Fri, 1 Jun 2018 19:16:03 +0000 (12:16 -0700)]
Native lib relative path (dotnet/coreclr#18239)

* Typo in #define

* Don't add prefix for relative path to native images if the path contains a platform path delimiter

* Use already defined delimiter macro
Create max variation count variable

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

6 years agoFix GitHub_16041 test. (dotnet/coreclr#18210)
Sergey Andreenko [Fri, 1 Jun 2018 18:08:33 +0000 (11:08 -0700)]
Fix GitHub_16041 test. (dotnet/coreclr#18210)

* fix StructY size

This was doing a cpblk of 28 bytes (size of StructY) from StructX, but StructX was only 12 bytes big. Change StructY to 12.

* fix size

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

6 years agoMark JIT/Regression/JitBlue/GitHub_18056 as JitOptimizationSensitive (dotnet/coreclr...
Egor Chesakov [Fri, 1 Jun 2018 17:59:22 +0000 (10:59 -0700)]
Mark JIT/Regression/JitBlue/GitHub_18056 as JitOptimizationSensitive (dotnet/coreclr#18184)

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

6 years agoR2RDump - Commandline interface (dotnet/coreclr#18136)
Amy [Fri, 1 Jun 2018 15:05:44 +0000 (08:05 -0700)]
R2RDump - Commandline interface (dotnet/coreclr#18136)

* Use ReadCompressedData for NativeHashTable, fix ref signature types, save array dimension, use AppendLine to avoid line-ending problems

* Include System.CommandLine, arg parsing, read/write file

* Add commandline options to search sections/methods/runtimeFunctions, option to dump raw data

* Added comments, save cli options in global variables, renamed some functions

* Add DumpByte function to R2RSection and R2RHeader, indent raw bytes

* Change some cli option names, use DumpRuntimeFunction, return list of query matches, changes to ArgStringToInt

* Move DumpBytes to R2RDump, print method of runtime function

* Use writer object instead of Console

* Use TextWriter instead of own writer class

* Handle jagged arrays and other cases using MethodDefinition.DecodeSignature with a slightly modified DisassemblingTypeProvider

* Close the _writer in finally block

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

6 years agoMerge pull request dotnet/coreclr#18216 from vancem/FixThreadNameSet
Vance Morrison [Fri, 1 Jun 2018 14:53:12 +0000 (07:53 -0700)]
Merge pull request dotnet/coreclr#18216 from vancem/FixThreadNameSet

Fix Managed Thread Name Setting

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

6 years agoMoves Stream to shared location (dotnet/coreclr#18142)
Marek Safar [Fri, 1 Jun 2018 03:57:00 +0000 (05:57 +0200)]
Moves Stream to shared location (dotnet/coreclr#18142)

* Moves Stream to shared location

* Review tweaks

* Add NotImplementedException for SyncStream due to https://github.com/dotnet/corert/issues/3251

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

6 years agoFix SpanHelpers.ClearWithoutReferences alignment detection (dotnet/coreclr#18222)
Pent Ploompuu [Fri, 1 Jun 2018 03:02:45 +0000 (06:02 +0300)]
Fix SpanHelpers.ClearWithoutReferences alignment detection (dotnet/coreclr#18222)

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

6 years agoReview feedback
Vance Morrison [Fri, 1 Jun 2018 00:39:58 +0000 (17:39 -0700)]
Review feedback

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

6 years agoMerge pull request dotnet/coreclr#18220 from sdmaclea/PR-HasPendingGCStressInstructio...
Bruce Forstall [Fri, 1 Jun 2018 00:07:34 +0000 (17:07 -0700)]
Merge pull request dotnet/coreclr#18220 from sdmaclea/PR-HasPendingGCStressInstructionUpdate

Fix HasPendingGCStressInstructionUpdate CONSISTENCY_CHECK

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

6 years agoArm stepping fixes (dotnet/coreclr#18129)
Chris Sienkiewicz [Fri, 1 Jun 2018 00:04:59 +0000 (17:04 -0700)]
Arm stepping fixes (dotnet/coreclr#18129)

* Ensure thumb bit is set when initializing a code region.
* Use macro rather than manually setting thumb bit in debugger.cpp
* Ensure thumb bit is set when calling FindOrCreateInitAndAddJitInfo.
* Add an assert to FindOrCreateInitAndAddJitInfo when on arm to ensure the thumb bit is set

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

6 years agoAdd additional features to SOS DumpAsync command (dotnet/coreclr#18213)
Stephen Toub [Thu, 31 May 2018 21:09:41 +0000 (17:09 -0400)]
Add additional features to SOS DumpAsync command (dotnet/coreclr#18213)

1. Computing GC roots is a relatively slow operation, and doing it for every state machine object found in a large heap can be time consuming.  Making it opt-in with -roots command-line flag.

2. Added -waiting command-line flag.  DumpAsync will now retrieve the <>1__state field from the StateMachine, and if -waiting is specified, it'll filter down to state machines that have a state value >= 0, meaning the state machines are waiting at an await point.  For example, given this program:
```C#
using System.Threading.Tasks;
class Program
{
    static async Task Main() { await MethodA(0); await MethodA(int.MaxValue); }
    static async Task MethodA(int delay) => await MethodB(delay);
    static async Task MethodB(int delay) { await Task.Yield(); await Task.Delay(delay); }
}
```
using `!DumpAsync` outputs:
```
         Address               MT     Size Name
dotnet/coreclr#0
0000026848693438 00007ff88ea35e58      120  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodB>d__2, test]]
StateMachine: Program+<MethodB>d__2 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000008        0         System.Int32  1 instance               -2 <>1__state
00007ff8e9bd82f8  4000009        8 ...TaskMethodBuilder  1 instance 0000026848693490 <>t__builder
00007ff8e9bc4bc0  400000a        4         System.Int32  1 instance                0 delay
00007ff8e9bee4d0  400000b       10 ...able+YieldAwaiter  1 instance 0000026848693498 <>u__1
00007ff8e9bcead0  400000c       18 ...vices.TaskAwaiter  1 instance 00000268486934a0 <>u__2
Continuation: 00000268486934b0 (System.Object)

dotnet/coreclr#1
0000026848693e68 00007ff88ea36cc8      112  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodA>d__1, test]]
StateMachine: Program+<MethodA>d__1 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000004        0         System.Int32  1 instance               -2 <>1__state
00007ff8e9bd82f8  4000005        8 ...TaskMethodBuilder  1 instance 0000026848693ec0 <>t__builder
00007ff8e9bc4bc0  4000006        4         System.Int32  1 instance                0 delay
00007ff8e9bcead0  4000007       10 ...vices.TaskAwaiter  1 instance 0000026848693ec8 <>u__1
Continuation: 00000268486934b0 (System.Object)

dotnet/coreclr#2
0000026848693ed8 00007ff88ea37188      112  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<Main>d__0, test]]
StateMachine: Program+<Main>d__0 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000001        0         System.Int32  1 instance                1 <>1__state
00007ff8e9bd82f8  4000002        8 ...TaskMethodBuilder  1 instance 0000026848693f30 <>t__builder
00007ff8e9bcead0  4000003       10 ...vices.TaskAwaiter  1 instance 0000026848693f38 <>u__1
Continuation: 0000026848693f48 (System.Threading.Tasks.Task+SetOnInvokeMres)

dotnet/coreclr#3
0000026848695d30 00007ff88ea35e58      120  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodB>d__2, test]]
StateMachine: Program+<MethodB>d__2 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000008        0         System.Int32  1 instance                1 <>1__state
00007ff8e9bd82f8  4000009        8 ...TaskMethodBuilder  1 instance 0000026848695d88 <>t__builder
00007ff8e9bc4bc0  400000a        4         System.Int32  1 instance       2147483647 delay
00007ff8e9bee4d0  400000b       10 ...able+YieldAwaiter  1 instance 0000026848695d90 <>u__1
00007ff8e9bcead0  400000c       18 ...vices.TaskAwaiter  1 instance 0000026848695d98 <>u__2
Continuation: 0000026848695dd0 (System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodA>d__1, test]])

dotnet/coreclr#4
0000026848695dd0 00007ff88ea36cc8      112  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodA>d__1, test]]
StateMachine: Program+<MethodA>d__1 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000004        0         System.Int32  1 instance                0 <>1__state
00007ff8e9bd82f8  4000005        8 ...TaskMethodBuilder  1 instance 0000026848695e28 <>t__builder
00007ff8e9bc4bc0  4000006        4         System.Int32  1 instance       2147483647 delay
00007ff8e9bcead0  4000007       10 ...vices.TaskAwaiter  1 instance 0000026848695e30 <>u__1
Continuation: 0000026848693ed8 (System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<Main>d__0, test]])

Found 5 state machines.
```
while using `!DumpAsync -waiting` outputs only:
```
         Address               MT     Size Name
dotnet/coreclr#0
0000026848693ed8 00007ff88ea37188      112  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<Main>d__0, test]]
StateMachine: Program+<Main>d__0 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000001        0         System.Int32  1 instance                1 <>1__state
00007ff8e9bd82f8  4000002        8 ...TaskMethodBuilder  1 instance 0000026848693f30 <>t__builder
00007ff8e9bcead0  4000003       10 ...vices.TaskAwaiter  1 instance 0000026848693f38 <>u__1
Continuation: 0000026848693f48 (System.Threading.Tasks.Task+SetOnInvokeMres)

dotnet/coreclr#1
0000026848695d30 00007ff88ea35e58      120  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodB>d__2, test]]
StateMachine: Program+<MethodB>d__2 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000008        0         System.Int32  1 instance                1 <>1__state
00007ff8e9bd82f8  4000009        8 ...TaskMethodBuilder  1 instance 0000026848695d88 <>t__builder
00007ff8e9bc4bc0  400000a        4         System.Int32  1 instance       2147483647 delay
00007ff8e9bee4d0  400000b       10 ...able+YieldAwaiter  1 instance 0000026848695d90 <>u__1
00007ff8e9bcead0  400000c       18 ...vices.TaskAwaiter  1 instance 0000026848695d98 <>u__2
Continuation: 0000026848695dd0 (System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodA>d__1, test]])

dotnet/coreclr#2
0000026848695dd0 00007ff88ea36cc8      112  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodA>d__1, test]]
StateMachine: Program+<MethodA>d__1 (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000004        0         System.Int32  1 instance                0 <>1__state
00007ff8e9bd82f8  4000005        8 ...TaskMethodBuilder  1 instance 0000026848695e28 <>t__builder
00007ff8e9bc4bc0  4000006        4         System.Int32  1 instance       2147483647 delay
00007ff8e9bcead0  4000007       10 ...vices.TaskAwaiter  1 instance 0000026848695e30 <>u__1
Continuation: 0000026848693ed8 (System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<Main>d__0, test]])

Found 3 state machines.
```
skipping the two state machines that have a `<>1__state` field value of -2 (meaning it's completed).  Note that this change has the somewhat unfortunate impact of taking a dependency on what's effectively an implementation detail of Roslyn, but the value the filtering provides is deemed to be worth it.  This design is unlikely to change in the future, and as with other diagnostic/debugging features that rely on such details, it can be updated if Roslyn ever changes its scheme.  In the meantime, the code will output a warning message if it can't find the state field.

3. If a state machine is found to have 0 roots but also to have a <>1__state value >= 0, that suggests it was dropped without having been completed, which is likely a sign of an application bug.  The command now prints out an information message to highlight that state.  For example, this program:
```C#
using System;
using System.Threading.Tasks;
class Program
{
    static void Main()
    {
        Task.Run(async () => await new TaskCompletionSource<bool>().Task);
        Console.ReadLine();
    }
}
```
when processed with `!DumpAsync -roots` results in:
```
         Address               MT     Size Name
dotnet/coreclr#0
0000020787fb5b30 00007ff88ea1afe8      112  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Boolean, System.Private.CoreLib],[Program+<>c+<<Main>b__0_0>d, test]]
StateMachine: Program+<>c+<<Main>b__0_0>d (struct)
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8e9bc4bc0  4000003        0         System.Int32  1 instance                0 <>1__state
00007ff8e9bd0b88  4000004        8 ...Private.CoreLib]]  1 instance 0000020787fb5b88 <>t__builder
00007ff8e9bffd58  4000005       10 ...Private.CoreLib]]  1 instance 0000020787fb5b90 <>u__1
Continuation: 0000020787fb3fc8 (System.Threading.Tasks.UnwrapPromise`1[[System.Boolean, System.Private.CoreLib]])
GC roots:
Incomplete state machine (<>1__state == 0) with 0 roots.

Found 1 state machines.
```

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

6 years agoReview feedback
Vance Morrison [Thu, 31 May 2018 21:09:06 +0000 (14:09 -0700)]
Review feedback

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

6 years agoFix number formatting exception with empty NumberGroupSizes array (dotnet/coreclr...
Stephen Toub [Thu, 31 May 2018 21:08:55 +0000 (17:08 -0400)]
Fix number formatting exception with empty NumberGroupSizes array (dotnet/coreclr#18221)

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

6 years ago[Arm64] Implement genZeroInitFltRegs for float (dotnet/coreclr#18200)
Steve MacLean [Thu, 31 May 2018 20:58:03 +0000 (16:58 -0400)]
[Arm64] Implement genZeroInitFltRegs for float (dotnet/coreclr#18200)

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

6 years agoReview feedback
Vance Morrison [Thu, 31 May 2018 20:55:27 +0000 (13:55 -0700)]
Review feedback

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

6 years agoReview feedback
Vance Morrison [Thu, 31 May 2018 20:54:26 +0000 (13:54 -0700)]
Review feedback

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

6 years agoFixed misspelling
Vance Morrison [Thu, 31 May 2018 20:25:21 +0000 (13:25 -0700)]
Fixed misspelling

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

6 years agoReview feedback (avoid passing out unpinned managed pointers).
Vance Morrison [Thu, 31 May 2018 19:51:31 +0000 (12:51 -0700)]
Review feedback (avoid passing out unpinned managed pointers).

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

6 years agoAdd test case for optimized box vector assert (dotnet/coreclr#18163)
Andy Ayers [Thu, 31 May 2018 19:25:22 +0000 (12:25 -0700)]
Add test case for optimized box vector assert (dotnet/coreclr#18163)

Test case for issue dotnet/coreclr#18043 was left out of dotnet/coreclr#18046. Adding it now.

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

6 years agoMerge pull request dotnet/coreclr#18191 from BruceForstall/RemoveUnusedDefines
Bruce Forstall [Thu, 31 May 2018 19:21:36 +0000 (12:21 -0700)]
Merge pull request dotnet/coreclr#18191 from BruceForstall/RemoveUnusedDefines

Remove unused defines

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

6 years agoSupport new Japanese calendar eras (dotnet/coreclr#18209)
Tarek Mahmoud Sayed [Thu, 31 May 2018 17:31:11 +0000 (10:31 -0700)]
Support new Japanese calendar eras (dotnet/coreclr#18209)

Japan is going to introduce the new era next year 2019, this new era will be added to the Japanese calendar. This new era would affect anyone converting, formatting or parsing dates using the Japanese calendar.
Users who formatted future dates before introducing the new era and then try to parse these dates after introducing the new era will fail and get parsing exception. The reason is the year number will not be valid in the old era anymore because the new era set a year limit to the old era.

Here is an example:

Format a date like "平成 32年2月1日" which saying year 32 in the era "平成". after we introduce the new era, the old era "平成" will be limited up to and including year 31 so year 32 is exceeding the era end.

The fix is to allow the parser succeeds with such dates and have a config switch which can be used to for anyone want the old behavior.

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

6 years agoFix HasPendingGCStressInstructionUpdate CONSISTENCY_CHECK
Steve MacLean [Thu, 31 May 2018 16:50:12 +0000 (12:50 -0400)]
Fix HasPendingGCStressInstructionUpdate CONSISTENCY_CHECK

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

6 years agoMoving MissingFieldException (fully) and MissingMethodException (partially) to shared...
Maryam Ariyan [Thu, 31 May 2018 02:55:47 +0000 (19:55 -0700)]
Moving MissingFieldException (fully) and MissingMethodException (partially) to shared (dotnet/coreclr#18207)

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

6 years agoExpose Exception.set_HResult as Public (dotnet/coreclr#18203)
Luqun Lou [Thu, 31 May 2018 02:37:50 +0000 (19:37 -0700)]
Expose Exception.set_HResult as Public (dotnet/coreclr#18203)

* Expose Exception.set_HResult as Public

* Remove internal Exception.SetErrorCode

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