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

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

6 years ago[arm64] Disable `a % b = a & (b - 1);` optimization. (#18206)
Sergey Andreenko [Fri, 1 Jun 2018 23:19:18 +0000 (16:19 -0700)]
[arm64] Disable `a % b = a & (b - 1);` optimization. (#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.

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.

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>
6 years agoAdded disassembler CoreDisTools to dump runtime functions (#18180)
Amy [Fri, 1 Jun 2018 20:44:28 +0000 (13:44 -0700)]
Added disassembler CoreDisTools to dump runtime functions (#18180)

Remove obsolete targets

Remove unused NewDiffer function, fix error with uninitialized declaringTypeHandle

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

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

6 years agoNative lib relative path (#18239)
Aaron Robinson [Fri, 1 Jun 2018 19:16:03 +0000 (12:16 -0700)]
Native lib relative path (#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

6 years agoFix GitHub_16041 test. (#18210)
Sergey Andreenko [Fri, 1 Jun 2018 18:08:33 +0000 (11:08 -0700)]
Fix GitHub_16041 test. (#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

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

6 years agoR2RDump - Commandline interface (#18136)
Amy [Fri, 1 Jun 2018 15:05:44 +0000 (08:05 -0700)]
R2RDump - Commandline interface (#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

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

Fix Managed Thread Name Setting

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

* Moves Stream to shared location

* Review tweaks

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

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

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

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

Fix HasPendingGCStressInstructionUpdate CONSISTENCY_CHECK

6 years agoArm stepping fixes (#18129)
Chris Sienkiewicz [Fri, 1 Jun 2018 00:04:59 +0000 (17:04 -0700)]
Arm stepping fixes (#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

6 years agoAdd additional features to SOS DumpAsync command (#18213)
Stephen Toub [Thu, 31 May 2018 21:09:41 +0000 (17:09 -0400)]
Add additional features to SOS DumpAsync command (#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
#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)

#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)

#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)

#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]])

#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
#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)

#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]])

#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
#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.
```

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

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

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

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

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

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

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).

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

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

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

Remove unused defines

6 years agoSupport new Japanese calendar eras (#18209)
Tarek Mahmoud Sayed [Thu, 31 May 2018 17:31:11 +0000 (10:31 -0700)]
Support new Japanese calendar eras (#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.

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

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 (#18207)

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

* Expose Exception.set_HResult as Public

* Remove internal Exception.SetErrorCode

6 years agoFix Managed Thread Name Setting
Vance Morrison [Wed, 30 May 2018 22:39:21 +0000 (15:39 -0700)]
Fix Managed Thread Name Setting

System.Thread has a  'Name' Property that will call the Windows OS SetThreadDescription that will give the thread that friendly name for debuggers and profilers.   However this code was broken in a couple ways.

First, it actually calls the  SetThreadDescription  with a null name when a thread is created (even if later the name is set.   Secondly, if the Thread.Name is set before the thread is actually started, then SetThreadDescription is not called at all.

This change fixes both of these issues.   First, when a thread is created it uses the Name property if it is set.   Second if the name property is set, it does not call SetThreadDescription if the Thread has not been created.   Third, it skips calls to SetThreadDescription if the name is null.

6 years agoMerge pull request #18173 from sdmaclea/PR-FIX-GCSTRESS-ASSERTION
Bruce Forstall [Wed, 30 May 2018 22:21:27 +0000 (15:21 -0700)]
Merge pull request #18173 from sdmaclea/PR-FIX-GCSTRESS-ASSERTION

Fix GCStress assertion

6 years agoRemove unused defines
Bruce Forstall [Wed, 30 May 2018 00:31:03 +0000 (17:31 -0700)]
Remove unused defines

More fallout from removing `LEGACY_BACKEND`.

6 years agoInline Span.CopyTo (#18006)
Ben Adams [Wed, 30 May 2018 18:03:04 +0000 (19:03 +0100)]
Inline Span.CopyTo (#18006)

6 years agoImprove the labeling of .NET Threads. (#18193)
Vance Morrison [Wed, 30 May 2018 12:38:21 +0000 (05:38 -0700)]
Improve the labeling of .NET Threads. (#18193)

There was already some support for labeling threads using the Window SetThreadDescription API, however it was missing some important cases (like labeling the ThreadPool and GC server and Background threads).   Fix this.   Also make the naming consistant (they all start with .NET).

These names show up in PerfView traces and can be used by debuggers or other profilers as well.

6 years agoMoves ArraySortHelper common code to shared location (#18125)
Marek Safar [Wed, 30 May 2018 12:37:36 +0000 (14:37 +0200)]
Moves ArraySortHelper common code to shared location (#18125)

6 years agoAdd sos DumpAsync command (#18160)
Stephen Toub [Wed, 30 May 2018 02:53:56 +0000 (22:53 -0400)]
Add sos DumpAsync command (#18160)

Debugging async methods with sos can be time consuming and relies on knowing how to use dumpheap, dumpvc, gcroot, and other commands to get the desired information, while often digging through a myriad of objects on the heap to find the desired info.

This commit adds a new DumpAsync command, which finds the async state machine objects on the GC heap and outputs relevant information about each, including the fields of its state machine, any registered continuation, and GC roots for the state machine object (as they often serve as a valid substitute for call stacks).

Example program used as a test:
```C#
using System.Threading.Tasks;

class Program
{
    static async Task Main() => await MethodA();
    static async Task MethodA() => await MethodB();
    static async Task MethodB() => await MethodC();
    static async Task MethodC() => await MethodD();
    static async Task MethodD() => await Task.Delay(int.MaxValue);
}
```
and example command output:
```
0:011> !DumpAsync -type MethodD
         Address               MT     Size Name
000001989f413de0 00007ff88c506ba8      112  System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodD>d__4, test]]
StateMachine: Program+<MethodD>d__4
              MT    Field   Offset                 Type VT     Attr            Value Name
00007ff8d3df4b80  400000d        0         System.Int32  1 instance                0 <>1__state
00007ff8d3e082c0  400000e        8 ...TaskMethodBuilder  1 instance 000001989f413e38 <>t__builder
00007ff8d3dfea90  400000f       10 ...vices.TaskAwaiter  1 instance 000001989f413e40 <>u__1
Continuation: 000001989f413e50 (System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodC>d__3, test]])
GC roots:
    Thread 2936c:
        000000071a37e050 00007ff8d3ac1657 System.Threading.Tasks.Task.SpinThenBlockingWait(Int32, System.Threading.CancellationToken) [d:\repos\coreclr\src\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs @ 2977]
            rbp+10: 000000071a37e0c0
                ->  000001989f413fa0 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<Main>d__0, test]]
                ->  000001989f413f30 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodA>d__1, test]]
                ->  000001989f413ec0 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodB>d__2, test]]
                ->  000001989f413e50 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodC>d__3, test]]
                ->  000001989f413de0 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodD>d__4, test]]

    HandleTable:
        000001989d8415f8 (pinned handle)
        -> 00000198af3e1038 System.Object[]
        -> 000001989f413410 System.Threading.TimerQueue[]
        -> 000001989f413468 System.Threading.TimerQueue
        -> 000001989f413330 System.Threading.TimerQueueTimer
        -> 000001989f412e40 System.Threading.Tasks.Task+DelayPromise
        -> 000001989f413de0 System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1+AsyncStateMachineBox`1[[System.Threading.Tasks.VoidTaskResult, System.Private.CoreLib],[Program+<MethodD>d__4, test]]

Found 1 state machines.
```

