platform/upstream/coreclr.git
6 years agoChanged SpinLock::CompareExchange method declaration to static (#17579)
Phil Garcia [Mon, 16 Apr 2018 20:11:53 +0000 (13:11 -0700)]
Changed SpinLock::CompareExchange method declaration to static (#17579)

6 years agoUpdate CoreClr, CoreFx, PgoData to preview3-26416-06, preview3-26416-06, master-20180...
dotnet-maestro-bot [Mon, 16 Apr 2018 19:32:52 +0000 (14:32 -0500)]
Update CoreClr, CoreFx, PgoData to preview3-26416-06, preview3-26416-06, master-20180416-0039, respectively (#17580)

6 years ago[x86/Linux] Fix ICorDebug frames API (#17436)
Igor Kulaychuk [Mon, 16 Apr 2018 18:14:38 +0000 (21:14 +0300)]
[x86/Linux] Fix ICorDebug frames API (#17436)

6 years ago[x86/Linux] Fix marshalling struct with 64-bit types (#17455)
Konstantin Baladurin [Mon, 16 Apr 2018 18:11:41 +0000 (21:11 +0300)]
[x86/Linux] Fix marshalling struct with 64-bit types (#17455)

* [x86/Linux] Fix marshalling struct with 64-bit types

The System V ABI for i386 defines 4-byte alignment for 64-bit types.

* [Linux/x86] Fix marshalling tests in the case of System V i386 ABI

6 years agoUpdate KoreanLunisolarCalendar.cs (#17542)
elyoh [Mon, 16 Apr 2018 18:05:11 +0000 (19:05 +0100)]
Update KoreanLunisolarCalendar.cs (#17542)

* Update KoreanLunisolarCalendar.cs

Corrects two issues with the conversion table for Gregorian to Korean lunisolar dates.

Issue 1: tables use Julian month/day instead of Gregorian month/day for entries prior to 1583.
Lmon and Lday have been converted from Julian month and day to Gregorian month and day for years prior to 1583.
This also required a new value for MIN_GREGORIAN_DAY (now 19) so the minimum date now supported by this class is 19 Feb 0918 Gregorian.

Issue 2: data discrepancy in years 1586, 1587, 1648, 1659, 1692, 1753 and 1754.
Table entries for 1586, 1587, 1648, 1659, 1692, 1753 and 1754 have been corrected to match Korea Astronomy and Space Science In-
stitute (KASI) data.  Specifically:
•for years 1587, 1648, and 1754, the first day of year has been corrected
•for years 1586, 1587, 1659, 1692, 1753, and 1754, the lengths of each month have been corrected

Notes
A minor formatting change to the table has been made.  The DaysPerMonth flag has been converted to use the binary literal to ensure that changes can be made and verified easily.
See: https://github.com/dotnet/coreclr/issues/17510 for full discussion of changes.

* Update KoreanLunisolarCalendar.cs

Added comment on sources of table data.

6 years agoUpdate CoreClr, CoreFx, PgoData to preview3-26416-01, preview3-26416-01, master-20180...
dotnet-maestro-bot [Mon, 16 Apr 2018 06:43:04 +0000 (01:43 -0500)]
Update CoreClr, CoreFx, PgoData to preview3-26416-01, preview3-26416-01, master-20180415-0051, respectively (#17540)

6 years ago[Arm64] Add full barrier after locking operations (#17567)
Steve MacLean [Sun, 15 Apr 2018 21:36:04 +0000 (17:36 -0400)]
[Arm64] Add full barrier after locking operations (#17567)

6 years agoMerge pull request #17569 from dotnet/dev/unix_test_workflow
Bruce Forstall [Sat, 14 Apr 2018 20:30:21 +0000 (13:30 -0700)]
Merge pull request #17569 from dotnet/dev/unix_test_workflow

Don't use runtesttilstable script for Ubuntu arm jobs

6 years agoAvoid creating illegal byref pointers (#17524)
Bruce Forstall [Sat, 14 Apr 2018 18:11:28 +0000 (11:11 -0700)]
Avoid creating illegal byref pointers (#17524)

Byref pointers need to point within their "host" object -- thus
the alternate name "interior pointers". If the JIT creates and
reports a pointer as a "byref", but it points outside the host
object, and a GC occurs that moves the host object, the byref
pointer will not be updated. If a subsequent calculation puts
the byref "back" into the host object, it will actually be pointing
to garbage, since the host object has moved.

This occurred on ARM with array index calculations, in particular
because ARM doesn't have a single-instruction "base + scale*index + offset"
addressing mode. Thus, we were generating, for the jaggedarr_cs_do
test case, `ProcessJagged3DArray()` function:
```
// r0 = array object, r6 = computed index offset. We mark r4 as a byref.
add r4, r0, r6

// r4 - 32 is the offset of the object we care about. Then we load the array element.
// In this case, the loaded element is a gcref, so r4 becomes a gcref.
ldr r4, [r4-32]
```
We get this math because the user code uses `a[i - 10]`, which is
essentially `a + (i - 10) * 4 + 8` for element size 4. This is optimized
to `a + i * 4 - 32`. In the above code, `r6` is `i * 4`. In this case,
after the first instruction, `r4` can point beyond the array.
If a GC happens, `r4` isn't updated, and the second instruction loads garbage.

There are several fixes:
1. Change array morphing in `fgMorphArrayIndex()` to rearrange the array index
IR node creation to only create a byref pointer that is precise; don't create
"intermediate" byref pointers that don't represent the actual array element
address being computed. The tree matching code that annotates the generated tree
with field sequences needs to be updated to match the new form.
2. Change `fgMoveOpsLeft()` to prevent the left-weighted reassociation optimization
`[byref]+ (ref, [int]+ (int, int)) => [byref]+ ([byref]+ (ref, int), int)`. This
optimization creates "incorrect" byrefs that don't necessarily point within
the host object.
3. Add an additional condition to the `Fold "((x+icon1)+icon2) to (x+(icon1+icon2))"`
morph optimization to prevent merging of constant TYP_REF nodes, which now were
being recognized due to different tree shapes. This was probably always a problem,
but the particular tree shape wasn't seen before.

These fixes are all-platform. However, to reduce risk at this point, the are
enabled for ARM only, under the `FEATURE_PREVENT_BAD_BYREFS` `#ifdef`.

Fixes #17517.

There are many, many diffs.

For ARM32 ngen-based desktop asm diffs, it is a 0.30% improvement across all
framework assemblies. A lot of the diffs seem to be because we CSE the entire
array address offset expression, not just the index expression.

6 years agoDon't use tests/runtesttilstable.sh for Ubuntu arm jobs
Egor Chesakov [Sat, 14 Apr 2018 16:06:04 +0000 (09:06 -0700)]
Don't use tests/runtesttilstable.sh for Ubuntu arm jobs

6 years agoEnable building Linux/arm crossarch components in netci
Egor Chesakov [Tue, 27 Mar 2018 17:47:27 +0000 (10:47 -0700)]
Enable building Linux/arm crossarch components in netci

6 years agoDisable failing Ubuntu/arm tests (#17559)
Egor Chesakov [Sat, 14 Apr 2018 15:59:33 +0000 (08:59 -0700)]
Disable failing Ubuntu/arm tests (#17559)

Disable LeakWheel and SlowTailCallArgs Ubuntu/arm tests

6 years agoMake Windows builds always portable
Russ Keldorph [Thu, 12 Apr 2018 23:12:43 +0000 (16:12 -0700)]
Make Windows builds always portable

Apparently there is little or no need for a non-portable Windows build, so
rather than trying to figure out which version of Windows we are building
on, just ignore -PortableBuild=false.  We can add a warning or refuse to
accept the switch later if necessary, but for now we need to continue
accepting it to avoid build breaks.

Fixes #14291

6 years ago[Arm64/Linux] #17521 for linux (#17546)
Steve MacLean [Sat, 14 Apr 2018 12:52:27 +0000 (08:52 -0400)]
[Arm64/Linux] #17521 for linux (#17546)

6 years agoFix random Segfaults on Ubuntu arm (#17523)
Egor Chesakov [Sat, 14 Apr 2018 07:24:58 +0000 (00:24 -0700)]
Fix random Segfaults on Ubuntu arm (#17523)

Fix random Segfaults on Ubuntu arm

6 years agoFix OpenVirtualProcess on Linux issue. (#17551)
Mike McLaughlin [Sat, 14 Apr 2018 00:37:06 +0000 (17:37 -0700)]
Fix OpenVirtualProcess on Linux issue. (#17551)

6 years agoInsert int3 after non-returning calls at the end of basic blocks. (#17535)
Eugene Rozenfeld [Fri, 13 Apr 2018 23:29:12 +0000 (16:29 -0700)]
Insert int3 after non-returning calls at the end of basic blocks. (#17535)

This is a follow-up to #17501 that fixed #17398.

gc pointer reporting in fully-interruptible mode: the latter assumed that
register gc pointer liveness doesn't change across calls while #6103 introduced
codegen where it wasn't true.

doesn't change across calls.

This change inserts int3 after non-returning calls at the end of basic blocks
so that gc pointer liveness doesn't change across calls. This is additional
insurance in case any other place in the runtime is dependent on that contract.

6 years agoFix default style argument to Double/Single/Decimal.Parse (#17556)
Stephen Toub [Fri, 13 Apr 2018 23:07:34 +0000 (19:07 -0400)]
Fix default style argument to Double/Single/Decimal.Parse (#17556)

6 years agoMerge pull request #17531 from BruceForstall/SpmiProtectJitStartup
Bruce Forstall [Fri, 13 Apr 2018 21:02:10 +0000 (14:02 -0700)]
Merge pull request #17531 from BruceForstall/SpmiProtectJitStartup

Protect SuperPMI from crashes calling jitStartup

6 years ago[Arm64/Linux] Use platform memset/memcpy (#17536)
Steve MacLean [Fri, 13 Apr 2018 16:46:52 +0000 (12:46 -0400)]
[Arm64/Linux] Use platform memset/memcpy (#17536)

Fixes buggy memset implementation
Use heavily optimized platform implementation
Follows amd64 & arm precedent

6 years ago[Arm64/Windows] Simplify JIT_MemSet & JIT_MemCpy (#17537)
Steve MacLean [Fri, 13 Apr 2018 16:46:19 +0000 (12:46 -0400)]
[Arm64/Windows] Simplify JIT_MemSet & JIT_MemCpy (#17537)

JIT_Memset alignment code was definitly broken for some
unaligned cases

JIT_MemCpy likely had the same issue

Simplify implementation to reduce maintenance burden

6 years agoPreserve VASigCookieReg across PInvokeStubWorker call (#17521)
Aditya Mandaleeka [Fri, 13 Apr 2018 12:25:39 +0000 (05:25 -0700)]
Preserve VASigCookieReg across PInvokeStubWorker call (#17521)

The call to PInvokeStubWorker can do all kinds of stuff to the
VASigCookieReg in the GenericPInvokeCalli case, since x15 is just a
temporary register. Let's save it in a callee-saved register so that
when we come back after stub generation, we still have the correct value
for the VASigCookie.

6 years agoCollapse leftover AsSpan().Slice(...) into AsSpan(...) (#29078)
Ahson Khan [Fri, 13 Apr 2018 05:40:43 +0000 (22:40 -0700)]
Collapse leftover AsSpan().Slice(...) into AsSpan(...) (#29078)

Signed-off-by: dotnet-bot-corefx-mirror <dotnet-bot@microsoft.com>
6 years agoUpdate CoreClr, CoreFx to preview3-26413-01, preview3-26413-02, respectively (#17538)
dotnet-maestro-bot [Fri, 13 Apr 2018 07:20:16 +0000 (02:20 -0500)]
Update CoreClr, CoreFx to preview3-26413-01, preview3-26413-02, respectively (#17538)

6 years agoRemove CreateFromPinnedArray from Memory (moved to MemoryMarshal) (#17532)
Ahson Khan [Fri, 13 Apr 2018 04:52:24 +0000 (21:52 -0700)]
Remove CreateFromPinnedArray from Memory (moved to MemoryMarshal) (#17532)

6 years agoFix for 17398. (#17501)
Eugene Rozenfeld [Thu, 12 Apr 2018 23:05:44 +0000 (16:05 -0700)]
Fix for 17398. (#17501)

When enumerating live gc registers, if we are not on the active stack frame,
we need to report callee-save gc registers that are live before the call.
The reason is that the liveness of gc registers may change across a call
to a method that does not return. In this case the instruction after the call
may be a jump target and a register that didn't have a live gc pointer before
the call may have a live gc pointer after the jump. To make sure we report the
registers that have live gc pointers before the call we subtract 1 from curOffs.

6 years agoUse string.IsNullOrEmpty to eliminate bounds check to first char (#17512)
Ben Adams [Thu, 12 Apr 2018 21:08:04 +0000 (22:08 +0100)]
Use string.IsNullOrEmpty to eliminate bounds check to first char (#17512)

6 years agoProtect SuperPMI from crashes calling jitStartup
Bruce Forstall [Thu, 12 Apr 2018 20:55:15 +0000 (13:55 -0700)]
Protect SuperPMI from crashes calling jitStartup

When we call jitStartup, we pass a JitHost interface that the JIT
calls to query for data. These queries look up in the recorded
MCH data, and could fail (and throw an exception) if data is
missing, which it can be for running non-matching altjit against
a collection. Protect these calls with exception handling.

6 years agoUpdate CoreClr, CoreFx, PgoData to preview3-26412-06, preview3-26412-07, master-20180...
dotnet-maestro-bot [Thu, 12 Apr 2018 20:37:49 +0000 (15:37 -0500)]
Update CoreClr, CoreFx, PgoData to preview3-26412-06, preview3-26412-07, master-20180412-0051, respectively (#17526)

6 years agoFixed #16503 [x64 arm32] the test smalloom terminated with signal SIGKILL
Sergey Ignatov [Mon, 9 Apr 2018 07:36:16 +0000 (10:36 +0300)]
Fixed #16503 [x64 arm32] the test smalloom terminated with signal SIGKILL

6 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview3-02711-02, preview3-26412...
dotnet-maestro-bot [Thu, 12 Apr 2018 07:05:58 +0000 (02:05 -0500)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview3-02711-02, preview3-26412-01, preview3-26412-02, master-20180411-0039, respectively (#17509)

6 years agoReenable Perf Correctness smoketest (#17520)
Michelle McDaniel [Thu, 12 Apr 2018 00:46:30 +0000 (17:46 -0700)]
Reenable Perf Correctness smoketest (#17520)

6 years agoMerge pull request #17464 from briansull/wip-17435
Brian Sullivan [Thu, 12 Apr 2018 00:38:21 +0000 (17:38 -0700)]
Merge pull request #17464 from briansull/wip-17435

Fix for issue #17435 - Incorrect CSE with SSE Hardware intrinsics

6 years agoFixed checks for Avx/Avx2.InsertVector128 to check the type of the second arg
Brian Sullivan [Wed, 11 Apr 2018 23:15:57 +0000 (16:15 -0700)]
Fixed checks for Avx/Avx2.InsertVector128 to check the type of the second arg
Added test case JIT\HardwareIntrinsics\X86\Regression\GitHub_17435

6 years agoMutate the global heap valuenumber for any HW intrinsic that performs a memory store...
Brian Sullivan [Fri, 6 Apr 2018 22:30:37 +0000 (15:30 -0700)]
Mutate the global heap valuenumber for any HW intrinsic that performs a memory store operation
Use fgMutateGcHeap to record memory write operations by HW Intrinsics
Set flags for the HW Intrinsic nodes that access Memory
Added support for HWIntrinsic nodes to OperMayThrow
Added support for GT_HWIntrinsic to GenTree::OperRequiresAsgFlag() and GenTree::OperIsImplicitIndir()
Refactored GenTreeHWIntrinsic::OperIsMemoryLoad() and GenTreeHWIntrinsic::OperIsMemoryStore()
Added GenTreeHWIntrinsic::OperIsMemoryLoadOrStore()
Deleted the static version of OperIsImplicitIndir(gtOper)

6 years agoSome cleanup for ArrayPool trimming (#17518)
Jeremy Kuhne [Wed, 11 Apr 2018 22:55:38 +0000 (15:55 -0700)]
Some cleanup for ArrayPool trimming (#17518)

* Some cleanup for ArrayPool trimming

- fix static names
- make config switch more specific
- tweak tls free logic for logging

* Tweak the name of the config switch

6 years agoRemove MemoryManager.Length (#17498)
Ben Adams [Wed, 11 Apr 2018 20:48:52 +0000 (21:48 +0100)]
Remove MemoryManager.Length (#17498)

* Remove MemoryManager.Length

* Feedback

* XML comment nits

6 years agoMerge pull request #17431 from CarolEidt/Fix17389
Carol Eidt [Wed, 11 Apr 2018 20:41:22 +0000 (13:41 -0700)]
Merge pull request #17431 from CarolEidt/Fix17389

LSRA: remove last uses only at use point

6 years agoFix Valuenum:EvalFuncForConstantArgs (#17506)
Sergey Andreenko [Wed, 11 Apr 2018 20:16:22 +0000 (13:16 -0700)]
Fix Valuenum:EvalFuncForConstantArgs (#17506)

6 years agoFix CoreRT build breaks
Jan Kotas [Wed, 11 Apr 2018 14:13:34 +0000 (07:13 -0700)]
Fix CoreRT build breaks

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
6 years agoEnsure previous steps haven't failed when building tests (#17514)
Matt Mitchell [Wed, 11 Apr 2018 16:57:48 +0000 (09:57 -0700)]
Ensure previous steps haven't failed when building tests (#17514)

Update conditions to ensure that we don't continue on failed test builds

6 years agoAdd GetPinnableReference back to Span and ReadOnlySpan (#17504)
Ahson Khan [Wed, 11 Apr 2018 13:43:10 +0000 (06:43 -0700)]
Add GetPinnableReference back to Span and ReadOnlySpan (#17504)

6 years agoFix Assert in ValueTask (#17511)
Ben Adams [Wed, 11 Apr 2018 11:36:27 +0000 (12:36 +0100)]
Fix Assert in ValueTask (#17511)

6 years agoFix cmake toolchain compile flags loop (#17380)
Petr Bred [Wed, 11 Apr 2018 09:25:03 +0000 (12:25 +0300)]
Fix cmake toolchain compile flags loop (#17380)

- fix https://github.com/dotnet/corert/issues/5093
- cmake toolchain refactoring

Signed-off-by: Petr Bred <bredpetr@gmail.com>
6 years agoSimple trim of ArrayPool buffers (#17078)
Jeremy Kuhne [Wed, 11 Apr 2018 05:25:49 +0000 (22:25 -0700)]
Simple trim of ArrayPool buffers (#17078)

* Simple trim of ArrayPool buffers

Trim ArrayPool buffers on Gen2 GC if the buffer stack hasn't been emptied for awhile. If you haven't pulled all of the buffers in the past 10 seconds, let loose the top buffer on the stack and give the stack another 2 seconds of potential life. When the stack gets it's bottom bufferr returned the clock resets.

* Collect thread locals as well

* Add event

* Incorporate memory pressure into trimming.

Idea is that we normally give buckets a minute of age time unless the pressure starts to ramp up. As it ramps up we'll trim more off the stacks. If it gets really high we'll consider stale to be 10s instead of 1 min.

* Add implementation back for PinnableBufferCacheEventSource.

* Remove security attribute.
Fix GetMemoryInfo signature

* Always use Tls* for shared pools
Add environment variable switch

* Add guid to PinnableBufferCacheEventSource

* Address feedback

- move setting code to CLRConfig
- add constructor to PBCES
- trim large arrays more aggressively
- tweak names (ticks to ms, etc.)
- interlock creating the cleanup callback
- fix project file

Rent/return perf numbers are unchanged

* Remove static constructor
Inline Unsafe.SizeOf

* Fix spacing issue

* Trim all thread locals when memory pressure is high.
Move constants inline.

* Undo formatting changes

* Add back the internal call

* Put the right bits back *sigh*

* Missing the line feed

* Add event for trim polling

* Undo PinnableBufferCacheEventSource reimplementation

6 years agoUpdate CoreClr, CoreFx to preview3-26411-01, preview3-26411-01, respectively (#17507)
dotnet-maestro-bot [Wed, 11 Apr 2018 03:55:27 +0000 (22:55 -0500)]
Update CoreClr, CoreFx to preview3-26411-01, preview3-26411-01, respectively (#17507)

6 years agoFix x86 steady state tiered compilation performance (#17476)
Noah Falk [Wed, 11 Apr 2018 03:35:33 +0000 (20:35 -0700)]
Fix x86 steady state tiered compilation performance (#17476)

* Fix x86 steady state tiered compilation performance

Also included - a few tiered compilation only test hooks + small logging fix for JitBench

Tiered compilation wasn't correctly implementing the MayHavePrecode and RequiresStableEntryPoint policy functions. On x64 this was a non-issue, but due to compact entrypoints on x86 it lead to methods allocating both FuncPtrStubs and Precodes. The FuncPtrStubs would never get backpatched which caused never ending invocations of the Prestub for some methods. Although such code still runs correctly, it is much slower than it needs to be. On MusicStore x86 I am seeing a 20% improvement in steady state RPS after this fix, bringing us inline with what I've seen on x64.

6 years agoAdd CreateFromPinnedArray to MemoryMarshal (#17500)
Ahson Khan [Wed, 11 Apr 2018 03:35:00 +0000 (20:35 -0700)]
Add CreateFromPinnedArray to MemoryMarshal (#17500)

* Add CreateFromPinnedArray to MemoryMarshal

* Address PR feedback: Add a warning remark to CreateFromPinnedArray

6 years agoMerge pull request #17466 from dotnet-maestro-bot/master-UpdateDependencies
Wes Haggard [Tue, 10 Apr 2018 16:44:20 +0000 (09:44 -0700)]
Merge pull request #17466 from dotnet-maestro-bot/master-UpdateDependencies

Update CoreClr, CoreFx, PgoData to preview3-26410-07, preview3-26409-05, master-20180410-0048, respectively (master)

6 years agoUpdate timeout for running scenario benchmarks (#17440)
Michelle McDaniel [Tue, 10 Apr 2018 15:46:47 +0000 (08:46 -0700)]
Update timeout for running scenario benchmarks (#17440)

This change ups the timeout for running benchmarks to 60 minutes, and changes the training data corpus file to one that is now stored in azure blob storage, and is only 10MB, to reduce the time spent running this benchmark (which was excessively long for our lab perf testing).

6 years agoUpdate CoreClr, CoreFx, PgoData to preview3-26410-07, preview3-26409-05, master-20180...
dotnet-maestro-bot [Tue, 10 Apr 2018 13:23:37 +0000 (06:23 -0700)]
Update CoreClr, CoreFx, PgoData to preview3-26410-07, preview3-26409-05, master-20180410-0048, respectively

6 years agoUse non-inlineable overload for rare CompareOrdinalIgnoreCase path (#17492)
Jan Kotas [Tue, 10 Apr 2018 11:56:33 +0000 (04:56 -0700)]
Use non-inlineable overload for rare CompareOrdinalIgnoreCase path (#17492)

This fixes regression introduced in #17237.

6 years agoFix trigger for tier 1 call counting delay (#17477)
Koundinya Veluri [Tue, 10 Apr 2018 04:46:10 +0000 (21:46 -0700)]
Fix trigger for tier 1 call counting delay (#17477)

Fix trigger for tier 1 call counting delay

The trigger was taking into account all non-tier-1 JIT invocations to delay call counting, even for those methods that are not eligible for tiering. In the AllReady benchmark, some dynamic methods were being jitted frequently enough to not allow tier 1 call counting to begin. Fixed to count only eligible methods jitted at tier 0, such that methods not eligible for tiering don't interfere with the tiering heuristics.

6 years agoHandle last uses that become contained
Carol Eidt [Tue, 10 Apr 2018 00:07:03 +0000 (17:07 -0700)]
Handle last uses that become contained

6 years agoAvoid Unsafe.As usage in ValueTask that can break type safety (#17471)
Stephen Toub [Mon, 9 Apr 2018 23:52:25 +0000 (19:52 -0400)]
Avoid Unsafe.As usage in ValueTask that can break type safety (#17471)

Unsafe.As yields a performance improvement over using a normal cast, and it's fine when ValueTask is used correctly, but if the ValueTask instance were to be stored into a field and multiple threads incorrectly raced to access it, a torn read/write could result in violating type safety due to ObjectIsTask reading the wrong value for the associated object. This commit changes the implementation to only use the single object field to determine which paths to take, rather than factoring in a second field that may not be in sync.

6 years agoMerge pull request #17485 from weshaggard/SignCrossTools
Wes Haggard [Mon, 9 Apr 2018 23:21:33 +0000 (16:21 -0700)]
Merge pull request #17485 from weshaggard/SignCrossTools

Enable signing for cross targeting tools

6 years agoEnable signing for cross targeting tools
Wes Haggard [Mon, 9 Apr 2018 23:16:45 +0000 (16:16 -0700)]
Enable signing for cross targeting tools

6 years agoFix MemoryManager ctor and use internal span ctor to improve performance (#17452)
Ahson Khan [Mon, 9 Apr 2018 22:49:04 +0000 (15:49 -0700)]
Fix MemoryManager ctor and use internal span ctor to improve performance (#17452)

* Fix MemoryManager ctor, add unit and perf tests, and use internal span ctor.

* Address PR feedback (remove use of Unsafe.As and Dangerous Span Ctor)

6 years agoReverting changes from #17401 (#17482)
Sung Yoon Whang [Mon, 9 Apr 2018 19:15:15 +0000 (12:15 -0700)]
Reverting changes from #17401 (#17482)

6 years agoLSRA: remove last uses only at use point
Carol Eidt [Thu, 5 Apr 2018 01:36:27 +0000 (18:36 -0700)]
LSRA: remove last uses only at use point

LSRA maintains liveness within a block to determine what's live across a call. It uses the last use bits on lclVar nodes to remove them from the set. However, this should be done at the point of use rather than at the point where the lclVar is encountered in the execution stream.

Fix #17389

6 years agoDisable some tests under GCStress where they take too long to complete (#17437)
Koundinya Veluri [Mon, 9 Apr 2018 17:02:51 +0000 (10:02 -0700)]
Disable some tests under GCStress where they take too long to complete (#17437)

* Disable some tests under GCStress where they take too long to complete

https://github.com/dotnet/coreclr/issues/15309

6 years agoAdding dlerr() diagnostics for libicu dlsym errors (#17454)
Debayan Ghosh [Mon, 9 Apr 2018 16:03:07 +0000 (21:33 +0530)]
Adding dlerr() diagnostics for libicu dlsym errors (#17454)

6 years agoFix OpenVirtualProcess SIGSEGV on Linux. (#17444)
Mike McLaughlin [Sat, 7 Apr 2018 21:21:46 +0000 (14:21 -0700)]
Fix OpenVirtualProcess SIGSEGV on Linux. (#17444)

Add DBI OpenVirtualProcessImpl2 that takes a module path instead of handle.

Fix assert on Windows debug.

Issue #17446

6 years agoPublish symbols using Microsoft.SymbolUploader.Build.Task package (#17463)
Mike McLaughlin [Sat, 7 Apr 2018 00:32:51 +0000 (17:32 -0700)]
Publish symbols using Microsoft.SymbolUploader.Build.Task package (#17463)

Added PB_SymbolExpirationInDays (settable at queue time), PB_MsdlSymbolServerPAT, PB_SymwebSymbolServerPAT variables.

Added "msdl" (publish symbols to public Microsoft server) and "symweb" (publish symbols to symweb) variables to PB_PublishType.

Update to version 1.0.0-beta-62806-01 of the symbol uploader.

Issue #16482

6 years agoUpdate CoreClr, CoreFx to preview3-26406-08, preview3-26406-06, respectively (#17445)
dotnet-maestro-bot [Fri, 6 Apr 2018 21:38:19 +0000 (16:38 -0500)]
Update CoreClr, CoreFx to preview3-26406-08, preview3-26406-06, respectively (#17445)

6 years agoMerge pull request #17418 from CarolEidt/Fix590358
Carol Eidt [Fri, 6 Apr 2018 21:23:33 +0000 (14:23 -0700)]
Merge pull request #17418 from CarolEidt/Fix590358

Handle SIMD8/LONG recasts for LCL_FLD

6 years agoAdd GetLoaderAllocatorObjectForGC to IGCToCLR (#17443)
David Mason [Fri, 6 Apr 2018 20:19:21 +0000 (13:19 -0700)]
Add GetLoaderAllocatorObjectForGC to IGCToCLR (#17443)

6 years agoTest windows event log (#17401)
Sung Yoon Whang [Fri, 6 Apr 2018 18:39:23 +0000 (11:39 -0700)]
Test windows event log (#17401)

* Windows Event Log tests

* Add test for windows event log

* Make it run under one executable

* Removing duplicate files

* remove more useless file

* fix formatting for reference to Diagnostics.EventLog

* Windows Event Log test is not supported outside Windows

* More logging to see why failures are occuring...

* Fix typo

* fix more typos

* just make the test pass on non-windows platforms

* Make the test more reliable with timing

6 years agoFix GC stress modes 4 and 8 on Linux ARM (#17456)
Jan Vorlicek [Fri, 6 Apr 2018 16:44:02 +0000 (18:44 +0200)]
Fix GC stress modes 4 and 8 on Linux ARM (#17456)

There were two problems:
* The illegal instruction 0xde01 used for INTERRUPT_INSTR_CALL doesn't
  generate SIGILL, but SIGTRAP, since this is the code used for
  breakpoints.
* The USE_REDIRECT_FOR_GCSTRESS was defined even for FEATURE_PAL for
  ARM, which is incorrect and resulted in explicit redirect frame not
  being created in DoGcStress and thus the GC stack walk was skipping
  managed frames that it should walk.

6 years agoAdd YieldAwaiter support to the async method builder delegate optimization (#17441)
Stephen Toub [Fri, 6 Apr 2018 13:48:35 +0000 (06:48 -0700)]
Add YieldAwaiter support to the async method builder delegate optimization (#17441)

We added an optimization to async methods that lets the builder avoid allocating the Action delegate when it recognizes the awaiter being used.  Previously this was enabled for all of the publicly exposed awaiters in corelib, with the exception of YieldAwaiter (what's used with Task.YIeld).  It was enabled by having the awaiter implement an internal interface.  This commit just generalizes that interface name and then implements it on YIeldAwaiter to complete the picture.

6 years agoAdd some comments to SpanHelpers.Char IndexOf and LastIndexOf (#17447)
Ahson Khan [Fri, 6 Apr 2018 13:47:03 +0000 (06:47 -0700)]
Add some comments to SpanHelpers.Char IndexOf and LastIndexOf (#17447)

6 years agorevert "Work around MCG bug around `ref char` marshalling #5481" (#5656)
Luqun Lou [Fri, 6 Apr 2018 01:54:42 +0000 (18:54 -0700)]
revert "Work around MCG bug around `ref char` marshalling #5481" (#5656)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
6 years agoUpdate docker images for arm32 (#17422)
Sergey Andreenko [Fri, 6 Apr 2018 03:09:46 +0000 (20:09 -0700)]
Update docker images for arm32 (#17422)

* mark places that we need to change

* update dockumentation for arm

* update build.sh for arm

* update dockers' versions

* fix build.sh

* change default version for arm/armem/arm64

6 years agoMerge pull request #17363 from CarolEidt/Fix17242
Carol Eidt [Thu, 5 Apr 2018 22:22:37 +0000 (15:22 -0700)]
Merge pull request #17363 from CarolEidt/Fix17242

GC info fix: correctly adjust argCnt

6 years agoformatting
Carol Eidt [Thu, 5 Apr 2018 21:50:35 +0000 (14:50 -0700)]
formatting

6 years agoRemove fgMorphLocalField invalid assert
Carol Eidt [Thu, 5 Apr 2018 21:35:13 +0000 (14:35 -0700)]
Remove fgMorphLocalField invalid assert

6 years agoVectorize and use ROSpan.LastIndexOf as the workhorse for string.LastIndexOf (#17370)
Ahson Khan [Thu, 5 Apr 2018 18:36:39 +0000 (11:36 -0700)]
Vectorize and use ROSpan.LastIndexOf as the workhorse for string.LastIndexOf (#17370)

* Vectorize and use ROSpan.LastIndexOf as the workhorse for string.LastIndexOf

* Address PR feedback, remove Length == 0 checks where unnecessary.

* Use aligned vector read just like IndexOf

6 years agoAdd Word2Vec Benchmark Harness (#17350)
Michelle McDaniel [Thu, 5 Apr 2018 18:20:05 +0000 (11:20 -0700)]
Add Word2Vec Benchmark Harness (#17350)

* Add Word2Vec Benchmark Harness

This change adds an additional scenario benchmark, the Word2Vec
benchmark. The harness pulls down Word2Vec.Net from eabdullin, applies a
patch of changes that we made to work with netcoreapp21, harness the
word training and search, and then runs the benchmark. It also updates
the timeout for running benchmarks, since the training scenario on a
100M file takes about 7 minutes locally.

6 years agoMerge pull request #17424 from BruceForstall/FixArmCoreFxTests
Bruce Forstall [Thu, 5 Apr 2018 16:29:55 +0000 (09:29 -0700)]
Merge pull request #17424 from BruceForstall/FixArmCoreFxTests

Disable corefx Microsoft.Win32.Registry.Tests on ARM

6 years agoMerge pull request #17432 from stephentoub/portnumericperf
Stephen Toub [Thu, 5 Apr 2018 15:55:43 +0000 (08:55 -0700)]
Merge pull request #17432 from stephentoub/portnumericperf

Improve {u}int/long.ToString/TryFormat throughput by pre-computing the length

6 years agoRename conflicting definitions VER_MAJOR/MINORVERSION macros (#17364)
Jan Kotas [Thu, 5 Apr 2018 15:24:28 +0000 (08:24 -0700)]
Rename conflicting definitions VER_MAJOR/MINORVERSION macros (#17364)

* Rename conflicting definitions of VER_MAJOR/MINORVERSION

These macros are defined by Windows SDK. They were overload to mean CLR version
that was causing interesting redefinition issues.

* Delete workaround for redefined Windows SDK macros

* Delete ProjectN version

* Delete dead code

6 years agoUpdate CoreClr, CoreFx to preview3-26405-01, preview3-26405-01, respectively (#17430)
dotnet-maestro-bot [Thu, 5 Apr 2018 13:27:26 +0000 (08:27 -0500)]
Update CoreClr, CoreFx to preview3-26405-01, preview3-26405-01, respectively (#17430)

6 years agoUse FormattingHelpers.Count{Hex}Digits in {u}int/long.ToString/TryFormat
Stephen Toub [Thu, 5 Apr 2018 02:19:52 +0000 (22:19 -0400)]
Use FormattingHelpers.Count{Hex}Digits in {u}int/long.ToString/TryFormat

Currently we create a temporary buffer on the stack, format into it, and then copy from that stack buffer into either the target span (for TryFormat) or into a new string (for ToString.

Following the approach as (and sharing the same code from) Utf8Formatter, where it first counts the number of digits in the output in order to determine an exact length, this commit changes the implementation to skip the temporary buffer and just format directly into the destination span or string.

This results in a very measurable performance boost.

6 years agoMove FormattingHelpers.Count{Hex}Digits from Utf8Formatter into shared
Stephen Toub [Thu, 5 Apr 2018 02:19:47 +0000 (22:19 -0400)]
Move FormattingHelpers.Count{Hex}Digits from Utf8Formatter into shared

6 years agoJIT: refine x86 gc reg kill set for CORINFO_HELP_INIT_PINVOKE_FRAME (#17421)
Andy Ayers [Thu, 5 Apr 2018 00:54:27 +0000 (17:54 -0700)]
JIT: refine x86 gc reg kill set for CORINFO_HELP_INIT_PINVOKE_FRAME (#17421)

This helper only kills EAX/ESI on x86, so make sure that is reflected in
the gc kill set.

Resolves #17404.

6 years agoMerge pull request #17426 from dotnet-maestro-bot/master-UpdateDependencies
Wes Haggard [Wed, 4 Apr 2018 23:46:58 +0000 (16:46 -0700)]
Merge pull request #17426 from dotnet-maestro-bot/master-UpdateDependencies

Update BuildTools to preview3-02704-01 (master)

6 years agoFix ARM32 on ARM64 Tracing (#17417)
Brian Robbins [Wed, 4 Apr 2018 21:44:58 +0000 (14:44 -0700)]
Fix ARM32 on ARM64 Tracing (#17417)

6 years agoUpdate BuildTools to preview3-02704-01
dotnet-maestro-bot [Wed, 4 Apr 2018 21:09:03 +0000 (14:09 -0700)]
Update BuildTools to preview3-02704-01

6 years agoHandle SIMD8/LONG recasts for LCL_FLD
Carol Eidt [Wed, 4 Apr 2018 17:40:03 +0000 (10:40 -0700)]
Handle SIMD8/LONG recasts for LCL_FLD

Lowering needs to insert a `BITCAST` in the case of a `STORE_LCL_FLD` with mismatched `TYP_SIMD8`/`TYP_LONG` operands, just as for `STORE_LCL_VAR`.

6 years agoDisable corefx Microsoft.Win32.Registry.Tests on ARM
Bruce Forstall [Wed, 4 Apr 2018 19:35:24 +0000 (12:35 -0700)]
Disable corefx Microsoft.Win32.Registry.Tests on ARM

Failures tracked by #17423.

6 years agoFix ExecutionContext capture in Task (#17407)
Stephen Toub [Wed, 4 Apr 2018 19:14:33 +0000 (12:14 -0700)]
Fix ExecutionContext capture in Task (#17407)

When Task was refactored in core to remove the defunct StackCrawlMark support, the code that captured ExecutionContext was moved from a helper into TaskConstructorCore.  In doing so, though, it was put at the beginning of TaskConstructorCore, even though in its previous location it would have come after the call to TaskConstructorCore.

That change of place is causing an assert to fire, validating that m_stateFlags is still 0, which is failing because if ExecutionContext.Capture() returns null due to flow being suppressed, the code that stores the context sets a bit into m_stateFlags (to be able to differentiate null meaning no state flowed and null meaning default).

The assert is correct, though, and a small bug did result from this: Task hasn't been entirely respecting ExecutionContext.SuppressFlow (which was added back in .NET Core 2.0), in that it won't flow the current context, but because it would overwrite that bit in m_stateFlags, it would treat a null ExecutionContext as default instead of as flow suppressed, and thus would use ExecutionContext.Default to invoke the Task's delegate.  That in turn means that any EC changes made by the Task's delegate wouldn't be visible to the caller, as EC.Run would be used.

The fix is simply to move the code to the end of TaskConstructorCore instead of having it at the beginning.

6 years agoCorrect the path to NuGet cache (#17400)
Jeremy Meng [Wed, 4 Apr 2018 19:01:05 +0000 (12:01 -0700)]
Correct the path to NuGet cache (#17400)

6 years agoUpdate CoreClr to preview3-26404-06 (#17408)
dotnet-maestro-bot [Wed, 4 Apr 2018 16:59:36 +0000 (11:59 -0500)]
Update CoreClr to preview3-26404-06 (#17408)

6 years ago[x86/Linux] Fix COMNumber::DoubleToNumberFC arguments order (#17412)
Konstantin Baladurin [Wed, 4 Apr 2018 16:38:22 +0000 (19:38 +0300)]
[x86/Linux] Fix COMNumber::DoubleToNumberFC arguments order (#17412)

We should use FCDECL3_VII/FCIMPL3_VII instead of FCDECL3/FCIMPL3
otherwise we got incorrect order of arguments that leads to crashes.

6 years agoConsolidate and optimize TextInfo.ChangeCase (#17391)
Stephen Toub [Wed, 4 Apr 2018 10:54:30 +0000 (03:54 -0700)]
Consolidate and optimize TextInfo.ChangeCase (#17391)

- Move most of the implementation to the platform-agnostic file, rather than having completely different implementations for Windows and Unix.  Now the only logic in each platform-specific file is the logic around invoking the associated P/Invoke.
- Optimize that implementation to take a fast path that doesn't allocate when no case change is needed, and to avoid the native call when the whole string is ASCII.

6 years agoAvoid unnecessary string allocations in IdnMapping (#17399)
Stephen Toub [Wed, 4 Apr 2018 10:53:46 +0000 (03:53 -0700)]
Avoid unnecessary string allocations in IdnMapping (#17399)

If the output matches the input string, we can just use the input string as the result.

6 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview3-02703-02, preview3-26404...
dotnet-maestro-bot [Wed, 4 Apr 2018 07:19:28 +0000 (02:19 -0500)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview3-02703-02, preview3-26404-01, preview3-26403-04, master-20180403-1552, respectively (#17383)

6 years agoMerge pull request #17372 from BruceForstall/ArmWriteBarrierTighten3
Bruce Forstall [Wed, 4 Apr 2018 01:50:45 +0000 (18:50 -0700)]
Merge pull request #17372 from BruceForstall/ArmWriteBarrierTighten3

Tighten arm32/arm64 write barrier kill reg sets

6 years agoRemove most ARM NYI (#17365)
Bruce Forstall [Tue, 3 Apr 2018 21:32:19 +0000 (14:32 -0700)]
Remove most ARM NYI (#17365)

* Remove most ARM NYI

Convert most existing ARM NYI either to asserts or remove
the code entirely.

A few NYI are left, including:
1. GT_BITCAST from 'int' to 'float'
2. initblk unrolling is unimplemented: https://github.com/dotnet/coreclr/issues/16349
3. SIMD-related NYI (SIMD is currently unimplemented)

6 years agoMerge pull request #17352 from sdmaclea/PR-ARM64-Add-x64_arm64-crossgen
Jarret Shook [Tue, 3 Apr 2018 17:10:38 +0000 (10:10 -0700)]
Merge pull request #17352 from sdmaclea/PR-ARM64-Add-x64_arm64-crossgen

[Arm64] Add x64_arm64 crossgen to tools package