platform/upstream/coreclr.git
6 years agoMerge pull request #13849 from stephentoub/string_create
Stephen Toub [Sun, 10 Sep 2017 03:25:18 +0000 (23:25 -0400)]
Merge pull request #13849 from stephentoub/string_create

Add String.Create span-based method

6 years agoMerge pull request #13888 from jkotas/corelib-mirror
Jan Kotas [Sun, 10 Sep 2017 01:48:20 +0000 (18:48 -0700)]
Merge pull request #13888 from jkotas/corelib-mirror

Mirror changes from dotnet/corert

6 years agoMerge pull request #13886 from ahsonkhan/SpanReadOnlyStruct
Stephen Toub [Sat, 9 Sep 2017 23:44:19 +0000 (19:44 -0400)]
Merge pull request #13886 from ahsonkhan/SpanReadOnlyStruct

Marking {ReadOnly}Span with IsReadOnly attribute

6 years agoFinish moving files to shared CoreLib partition
Jan Kotas [Sat, 9 Sep 2017 23:32:23 +0000 (16:32 -0700)]
Finish moving files to shared CoreLib partition

6 years agoMove PInvoke interop related attributes to shared CoreLib partition
Jan Kotas [Sat, 9 Sep 2017 22:51:05 +0000 (15:51 -0700)]
Move PInvoke interop related attributes to shared CoreLib partition

[tfs-changeset: 1673253]

6 years agoFinish moving files to shared partition
Jan Kotas [Sat, 9 Sep 2017 16:06:21 +0000 (09:06 -0700)]
Finish moving files to shared partition

6 years agoFix IntrinsicAttribute build break
Jan Kotas [Sat, 9 Sep 2017 11:57:48 +0000 (04:57 -0700)]
Fix IntrinsicAttribute build break