6 years agoMerge pull request #18118 from sdmaclea/PR-ARM64-compFloatingPointUsed
Carol Eidt [Wed, 30 May 2018 00:11:17 +0000 (17:11 -0700)]
Merge pull request #18118 from sdmaclea/PR-ARM64-compFloatingPointUsed

[Arm64] Set compFloatingPointUsed for SIMD HWIntrincsics

6 years agoUpdate BuildTools to preview1-02829-01 (#18171)
dotnet-maestro-bot [Tue, 29 May 2018 23:13:48 +0000 (16:13 -0700)]
Update BuildTools to preview1-02829-01 (#18171)

6 years agoMoving common logic of StackFrame into shared (#18134)
Maryam Ariyan [Tue, 29 May 2018 23:13:13 +0000 (16:13 -0700)]
Moving common logic of StackFrame into shared (#18134)

Related to: #9474

6 years agoFix GCStress assertion
Steve MacLean [Tue, 29 May 2018 17:35:03 +0000 (13:35 -0400)]
Fix GCStress assertion

6 years agoMerge pull request #18127 from CarolEidt/StructAbiDoc
Carol Eidt [Tue, 29 May 2018 19:01:36 +0000 (12:01 -0700)]
Merge pull request #18127 from CarolEidt/StructAbiDoc

Design doc for struct passing

6 years agoDesign doc for struct passing
Carol Eidt [Fri, 25 May 2018 17:53:18 +0000 (10:53 -0700)]
Design doc for struct passing

6 years agoamend call (#18159)
Marco Rossignoli [Tue, 29 May 2018 18:11:25 +0000 (20:11 +0200)]
amend call (#18159)

6 years agoUpdate CoreClr, CoreFx, PgoData to preview1-26529-04, preview1-26529-04, master-20180...
dotnet-maestro-bot [Tue, 29 May 2018 16:00:34 +0000 (09:00 -0700)]
Update CoreClr, CoreFx, PgoData to preview1-26529-04, preview1-26529-04, master-20180529-0053, respectively (#18139)

6 years agoBOTR: Ensure generic params/args are rendered properly (#18140)
stakx [Mon, 28 May 2018 15:25:14 +0000 (17:25 +0200)]
BOTR: Ensure generic params/args are rendered properly (#18140)

* BOTR: Ensure generic params/args are rendered properly

* Use inline code formatting for managed code

* Use inline code formatting for unmanaged code

6 years agoTypo (#18141)
John Doe [Sun, 27 May 2018 14:34:51 +0000 (07:34 -0700)]
Typo (#18141)

* Ajusted -> Adjusted

* alot -> a lot

* Ambigous -> Ambiguous

* amoun -> amount

* amoung -> among

* Amperstand -> Ampersand

* Anbody -> Anybody

* anddoens't ->  and doesn't

* anme -> name

* annoations -> annotations

* annother -> another

* anothr -> another

* ansynchronous -> asynchronous

* anticpation -> anticipation

* anway -> anyway

* aother -> another

* Apparant -> Apparent

* appartment -> apartment

* appdmomain -> appdomain

* Appdomian -> Appdomain

* appdomin -> appdomain

* approproiate -> appropriate

* approprate -> appropriate

* approp -> appropriate

* appened -> appended

* appropiately -> appropriately

* appropraitely -> appropriately

* Apperantly -> Apparently

* approp. -> appropriate

* Approriate -> Appropriate

6 years agoUpdate CoreClr, CoreFx to preview1-26526-01, preview1-26526-01, respectively (#18135)
dotnet-maestro-bot [Sat, 26 May 2018 06:35:32 +0000 (23:35 -0700)]
Update CoreClr, CoreFx to preview1-26526-01, preview1-26526-01, respectively (#18135)

6 years agoUpdating the compiler to not enable FMA if the global AVX flag is disabled.
Tanner Gooding [Thu, 24 May 2018 17:10:28 +0000 (10:10 -0700)]
Updating the compiler to not enable FMA if the global AVX flag is disabled.

6 years agoAdding tests for the FMA hardware intrinsics.
Tanner Gooding [Sun, 20 May 2018 20:10:38 +0000 (13:10 -0700)]
Adding tests for the FMA hardware intrinsics.

6 years agoUpdating the JIT to handle the FMA hardware intrinsics.
Tanner Gooding [Wed, 23 May 2018 18:20:29 +0000 (11:20 -0700)]
Updating the JIT to handle the FMA hardware intrinsics.

6 years agoAdd mixed-mode Book of the Runtime entry (#18014)
Morgan Brown [Fri, 25 May 2018 23:00:44 +0000 (16:00 -0700)]
Add mixed-mode Book of the Runtime entry (#18014)

* Add mixed-mode Book of the Runtime entry

Documents how mixed-mode assemblies are specified and work in general.

6 years agodelete unused variables from jit (#18121)
Sergey Andreenko [Fri, 25 May 2018 22:02:20 +0000 (15:02 -0700)]
delete unused variables from jit (#18121)

6 years agoMerge pull request #18126 from CarolEidt/FixSuperPmi
Carol Eidt [Fri, 25 May 2018 21:59:05 +0000 (14:59 -0700)]
Merge pull request #18126 from CarolEidt/FixSuperPmi

Check SuperPmi map for null

6 years agoCheck SuperPmi map for null
Carol Eidt [Fri, 25 May 2018 17:30:46 +0000 (10:30 -0700)]
Check SuperPmi map for null

On Linux, calling an instance method with a null `this` pointer causes a seg fault.
This fixes the case of querying the `CanInlineTypeCheckWithObjectVTable` map in SuperPmi when no query has been recorded by `recCanInlineTypeCheckWithObjectVTable`. There appear to be other cases of this, but this is the one that I'm running into currently.

6 years agoUpdate CoreClr, PgoData to preview1-26525-04, master-20180525-0042, respectively...
dotnet-maestro-bot [Fri, 25 May 2018 15:17:50 +0000 (08:17 -0700)]
Update CoreClr, PgoData to preview1-26525-04, master-20180525-0042, respectively (#18124)

6 years agoTypo (#18122)
John Doe [Fri, 25 May 2018 06:22:42 +0000 (23:22 -0700)]
Typo (#18122)

* acquringing -> acquiring

* Activ -> Active

* activley -> actively

* acutal -> actual

* bIncomingIPAdddefed -> bIncomingIPAddRefed

* adddr -> addr

* readding -> reading

* Addfunction -> AddFunction

* additionnal -> additional

* Additonal -> Additional

* Additonally -> Additionally

* Addresss -> Address

* addtion -> addition

* aded -> added

* aditional -> additional

* adjustements -> adjustments

* Adress -> Address

* afer -> after

* aformentioned -> aforementioned

* afte -> after

* agains -> against

* agaisnt -> against

* aggresively -> aggressively

* aggreates -> aggregates

* aggregious -> egregious

* aginst -> against

* agregates -> aggregates

* Agressive -> Aggressive

* ahve -> have

* ajdust -> adjust

* ajust -> adjust

* alement -> element

* algoritm -> algorithm

* alighnment -> alignment

* alignmant -> alignment

* constraits -> constraints

* Allcator -> Allocator

* alllocate -> allocate

* alloacted -> allocated

* allocatate -> allocate

* allocatoror -> allocator

* alloctaed -> allocated

* alloction -> allocation

* alloted -> allotted

* allt he -> all the

* alltogether -> altogether

* alocate -> allocate

* alocated -> allocated

* Alocates -> Allocates

* alogrithm -> algorithm

* aloocate -> allocate

* alot -> a lot

* alwasy -> always

* alwyas -> always

* alwys -> always

6 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview1-02824-02, preview1-26525...
dotnet-maestro-bot [Fri, 25 May 2018 06:13:38 +0000 (23:13 -0700)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview1-02824-02, preview1-26525-01, preview1-26525-01, master-20180524-0023, respectively (#18109)

6 years agoFix misplaced volatile (#18115)
Jan Kotas [Fri, 25 May 2018 01:18:56 +0000 (18:18 -0700)]
Fix misplaced volatile (#18115)

Fixes #13015

6 years agoUpdating BuildDelayFreeUses to also consider contained HWIntrinsic nodes.
Tanner Gooding [Thu, 24 May 2018 21:21:12 +0000 (14:21 -0700)]
Updating BuildDelayFreeUses to also consider contained HWIntrinsic nodes.

6 years ago[Arm64] Set compFloatingPointUsed for SIMD HWIntrincsics
Steve MacLean [Thu, 24 May 2018 18:47:12 +0000 (14:47 -0400)]
[Arm64] Set compFloatingPointUsed for SIMD HWIntrincsics

6 years agoMerge pull request #18103 from vancem/StringBuilderEnumeratorUpdate
Vance Morrison [Thu, 24 May 2018 21:52:35 +0000 (14:52 -0700)]
Merge pull request #18103 from vancem/StringBuilderEnumeratorUpdate

Add more comments and rename to StringBuilder.GetChunks()

6 years ago[Arm64] debugging work (#17993)
David Wrighton [Thu, 24 May 2018 21:35:47 +0000 (14:35 -0700)]
[Arm64] debugging work (#17993)

* Fix missing implementation of FuncEvalFrame::UpdateRegDisplay for ARM64
- Implementation is missing. Build new one based ARM implementation

* Enable just my code on arm64

* Fix logging of addresses for DispatchPatchOrSingleStep

* arm64 does not leave the PC at the start of the breakpoint

* Enable interop debugging

* Tweaks for windows arm64 mixed mode debugging support

6 years agoUse sysconf(_SC_NPROCESSORS_CONF) instead of sysconf(_SC_NPROCESSORS_ONLN) (#18053)
Egor Chesakov [Thu, 24 May 2018 20:57:47 +0000 (13:57 -0700)]
Use sysconf(_SC_NPROCESSORS_CONF) instead of sysconf(_SC_NPROCESSORS_ONLN) (#18053)

6 years agoImprove SSA topological sort (#15200)
mikedn [Thu, 24 May 2018 19:01:41 +0000 (22:01 +0300)]
Improve SSA topological sort (#15200)

* Simplify block successor iterators

Construction of an end AllSuccessorIter requires the number of block successors. This can be avoided by keeping track of the number of remaining successors so that the end iterator is simply "0 remaining successors".

Remove StartAllSuccs & co. These functions don't do anything useful.

Since AllSuccessorIter and EHSuccessorIter now have similar constructors the "collection" classes AllSuccs and EHSuccs can be replaced by a single template class.

* Split out block successor iterator logic

The AllSuccessorIterator iterator is pretty large - 64 bytes on 64 bit hosts. When used as local variables that's not much of a problem but if they end up stored in containers then a lot of space is wasted.

AllSuccessorIter contains a pointer to the compiler object and a pointer to the block whose successors it iterates over. And then it also contains an EHSuccessorIter that contains the same 2 pointers.

In scenarios such as the one in SsaBuilder::TopologicalSort the compiler pointer need not be stored and the block needs to be stored only once and be made accessible so a separate block stack isn't needed.

This change splits out the successor iterating logic into separate "position" classes that receieve the compiler and block via function parameters.

* Improve TopologicalSort memory usage

6 years agoRename EnumerateCHunks -> GetChunks per API review feedback.
Vance Morrison [Thu, 24 May 2018 18:01:46 +0000 (11:01 -0700)]
Rename EnumerateCHunks -> GetChunks per API review feedback.

6 years agoRealigning the hwintrinsiclistxarch table columns
Tanner Gooding [Thu, 24 May 2018 14:47:06 +0000 (07:47 -0700)]
Realigning the hwintrinsiclistxarch table columns

6 years agoFix a variety of typos (#18096)
John Doe [Thu, 24 May 2018 14:43:42 +0000 (07:43 -0700)]
Fix a variety of typos (#18096)

* absense -> absence

* aboring -> aborting

* absense -> absence

* absoute -> absolute

* absoute -> absolute

* abstration -> abstraction

* dwDesiredAcces -> dwDesiredAccess

* accees -> access

* accesed -> accessed

* accessability -> accessibility

* accessable -> accessible

* accidentaly -> accidentally

* accesible -> accessible

* accommondate -> accommodate

* accurancy -> accuracy

* accuratley -> accurately

* Achitecture -> Architecture

* acompannying -> accompanying

* acordingly -> accordingly

6 years agoOptimize Array.Clear using SpanHelpers (#18101)
Jan Kotas [Thu, 24 May 2018 14:07:20 +0000 (07:07 -0700)]
Optimize Array.Clear using SpanHelpers (#18101)

Reimplement most of Array.Clear in managed code using Span Clear helpers.

Fixes dotnet/corefx#29848

6 years agoUpdate g_highest_address and g_lowest_address in StompWriteBarrier(WriteBarrierOp...
Egor Chesakov [Thu, 24 May 2018 13:08:26 +0000 (06:08 -0700)]
Update g_highest_address and g_lowest_address in StompWriteBarrier(WriteBarrierOp::StompResize) on ARM (#18107)

6 years agosharing SerializationInfo for corert and coreclr (#18102)
Maryam Ariyan [Thu, 24 May 2018 06:04:14 +0000 (23:04 -0700)]
sharing SerializationInfo for corert and coreclr (#18102)

* String to string in SerializationInfo

* Object to object in SerializationInfo

* Reducing diff between coreclr and corefx by renaming some variables.

* Reducing diff for SerializationInfo by simplifying code

* More cleanup
- Removing unused fields and making internals private.
- Removing unused namespaces
- Merge some comments

* Fixing up commets and removing object from object.ReferenceEquals(..)

* Minor fixups

* Moving to shared

* Applying PR feedbacks

* using IsRuntimeImplemented helper method for type

* using the CoreRT version and keeping ctor with extra argument

6 years agoMerge pull request #18011 from CarolEidt/JitOptDoc
Carol Eidt [Thu, 24 May 2018 03:45:29 +0000 (20:45 -0700)]
Merge pull request #18011 from CarolEidt/JitOptDoc

Update struct handling section of Jit Opt Doc

6 years agoUpdate struct handling section of Jit Opt Doc
Carol Eidt [Tue, 15 May 2018 22:02:03 +0000 (15:02 -0700)]
Update struct handling section of Jit Opt Doc

6 years agoR2RDump - Dump generic method instances (#18080)
acmyu [Thu, 24 May 2018 00:24:03 +0000 (17:24 -0700)]
R2RDump - Dump generic method instances (#18080)

* R2RDump - dump generic method instances

* Added comments

* Move read functions to own class, changes to NativeHashtable to make it similar to NativeFormatReader

* Get type name for struct generic instances

* Emit # of runtimeFunctions and size:unavailable, add [Flags] to enum and NONE flag

* Throw exception when method entrypoint id is out of bounds

* Type name instead of var

* Get full classname including namespace

* Get parent types of nested types

* Save DeclaringType as string, rename variables, use 1 constructor

* Check generic param indices not out of bounds

6 years agoCleaning up LinearScan::BuildHWIntrinsic
Tanner Gooding [Wed, 23 May 2018 17:47:44 +0000 (10:47 -0700)]
Cleaning up LinearScan::BuildHWIntrinsic

6 years agoAdd more comments to StringBuilder.EnumerateChunks()
Vance Morrison [Wed, 23 May 2018 21:03:16 +0000 (14:03 -0700)]
Add more comments to StringBuilder.EnumerateChunks()

This does not change execution of the code (only comments, placement)

Added a warning about modifying the stringbuilder while enumerating.

6 years agoRefactor fgDebugCheckBBlist (#18082)
Sergey Andreenko [Wed, 23 May 2018 20:52:15 +0000 (13:52 -0700)]
Refactor fgDebugCheckBBlist (#18082)

create BBPredsChecker

6 years agoSOS Fixes for windows arm32 (#18090)
Chris Sienkiewicz [Wed, 23 May 2018 17:39:56 +0000 (10:39 -0700)]
SOS Fixes for windows arm32 (#18090)

6 years agoMerge pull request #18079 from dotnet-maestro-bot/master-UpdateDependencies
Wes Haggard [Wed, 23 May 2018 17:29:28 +0000 (10:29 -0700)]
Merge pull request #18079 from dotnet-maestro-bot/master-UpdateDependencies

Update BuildTools, CoreClr, CoreFx, PgoData to preview1-02823-01, preview1-26523-04, preview1-26523-05, master-20180523-0040, respectively (master)

6 years agoFix parallel spmi return code. (#18093)
Sergey Andreenko [Wed, 23 May 2018 17:23:18 +0000 (10:23 -0700)]
Fix parallel spmi return code. (#18093)

6 years agoMerge pull request #18099 from CarolEidt/FixEliminNodeInfo
Carol Eidt [Wed, 23 May 2018 16:58:49 +0000 (09:58 -0700)]
Merge pull request #18099 from CarolEidt/FixEliminNodeInfo

Fix desktop build break

6 years agoFix desktop build break
Carol Eidt [Wed, 23 May 2018 15:02:59 +0000 (08:02 -0700)]
Fix desktop build break

6 years agoMerge pull request #18086 from sdmaclea/PR-delete_next_card_table
Bruce Forstall [Wed, 23 May 2018 14:53:12 +0000 (07:53 -0700)]
Merge pull request #18086 from sdmaclea/PR-delete_next_card_table

Mark delete_next_card_table

6 years agoCreate RefPositions without TreeNodeInfo (#16517)
Carol Eidt [Wed, 23 May 2018 14:39:43 +0000 (07:39 -0700)]
Create RefPositions without TreeNodeInfo (#16517)

* Create RefPositions without TreeNodeInfo

* Remove all references to TreeNodeInfo

* Fix function header comments

6 years agoMerge pull request #18087 from BruceForstall/RemoveMoreLEGACY_BACKEND
Bruce Forstall [Wed, 23 May 2018 14:33:57 +0000 (07:33 -0700)]
Merge pull request #18087 from BruceForstall/RemoveMoreLEGACY_BACKEND

Remove more JIT LEGACY_BACKEND tendrils

6 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview1-02823-01, preview1-26523...
dotnet-maestro-bot [Wed, 23 May 2018 14:14:08 +0000 (07:14 -0700)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview1-02823-01, preview1-26523-04, preview1-26523-05, master-20180523-0040, respectively

6 years agoFix race in test waitone1 (#18085)
Steve MacLean [Wed, 23 May 2018 08:57:42 +0000 (04:57 -0400)]
Fix race in test waitone1 (#18085)

6 years agoRemove more JIT LEGACY_BACKEND tendrils
Bruce Forstall [Tue, 22 May 2018 21:25:34 +0000 (14:25 -0700)]
Remove more JIT LEGACY_BACKEND tendrils

1. Remove armlb testing from netci.groovy
2. Remove legacy jit exclusions from tests.lst
3. Remove some unused `LEGACY_BACKEND` build definitions
4. Remove regpair.h

6 years agofix desktop (#18092)
Sergey Andreenko [Wed, 23 May 2018 02:38:44 +0000 (19:38 -0700)]
fix desktop (#18092)

6 years agoRemove -Rebuild option from build scripts (#18089)
Brian Robbins [Wed, 23 May 2018 02:13:20 +0000 (19:13 -0700)]
Remove -Rebuild option from build scripts (#18089)

6 years agoadd treeLifeUpdater (#18021)
dotnet bot [Wed, 23 May 2018 00:47:42 +0000 (17:47 -0700)]
add treeLifeUpdater (#18021)

[tfs-changeset: 1700288]

6 years agoMerge pull request #17530 from vancem/StringBuilderEnumerator
Vance Morrison [Tue, 22 May 2018 23:07:45 +0000 (16:07 -0700)]
Merge pull request #17530 from vancem/StringBuilderEnumerator

Adding EnumerateChunks which allow efficient scanning of a StringBuilder

6 years agoRemove JIT LEGACY_BACKEND code (#18064)
Bruce Forstall [Tue, 22 May 2018 20:50:38 +0000 (13:50 -0700)]
Remove JIT LEGACY_BACKEND code (#18064)

Remove JIT LEGACY_BACKEND code

All code related to the LEGACY_BACKEND JIT is removed. This includes all code related to x87 floating-point code generation. Almost 50,000 lines of code have been removed.

Remove legacyjit/legacynonjit directories

Remove reg pairs

Remove tiny instruction descriptors

Remove compCanUseSSE2 (it's always true)

Remove unused FEATURE_FP_REGALLOC

6 years agoMark delete_next_card_table
Steve MacLean [Tue, 22 May 2018 19:29:51 +0000 (15:29 -0400)]
Mark delete_next_card_table

GCStressIncompatible=true
IsLongRunningGCTest=true

6 years agoMove InsufficientMemory, OutOfMemory and ThreadInterrupted exceptions (#18049)
Maryam Ariyan [Tue, 22 May 2018 18:26:07 +0000 (11:26 -0700)]
Move InsufficientMemory, OutOfMemory and ThreadInterrupted exceptions (#18049)

* Move following exceptions to shared:

    - InsufficientMemory,
    - OutOfMemory
    - ThreadInterrupted

Related to: dotnet/coreclr#17904

Reduced diff in RegistryKey visible between coreclr and corert

6 years agoFixe whitespace
Vance Morrison [Tue, 22 May 2018 18:25:01 +0000 (11:25 -0700)]
Fixe whitespace

6 years agoFix whitespace
Vance Morrison [Tue, 22 May 2018 18:18:36 +0000 (11:18 -0700)]
Fix whitespace

6 years agoFix attribute placement
Vance Morrison [Tue, 22 May 2018 18:16:05 +0000 (11:16 -0700)]
Fix attribute placement

6 years agoCollapse ChunkEnumerable and ChunkEnumerator.
Vance Morrison [Tue, 22 May 2018 17:55:16 +0000 (10:55 -0700)]
Collapse ChunkEnumerable and ChunkEnumerator.