6 years agoEnable auto-update for PGO data (#13883)
Daniel Podder [Sat, 9 Sep 2017 19:33:18 +0000 (12:33 -0700)]
Enable auto-update for PGO data (#13883)

Move PgoDataPackageVersion into dependencies.props, which enables auto-update functionality.
Also, update optdata version to 20170908-1805.

6 years agoCleanup Guid formatting (#13885)
Jan Kotas [Sat, 9 Sep 2017 07:28:46 +0000 (00:28 -0700)]
Cleanup Guid formatting (#13885)

6 years agoMarking {ReadOnly}Span with IsReadOnly attribute.
ahsonkhan [Sat, 9 Sep 2017 05:23:16 +0000 (22:23 -0700)]
Marking {ReadOnly}Span with IsReadOnly attribute.

6 years agoMerge pull request #13842 from dotnet-bot/from-tfs
Pat Gavlin [Sat, 9 Sep 2017 04:18:07 +0000 (21:18 -0700)]
Merge pull request #13842 from dotnet-bot/from-tfs

Merge changes from TFS

6 years agoMerge pull request #13110 from pgavlin/SPMIJitOptions
Pat Gavlin [Sat, 9 Sep 2017 04:14:13 +0000 (21:14 -0700)]
Merge pull request #13110 from pgavlin/SPMIJitOptions

Add the capability to specify JIT options on the SPMI command line.

6 years agoGuid span-based APIs (ctor, TryWriteBytes, TryFormat) (#13323)
Stephanie Niu [Sat, 9 Sep 2017 02:58:35 +0000 (19:58 -0700)]
Guid span-based APIs (ctor, TryWriteBytes, TryFormat) (#13323)

* standardized style changes

* 3 span-ified guid methods

throw null exception for readonlyspan ctor

full changes

* restructured trywritebytes

* changed writebytehelper from feedback

* changed casing of switch statement

* indentation

6 years agoMerge pull request #13863 from pgavlin/DevDiv491211
Pat Gavlin [Sat, 9 Sep 2017 01:56:36 +0000 (18:56 -0700)]
Merge pull request #13863 from pgavlin/DevDiv491211

Properly update GTF_{ASG,EXCEPT} in call morphing.

6 years ago[Arm64] Optimize System.Buffer:Memmove (#13793)
Steve MacLean [Sat, 9 Sep 2017 01:41:42 +0000 (21:41 -0400)]
[Arm64] Optimize System.Buffer:Memmove (#13793)

* [Arm64] Optimize System.Buffer:Memmove

Enable HAS_BLOCKS

Disable code to fall back to native memmove until memmove
optimizations are merged to OS mainline

* Add links to issues

6 years agoMove files to shared partition (#13870)
Jan Kotas [Sat, 9 Sep 2017 01:16:01 +0000 (18:16 -0700)]
Move files to shared partition (#13870)

Moved pseudo-custom attribute reflection helpers from attribute definitions to reflection to prepare attribute definitions to be moved to shared partition.

6 years agoPort some concurrent collection implementations with latest fixes from CoreFX into...
Koundinya Veluri [Sat, 9 Sep 2017 00:14:09 +0000 (17:14 -0700)]
Port some concurrent collection implementations with latest fixes from CoreFX into CoreCLR copies (#12939)

6 years agoAdd a <clear /> to packageSources in src/NuGet.Config (#13874)
Daniel Podder [Fri, 8 Sep 2017 23:55:04 +0000 (16:55 -0700)]
Add a <clear /> to packageSources in src/NuGet.Config (#13874)

Fixes #13873

6 years agoMerge pull request #13845 from ViktorHofer/DBNull-Serialization
Viktor Hofer [Fri, 8 Sep 2017 22:10:51 +0000 (00:10 +0200)]
Merge pull request #13845 from ViktorHofer/DBNull-Serialization

Make DBNull serializable

6 years agoNon-shared changes
Jan Kotas [Fri, 8 Sep 2017 04:33:15 +0000 (21:33 -0700)]
Non-shared changes

6 years agoDelete redundant PInvokes
Jan Kotas [Sun, 3 Sep 2017 16:57:12 +0000 (09:57 -0700)]
Delete redundant PInvokes

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
6 years agoMove HResults to shared partition
Jan Kotas [Sun, 3 Sep 2017 16:40:43 +0000 (09:40 -0700)]
Move HResults to shared partition

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
6 years agoFix CoreLib build warnings (#13851)
Jan Kotas [Fri, 8 Sep 2017 22:04:56 +0000 (15:04 -0700)]
Fix CoreLib build warnings (#13851)

6 years agoChange lock used for initializing YieldProcessorNormalized from Crst to CrstStatic...
Koundinya Veluri [Fri, 8 Sep 2017 21:19:05 +0000 (14:19 -0700)]
Change lock used for initializing YieldProcessorNormalized from Crst to CrstStatic (#13857)

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

6 years agoAddress PR feedback.
Pat Gavlin [Fri, 8 Sep 2017 18:55:07 +0000 (11:55 -0700)]
Address PR feedback.

6 years agoOnly delete agent when not succesful (#13865)
Matt Mitchell [Fri, 8 Sep 2017 17:26:37 +0000 (10:26 -0700)]
Only delete agent when not succesful (#13865)

Spinup for this agent is unreliable (docker fails to start a lot).  Only delete when the build fails.

6 years agoProperly update GTF_{ASG,EXCEPT} in call morphing.
Pat Gavlin [Fri, 8 Sep 2017 17:19:18 +0000 (10:19 -0700)]
Properly update GTF_{ASG,EXCEPT} in call morphing.

The former is only necessary if it is set on any of the call's
arguments; the latter is necessary if the call may throw or if it is set
on any of the call's arguments.

Fixes DevDiv 491211.

6 years agoAdding serializable attribute to type
Viktor Hofer [Fri, 8 Sep 2017 16:35:23 +0000 (18:35 +0200)]
Adding serializable attribute to type

6 years agoPR feedback
Viktor Hofer [Fri, 8 Sep 2017 14:56:25 +0000 (16:56 +0200)]
PR feedback

6 years agoAdd String.Create span-based method
Stephen Toub [Fri, 8 Sep 2017 01:42:42 +0000 (21:42 -0400)]
Add String.Create span-based method

6 years agoFix EventProvider to build on Linux
Dan Moseley [Sat, 2 Sep 2017 07:47:53 +0000 (00:47 -0700)]
Fix EventProvider to build on Linux

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
6 years agoRemove unused params
Viktor Hofer [Thu, 7 Sep 2017 23:36:46 +0000 (01:36 +0200)]
Remove unused params

6 years agoAdd exception handling for other input and add comments
Viktor Hofer [Thu, 7 Sep 2017 23:25:51 +0000 (01:25 +0200)]
Add exception handling for other input and add comments

6 years agoAdd the capability to specify JIT options on the SPMI command line.
Pat Gavlin [Sat, 29 Jul 2017 22:42:39 +0000 (15:42 -0700)]
Add the capability to specify JIT options on the SPMI command line.

This change adds two new flags, `-jitoption` and `-jit2option`, to the
SuperPMI command line. These flags are cumulative, and are used to
specify JIT config options (e.g. `COMPlus_JitDisasm`, albeit without the
`COMPlus_` prefix) to the base and diff JITs, respectively.

This change also removes Smarty-specific code and support for capturing
and replaying environment variables. The former is no longer terribly
useful and the latter has been obviated by the JIT host interface.

6 years agoRevert access modifier change and update its comment
Viktor Hofer [Thu, 7 Sep 2017 23:12:19 +0000 (01:12 +0200)]
Revert access modifier change and update its comment

6 years agoMerge pull request #13838 from pgavlin/DevDiv489992
Pat Gavlin [Thu, 7 Sep 2017 23:04:55 +0000 (16:04 -0700)]
Merge pull request #13838 from pgavlin/DevDiv489992

Copy `GTF_{ASG,EXCEPT}` flags in `gtCloneExpr`.

6 years agoMore comments and remove of corert special case
Viktor Hofer [Thu, 7 Sep 2017 23:04:15 +0000 (01:04 +0200)]
More comments and remove of corert special case

6 years agoPR feedback
Viktor Hofer [Thu, 7 Sep 2017 23:01:50 +0000 (01:01 +0200)]
PR feedback

6 years agoMake dumpmd work with tiered jitting. Now displays previous code addresses (#13805)
David Mason [Thu, 7 Sep 2017 22:56:30 +0000 (15:56 -0700)]
Make dumpmd work with tiered jitting. Now displays previous code addresses (#13805)

* Make dumpmd work with tiered jitting. Now displays previous code addresses

* add tier info and nativecodeversionnode ptr to dumpmd output

* fix warnings on non-rejit platforms

6 years agoRetry linux arm legs on a new agent (#13839)
Karthik Rajasekaran [Thu, 7 Sep 2017 22:39:06 +0000 (15:39 -0700)]
Retry linux arm legs on a new agent (#13839)

6 years agoMake DBNull serializable
Viktor Hofer [Thu, 7 Sep 2017 21:57:22 +0000 (23:57 +0200)]
Make DBNull serializable

6 years agoMerge pull request #12334 from sdmaclea/PR-Optimize-Jit-WriteBarriers
Jarret Shook [Thu, 7 Sep 2017 21:34:20 +0000 (14:34 -0700)]
Merge pull request #12334 from sdmaclea/PR-Optimize-Jit-WriteBarriers

[Arm64] Optimize JIT_WriteBarriers

6 years agoNew jit intrinsic support (#13815)
Andy Ayers [Thu, 7 Sep 2017 21:28:07 +0000 (14:28 -0700)]
New jit intrinsic support (#13815)

Support for new-style intrinsics where corelib methods can have both IL
implementations and optional jit-supplied implementations.

Mark such methods with the [Intrinsic] attribute, then recognize the
intrinsic methods by name in the jit.

Jit currently has a placeholder for the Enum.HasFlag method.

6 years agoDesktop changes corresponding to https://github.com/dotnet/coreclr/pull/13815
Andy Ayers [Thu, 7 Sep 2017 21:26:46 +0000 (14:26 -0700)]
Desktop changes corresponding to https://github.com/dotnet/coreclr/pull/13815

The new jit interface method is stubbed out in desktop, as we will not see any of these new style intriniscs there (at least for now).

[tfs-changeset: 1673063]

6 years agoCopy `GTF_{ASG,EXCEPT}` flags in `gtCloneExpr`.
Pat Gavlin [Thu, 7 Sep 2017 19:47:42 +0000 (12:47 -0700)]
Copy `GTF_{ASG,EXCEPT}` flags in `gtCloneExpr`.

These flags from the source were being unioned with those of the copy,
which was incorrect in cases where the copy's flags were overly
conservative. This change simply copies the values of these flags from
the source.

Fixes VSO 489992.

6 years agoMerge pull request #13821 from pgavlin/DevDiv487701_487702
Pat Gavlin [Thu, 7 Sep 2017 19:30:51 +0000 (12:30 -0700)]
Merge pull request #13821 from pgavlin/DevDiv487701_487702

Fix VSO 487701 and 487702.

6 years agoSpelling and grammar corrections - A through L (#13683)
Brian Chavez [Thu, 7 Sep 2017 18:36:37 +0000 (11:36 -0700)]
Spelling and grammar corrections - A through L (#13683)

6 years agoMerge pull request #13817 from pgavlin/DevDiv487703
Pat Gavlin [Thu, 7 Sep 2017 18:33:59 +0000 (11:33 -0700)]
Merge pull request #13817 from pgavlin/DevDiv487703

Do not remove NOPs used by calls.

6 years agoUpdate CoreClr, CoreFx to preview2-25707-02, preview2-25707-02, respectively (#13808)
dotnet-maestro-bot [Thu, 7 Sep 2017 18:19:20 +0000 (11:19 -0700)]
Update CoreClr, CoreFx to preview2-25707-02, preview2-25707-02, respectively (#13808)

6 years agoFix for #13830 issue (#13831)
sergey ignatov [Thu, 7 Sep 2017 18:14:29 +0000 (21:14 +0300)]
Fix for #13830 issue (#13831)

6 years agoFix incorrect treatment of pointer as fixed (#13816)
Victor "Nate" Graf [Thu, 7 Sep 2017 15:55:21 +0000 (08:55 -0700)]
Fix incorrect treatment of pointer as fixed (#13816)

6 years agoMerge pull request #13797 from jashook/arm64_green_ci
Jarret Shook [Thu, 7 Sep 2017 02:47:52 +0000 (19:47 -0700)]
Merge pull request #13797 from jashook/arm64_green_ci

Disable tests based on 13796

6 years agoSegregate merged returns by constant value (#13792)
Joseph Tremoulet [Thu, 7 Sep 2017 01:14:19 +0000 (21:14 -0400)]
Segregate merged returns by constant value (#13792)

The JIT enforces a limit on the number of epilogs emitted in any given
method.  Change the logic so that when this merging kicks in, returns of
constant values are given merged return blocks distinct from each other
and from the general return block, as long as we can do so without going
over the limit.  This particularly helps avoid redundancy (while still
keeping method size down) in methods with a large number of constant
returns but only a few distinct constants, which is true of many
predicate methods with bool return type.

This is the compiler portion of #13466 and dotnet/corefx#23395.

6 years agoVendor the volatile.h header into src/gc/env for the standalone GC build (#13656)
Sean Gillespie [Wed, 6 Sep 2017 23:12:25 +0000 (16:12 -0700)]
Vendor the volatile.h header into src/gc/env for the standalone GC build (#13656)

* Vendor the volatile.h header into src/gc/env for the standalone GC build

* Repair the GC sample

* Remove some unneeded defines (fixes the sample build)

6 years agoFix VSO 487701 and 487702.
Pat Gavlin [Wed, 6 Sep 2017 22:51:22 +0000 (15:51 -0700)]
Fix VSO 487701 and 487702.

Both of these issues stem from attempting to unassign a copied interval
from the copied-to register and then reassigning the interval to the
same. This corrupts some of the bookkeeping necessary to track whether
or not the interval in the register needs to be spilled, and the RA ends
up attempting to spill the interval being allocated even though it is
not assigned a register.

6 years agoAdd tests for VSO 487701 and 487702.
Pat Gavlin [Wed, 6 Sep 2017 22:49:27 +0000 (15:49 -0700)]
Add tests for VSO 487701 and 487702.

6 years agoAdd a regression test.
Pat Gavlin [Wed, 6 Sep 2017 21:34:48 +0000 (14:34 -0700)]
Add a regression test.

6 years agoDo not remove NOPs used by calls.
Pat Gavlin [Wed, 6 Sep 2017 19:48:51 +0000 (12:48 -0700)]
Do not remove NOPs used by calls.

Instead of removing dead stores that are marked as late args, we replace
them with NOPs. This obviates the need to update the call's argument
table, but requires that the NOP itself not be DCE'd. This change marks
these NOPs with the `ORDER_SIDEEFF` flag s.t. DCE will not remove them.

Fixes VSO 487703.

6 years agoFix DevDiv_278523 test for r2r x86. (#13709)
Sergey Andreenko [Wed, 6 Sep 2017 19:38:58 +0000 (12:38 -0700)]
Fix DevDiv_278523 test for r2r x86. (#13709)

* separate sources into 2 files: for 32 and for 64.

6 years agoRestore Array.Empty
danmosemsft [Sat, 2 Sep 2017 00:55:10 +0000 (17:55 -0700)]
Restore Array.Empty

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
6 years agoMerge pull request #13811 from jashook/fix_xarch_warning
Jarret Shook [Wed, 6 Sep 2017 18:16:57 +0000 (11:16 -0700)]
Merge pull request #13811 from jashook/fix_xarch_warning

Fix potentially uninitialized local variable 'regCount'

6 years agoJit doesn't reload shift index if it was spilled to rcx. (#13757)
Sergey Andreenko [Wed, 6 Sep 2017 18:00:18 +0000 (11:00 -0700)]
Jit doesn't reload shift index if it was spilled to rcx. (#13757)

Repro test. Fix and additional assert.

6 years agoMerge pull request #13659 from mikedn/cast-actual-type
Pat Gavlin [Wed, 6 Sep 2017 17:28:50 +0000 (10:28 -0700)]
Merge pull request #13659 from mikedn/cast-actual-type

Fix getCastDescription to use the actual source type

6 years agoMerge pull request #13800 from adiaaida/addnopgoPerf
Michelle McDaniel [Wed, 6 Sep 2017 16:36:58 +0000 (09:36 -0700)]
Merge pull request #13800 from adiaaida/addnopgoPerf

Add nopgo option for throughput runs

6 years agoFix potentially uninitialized local variable 'regCount'
jashook [Wed, 6 Sep 2017 16:26:22 +0000 (09:26 -0700)]
Fix potentially uninitialized local variable 'regCount'

6 years agoAdd Memory-based Stream overloads to coreclr (#13769)
Stephen Toub [Wed, 6 Sep 2017 15:48:01 +0000 (11:48 -0400)]
Add Memory-based Stream overloads to coreclr (#13769)

Includes adding the virtuals to Stream and then overriding on the various streams implemented in coreclr.

6 years agoRemoved renamed method. (#13803)
Adrian Godong [Wed, 6 Sep 2017 14:14:19 +0000 (07:14 -0700)]
Removed renamed method. (#13803)

6 years agoSupport for not wrapping exceptions with TargetInvocationException. (#13767)
Austin Wise [Wed, 6 Sep 2017 12:19:48 +0000 (05:19 -0700)]
Support for not wrapping exceptions with TargetInvocationException. (#13767)

* Support for not wrapping exceptions with TargetInvocationException.

For dotnet/corefx#22866.

* Respond to PR feedback.

Mainly by making "WrapExceptions" consistently positive in FCalls.

* Remove BindingFlags.DoNotWrapExceptions tests in deference to CoreFX tests.

6 years agoUpdate CoreClr, CoreFx to preview2-25706-01, preview2-25706-01, respectively (#13734)
dotnet-maestro-bot [Wed, 6 Sep 2017 04:53:24 +0000 (21:53 -0700)]
Update CoreClr, CoreFx to preview2-25706-01, preview2-25706-01, respectively (#13734)

6 years agoAdd nopgo option for throughput runs
Michelle McDaniel [Tue, 5 Sep 2017 22:34:10 +0000 (15:34 -0700)]
Add nopgo option for throughput runs

6 years agoFix for CoreRT issue https://github.com/dotnet/corert/issues/3672 (ar… (#13777)
sergey ignatov [Wed, 6 Sep 2017 01:37:55 +0000 (04:37 +0300)]
Fix for CoreRT issue https://github.com/dotnet/corert/issues/3672 (ar… (#13777)

* Fix for CoreRT issue https://github.com/dotnet/corert/issues/3672 (armel tizen)

* Added assertion for accessType

6 years agoimplementing profiler ELT callbacks for AMD64 Linux (#12603)
sergey ignatov [Wed, 6 Sep 2017 01:06:50 +0000 (04:06 +0300)]
implementing profiler ELT callbacks for AMD64 Linux (#12603)

* implement profiler ELT callbacks for AMD64 Linux

* Some formatting fixes

* Fixed profiler

* Added aligning frame option

* Added aligning stack for quad values stores

6 years agoMoving the Windows Performance runs from Server 2012 to Server 2016. (#13725)
José Rivero [Wed, 6 Sep 2017 00:38:54 +0000 (17:38 -0700)]
Moving the Windows Performance runs from Server 2012 to Server 2016. (#13725)

6 years agoAdd support for building under glibc 2.26 (#13785)
Omair Majid [Tue, 5 Sep 2017 23:22:55 +0000 (19:22 -0400)]
Add support for building under glibc 2.26 (#13785)

glibc 2.26 renames a number of identifiers so they are reserved under
POSIX. Specifically, `padding` becomes `__glibc_reserved1`. Add a
configure test for it and use the appropriate field name.

See https://sourceware.org/bugzilla/show_bug.cgi?id=21457 for more
information.

Resolves #13009

6 years agoDisable tests based on 13796
jashook [Tue, 5 Sep 2017 22:27:24 +0000 (15:27 -0700)]
Disable tests based on 13796

6 years agoMerge pull request #13791 from jashook/revert_13687
Jarret Shook [Tue, 5 Sep 2017 22:20:39 +0000 (15:20 -0700)]
Merge pull request #13791 from jashook/revert_13687

revert_13687

6 years agoFix SemaphoreSlim throughput (#13766)
Koundinya Veluri [Tue, 5 Sep 2017 21:52:23 +0000 (14:52 -0700)]
Fix SemaphoreSlim throughput (#13766)

In https://github.com/dotnet/coreclr/pull/13670, by mistake I made the spin loop infinite, that is now fixed.

As a result the numbers I had provided in that PR for SemaphoreSlim were skewed, and fixing it caused the throughput to get even lower. To compensate, I have found and fixed one culprit for the low throughput problem:
- Every release wakes up a waiter. Effectively, when there is a thread acquiring and releasing the semaphore, waiters don't get to remain in a wait state.
- Added a field to keep track of how many waiters were pulsed to wake but have not yet woken, and took that into account in Release() to not wake up more waiters than necessary.
- Retuned and increased the number of spin iterations. The total spin delay is still less than before the above PR.

6 years agorevert_13687
jashoo [Tue, 5 Sep 2017 18:42:15 +0000 (11:42 -0700)]
revert_13687

6 years agoAdd Intel hardware intrinsic API (#13576)
Fei Peng [Tue, 5 Sep 2017 18:34:56 +0000 (11:34 -0700)]
Add Intel hardware intrinsic API (#13576)

6 years agoFix access order for double pointer (#13759)
Victor "Nate" Graf [Tue, 5 Sep 2017 16:36:53 +0000 (09:36 -0700)]
Fix access order for double pointer (#13759)

* Fix access order for double pointer

* Reinforce test to catch more errors

6 years agoMerge pull request #13747 from jashook/lst_file_updates
Jarret Shook [Tue, 5 Sep 2017 16:36:35 +0000 (09:36 -0700)]
Merge pull request #13747 from jashook/lst_file_updates

Lst File updates.

6 years agoJIT: allow inlines of methods with calli (#13756)
Andy Ayers [Tue, 5 Sep 2017 14:23:55 +0000 (07:23 -0700)]
JIT: allow inlines of methods with calli (#13756)

Provided call sig has default callling convention. Added test case.
Continuation of #12714.

6 years agoMerge pull request #13763 from shimingsg/v-shige/addtestdependencyxmlfiles
Shiming Ge [Tue, 5 Sep 2017 07:01:41 +0000 (15:01 +0800)]
Merge pull request #13763 from shimingsg/v-shige/addtestdependencyxmlfiles

add test dependency xml files

6 years agoPrint zapper stats on verbose mode (#13774)
Hanjoung Lee [Tue, 5 Sep 2017 05:26:33 +0000 (14:26 +0900)]
Print zapper stats on verbose mode (#13774)

6 years agoFix uninitialized fields of ZapperStats (#13773)
Hanjoung Lee [Mon, 4 Sep 2017 23:33:13 +0000 (08:33 +0900)]
Fix uninitialized fields of ZapperStats (#13773)

6 years agoupdate correct file path if the working folder is not test case folder
shimingsg [Sat, 2 Sep 2017 10:01:37 +0000 (18:01 +0800)]
update correct file path if the working folder is not test case folder

6 years agoChange identifier for EventProviders from GUID to string name (#13370)
Victor "Nate" Graf [Fri, 1 Sep 2017 23:19:07 +0000 (16:19 -0700)]
Change identifier for EventProviders from GUID to string name (#13370)

* [WIP] Changed event provider to user String identifiers

* [WIP] Remove GUID from generated code

* [WIP] Many small fixes

* [WIP] Fix error in constructing GUID

* Pass EventSource to abstract away GUID/Name references

* Fix various small errors

* Delay construction of SString objects

* Change GUIDs to names

* Change hardcoded GUID strings to names

* Revert testing changes

* Remove extra line

* Use the EventSource name

* Use provider full names

* Use full-names for Rundown

* Bump version number for eventpipe file

* Address review comments

6 years agoMerge pull request #13755 from BruceForstall/AddLsraAssert
Bruce Forstall [Fri, 1 Sep 2017 23:03:18 +0000 (16:03 -0700)]
Merge pull request #13755 from BruceForstall/AddLsraAssert

Add an assert to getRegisterRecord() that regNum is legal

6 years agoneed casting for size calculation (#13754)
Maoni Stephens [Fri, 1 Sep 2017 22:21:47 +0000 (15:21 -0700)]
need casting for size calculation (#13754)

6 years agoAdd an assert to getRegisterRecord() that regNum is legal
Bruce Forstall [Fri, 1 Sep 2017 20:59:23 +0000 (13:59 -0700)]
Add an assert to getRegisterRecord() that regNum is legal

6 years agoAdd normalized equivalent of YieldProcessor, retune some spin loops (#13670)
Koundinya Veluri [Fri, 1 Sep 2017 20:09:40 +0000 (13:09 -0700)]
Add normalized equivalent of YieldProcessor, retune some spin loops (#13670)

* Add normalized equivalent of YieldProcessor, retune some spin loops

Part of fix for https://github.com/dotnet/coreclr/issues/13388

Normalized equivalent of YieldProcessor
- The delay incurred by YieldProcessor is measured once lazily at run-time
- Added YieldProcessorNormalized that yields for a specific duration (the duration is approximately equal to what was measured for one YieldProcessor on a Skylake processor, about 125 cycles). The measurement calculates how many YieldProcessor calls are necessary to get a delay close to the desired duration.
- Changed Thread.SpinWait to use YieldProcessorNormalized

Thread.SpinWait divide count by 7 experiment
- At this point I experimented with changing Thread.SpinWait to divide the requested number of iterations by 7, to see how it fares on perf. On my Sandy Bridge processor, 7 * YieldProcessor == YieldProcessorNormalized. See numbers in PR below.
- Not too many regressions, and the overall perf is somewhat as expected - not much change on Sandy Bridge processor, significant improvement on Skylake processor.
  - I'm discounting the SemaphoreSlim throughput score because it seems to be heavily dependent on Monitor. It would be more interesting to revisit SemaphoreSlim after retuning Monitor's spin heuristics.
  - ReaderWriterLockSlim seems to perform worse on Skylake, the current spin heuristics are not translating well

Spin tuning
- At this point, I abandoned the experiment above and tried to retune spins that use Thread.SpinWait
- General observations
  - YieldProcessor stage
    - At this stage in many places we're currently doing very long spins on YieldProcessor per iteration of the spin loop. In the last YieldProcessor iteration, it amounts to about 70 K cycles on Sandy Bridge and 512 K cycles on Skylake.
    - Long spins on YieldProcessor don't let other work run efficiently. Especially when many scheduled threads all issue a long YieldProcessor, a significant portion of the processor can go unused for a long time.
    - Long spins on YieldProcessor is in some cases helping to reduce contention in high-contention cases, effectively taking away some threads into a long delay. Sleep(1) works much better but has a much higher delay so it's not always appropriate. In other cases, I found that it's better to do more iterations with a shorter YieldProcessor. It would be even better to reduce the contention in the app or to have a proper wait in the sync object, where appropriate.
    - Updated the YieldProcessor measurement above to calculate the number of YieldProcessorNormalized calls that amount to about 900 cycles (this was tuned based on perf), and modified SpinWait's YieldProcessor stage to cap the number of iterations passed to Thread.SpinWait. Effectively, the first few iterations have a longer delay than before on Sandy Bridge and a shorter delay than before on Skylake, and the later iterations have a much shorter delay than before on both.
  - Yield/Sleep(0) stage
    - Observed a couple of issues:
      - When there are no threads to switch to, Yield and Sleep(0) become no-op and it turns the spin loop into a busy-spin that may quickly reach the max spin count and cause the thread to enter a wait state, or may just busy-spin for longer than desired before a Sleep(1). Completing the spin loop too early can cause excessive context switcing if a wait follows, and entering the Sleep(1) stage too early can cause excessive delays.
      - If there are multiple threads doing Yield and Sleep(0) (typically from the same spin loop due to contention), they may switch between one another, delaying work that can make progress.
    - I found that it works well to interleave a Yield/Sleep(0) with YieldProcessor, it enforces a minimum delay for this stage. Modified SpinWait to do this until it reaches the Sleep(1) threshold.
  - Sleep(1) stage
    - I didn't see any benefit in the tests to interleave Sleep(1) calls with some Yield/Sleep(0) calls, perf seemed to be a bit worse actually. If the Sleep(1) stage is reached, there is probably a lot of contention and the Sleep(1) stage helps to remove some threads from the equation for a while. Adding some Yield/Sleep(0) in-between seems to add back some of that contention.
      - Modified SpinWait to use a Sleep(1) threshold, after which point it only does Sleep(1) on each spin iteration
    - For the Sleep(1) threshold, I couldn't find one constant that works well in all cases
      - For spin loops that are followed by a proper wait (such as a wait on an event that is signaled when the resource becomes available), they benefit from not doing Sleep(1) at all, and spinning in other stages for longer
      - For infinite spin loops, they usually seemed to benefit from a lower Sleep(1) threshold to reduce contention, but the threshold also depends on other factors like how much work is done in each spin iteration, how efficient waiting is, and whether waiting has any negative side-effects.
      - Added an internal overload of SpinWait.SpinOnce to take the Sleep(1) threshold as a parameter
- SpinWait - Tweaked the spin strategy as mentioned above
- ManualResetEventSlim - Changed to use SpinWait, retuned the default number of iterations (total delay is still significantly less than before). Retained the previous behavior of having Sleep(1) if a higher spin count is requested.
- Task - It was using the same heuristics as ManualResetEventSlim, copied the changes here as well
- SemaphoreSlim - Changed to use SpinWait, retuned similarly to ManualResetEventSlim but with double the number of iterations because the wait path is a lot more expensive
- SpinLock - SpinLock was using very long YieldProcessor spins. Changed to use SpinWait, removed process count multiplier, simplified.
- ReaderWriterLockSlim - This one is complicated as there are many issues. The current spin heuristics performed better even after normalizing Thread.SpinWait but without changing the SpinWait iterations (the delay is longer than before), so I left this one as is.
- The perf (see numbers in PR below) seems to be much better than both the baseline and the Thread.SpinWait divide by 7 experiment
  - On Sandy Bridge, I didn't see many significant regressions. ReaderWriterLockSlim is a bit worse in some cases and a bit better in other similar cases, but at least the really low scores in the baseline got much better and not the other way around.
  - On Skylake, some significant regressions are in SemaphoreSlim throughput (which I'm discounting as I mentioned above in the experiment) and CountdownEvent add/signal throughput. The latter can probably be improved later.

6 years agoJIT: fix some instruction size estimates (#13432)
Andy Ayers [Fri, 1 Sep 2017 18:20:39 +0000 (11:20 -0700)]
JIT: fix some instruction size estimates (#13432)

The jit might double-count the REX prefix for certain reg-reg moves, and
could overestimate the size of a code-referent LEA.

While the downstream emitter code can tolerate overestimates, it is better
not to have them.

Closes #13398

Also fixes overestimates for the following:

* `call reg`
* `call [reg]`
* `call [reg + disp-byte]`
* `cmp al,byte`

6 years agoClear the init-locals bit for CoreLib to workaround #1279 (#13728)
Jan Kotas [Fri, 1 Sep 2017 17:57:33 +0000 (10:57 -0700)]
Clear the init-locals bit for CoreLib to workaround #1279 (#13728)

* Clear the init-locals bit for CoreLib to workaround #1279

* Yet another place that depends on zero init locals

6 years agoUpdate Type.GetMethods() to be generics friendly (#13745)
Atsushi Kanamori [Fri, 1 Sep 2017 17:04:47 +0000 (10:04 -0700)]
Update Type.GetMethods() to be generics friendly (#13745)

Update Type.GetMethods() to be generics friendly

6 years agoShare four exception types (#13492)
Dan Moseley [Fri, 1 Sep 2017 17:03:50 +0000 (10:03 -0700)]
Share four exception types (#13492)

* AE

* Move RuntimeWrappedException to shared

* Move AccessViolationException to shared

* Move IOException to shared

* nit

* assert to catch when message ought to include path

* AE feedback

* RWE feedback

* Remove most of __Error in favor of duplicate shared code in Win32Marshal

* Remove duplicated MakeHRFromErrorCode

* Extra using

* Revert RWE field rename

* Rename to wrappedException

* Make DNFE public for corefx

* Add no path case to match corefx

* Share DNFE

* Add underscore

* EOL

* Temporarily make DrNFE internal again

* Make RWE public

* Fixup __HResults

* Remove dead entries from Win32Native

* Redirect Kernel32 to PAL on Unix

* Remove dead targets file

* Unify on Interop.Libraries

* Refactor to expression-bodied property

6 years agoLst File updates.
jashook [Fri, 1 Sep 2017 16:42:02 +0000 (09:42 -0700)]
Lst File updates.

This change includes:

1) lst_creator updates to allow adding priority tags automatically
2) arm32 lstFile updates: 29 new tests, 50 removed
3) arm64 lstFile updates: 80 new tests, 55 removed

6 years agoMerge pull request #13743 from alpencolt/ryu-arm-13056-tests
Bruce Forstall [Fri, 1 Sep 2017 15:44:09 +0000 (08:44 -0700)]
Merge pull request #13743 from alpencolt/ryu-arm-13056-tests

[RyuJIT/ARM32] Add regression tests

6 years ago[ARM64/Windows] Add JIT_Stelem_Ref helper (#13687)
Pankaj Gode [Fri, 1 Sep 2017 15:42:26 +0000 (21:12 +0530)]
[ARM64/Windows] Add JIT_Stelem_Ref helper (#13687)

* [ARM64/Windows] Add JIT_Stelem_Ref helper

* [ARM64/Windows] Modified JIT_Stelem_Ref helper to save and restore x0-x2 instead of x0-x8

* [ARM64/Windows] using EPILOG_BRANCH for correct unwind info

6 years agoInitialize m_failedILStubs of ZapperStats (#13742)
Hanjoung Lee [Fri, 1 Sep 2017 15:41:01 +0000 (00:41 +0900)]
Initialize m_failedILStubs of ZapperStats (#13742)

6 years agoAvoid StringBuilder allocation in ResourceManager (#13732)
Justin Van Patten [Fri, 1 Sep 2017 14:12:30 +0000 (07:12 -0700)]
Avoid StringBuilder allocation in ResourceManager (#13732)