Andy Ayers [Thu, 25 Feb 2016 00:14:32 +0000 (16:14 -0800)]
InlineRefactoring: capturing bits of legacy policy
Rework the logic for force inline, basic block count, il size,
and maxstack so that the policy decides when these values
should inhibit inlining.
Commit migrated from https://github.com/dotnet/coreclr/commit/
14120d399fa46844bd60c66b5b4bdb4c5ed6435d
Andy Ayers [Thu, 25 Feb 2016 21:07:43 +0000 (13:07 -0800)]
Merge pull request dotnet/coreclr#3346 from AndyAyersMS/InlineRefactor5a1
Inline Refactoring: set up policy for bad inlinees
Commit migrated from https://github.com/dotnet/coreclr/commit/
d7f2265ca022f780a632918ae642fb4d3986064e
tijoytom [Thu, 25 Feb 2016 20:04:10 +0000 (12:04 -0800)]
Merge pull request dotnet/coreclr#3314 from tijoytom/master
Adding more interop tests.
Commit migrated from https://github.com/dotnet/coreclr/commit/
306a27c807b34593aa3f77bfd729c594e65a8845
Andy Ayers [Tue, 23 Feb 2016 23:21:22 +0000 (15:21 -0800)]
Inline Refactoring: set up policy for bad inlinees
Move inline policies to their own header and cpp file.
Add a method to the policy class to indicate if the policy wants newly
discovered `Never` inline cases to change the callee method attributes
to Noinline. This is an existing optimization that saves time when the
jit sees calls to this callee elsewhere as a possible inline candidates.
For example, in the trace below, at for the call at offset 31, the jit
determines that `ToInt32` is too large to be inlined and so marks it as
noinline. Then when it sees another call to `ToInt31` at offset 44 it
immediately fails the inline attempt.
```
Inlines into RegistryTimeZoneInformation:.ctor(ref):this
...
[IL=0031 TR=000040] [FAILED: too many il bytes] System.BitConverter:ToInt32(ref,int):int
[IL=0044 TR=000049] [FAILED: noinline per IL/cached result] System.BitConverter:ToInt32(ref,int):int
[IL=0057 TR=000058] [FAILED: noinline per IL/cached result] System.BitConverter:ToInt32(ref,int):int
```
Diagnostic and experimental policies may choose to disable this
optimization to make it easier to locally reason about failed inlines.
There were 5 calls to `setMethodAttribs` passing `CORINFO_FLG_BAD_INLINEE`.
This change consolidates 4 of them into the inlining code. The remaining
call is for a method with verification errors. I've left it as is.
Commit migrated from https://github.com/dotnet/coreclr/commit/
99927794a53ed68b1a55ddba238eff809be79fdc
Jan Kotas [Thu, 25 Feb 2016 17:40:59 +0000 (09:40 -0800)]
Merge pull request dotnet/coreclr#3356 from bendono/PowerShell
Validate PowerShell prerequisite. Update documentation. -- Issue dotnet/coreclr#3355
Commit migrated from https://github.com/dotnet/coreclr/commit/
97545d6f772546e4737c112007d687c6fbc640b4
Jan Kotas [Thu, 25 Feb 2016 17:09:09 +0000 (09:09 -0800)]
Merge pull request dotnet/coreclr#3358 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
7a6d8a44c0a2f8d3f431c58aa77b95f15f212756
Ben Monroe [Thu, 25 Feb 2016 12:51:35 +0000 (21:51 +0900)]
Validate PowerShell prerequisite. Update documentation.
Commit migrated from https://github.com/dotnet/coreclr/commit/
70749779abb4994ef4087f305c41ee14ca495e0b
Pat Gavlin [Thu, 25 Feb 2016 15:19:33 +0000 (07:19 -0800)]
Add a new set of APIs for JIT configuration.
These APIs accommodate the retrieval of config values using the JIT
interface rather than the utilcode library. All configuration options
are now initialized upon the first call to compileMethod. The values
of configuration options are available off of an ambient JitConfig
object.
This also changed `JitHost::get*ConfigValue` to use the
`EEConfig_default` policy instead of `REGUTIL_default` in order to
avoid breaking a small set of JIT config options available in release
builds that were using the former. This change is exceedingly
unlikely to adversely affect the behavior of other JIT config options
that were originally fetched using `REGUTIL_default`, since values
for these options should not be present any locations searched
by `EEConfig_default` that are not searched by
`REGUTIL_default` (namely config files).
[tfs-changeset: 1578859]
Commit migrated from https://github.com/dotnet/coreclr/commit/
d2b9a6e8bae487ae092fca2d3bccd109c7ef85f9
Jan Kotas [Thu, 25 Feb 2016 14:29:11 +0000 (06:29 -0800)]
Merge pull request dotnet/coreclr#3354 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
c3b883ca33c1080ec65815684aabce462624b1b4
Jan Kotas [Thu, 25 Feb 2016 14:28:59 +0000 (06:28 -0800)]
Merge pull request dotnet/coreclr#3353 from jkotas/gc-update
Update GC from CoreRT
Commit migrated from https://github.com/dotnet/coreclr/commit/
743751d4569efb02749ae8304e1bd3f64f4899b3
Jan Kotas [Thu, 25 Feb 2016 07:59:25 +0000 (23:59 -0800)]
Merge pull request dotnet/coreclr#3335 from dotnet-bot/from-tfs
Merge changes from TFS
Commit migrated from https://github.com/dotnet/coreclr/commit/
41fcf5dc470e704243693b63ebf546fd7dcc614d
Jan Kotas [Thu, 25 Feb 2016 07:53:11 +0000 (23:53 -0800)]
Fixes for GC update
Commit migrated from https://github.com/dotnet/coreclr/commit/
a1775a988af161a8268d7269c432246aad486a93
Jan Kotas [Thu, 25 Feb 2016 07:01:24 +0000 (23:01 -0800)]
Workaround missing UrlEscape
Commit migrated from https://github.com/dotnet/coreclr/commit/
0870772cad98e2606136cf4a9d66874a1c613722
Jan Kotas [Thu, 25 Feb 2016 06:41:19 +0000 (22:41 -0800)]
Update GC from CoreRT
https://github.com/dotnet/corert/tree/master/src/Native/gc dotnet/coreclr@
d18f7e5d9fea784b4531aa8988fdad9f3a9cffc3
Commit migrated from https://github.com/dotnet/coreclr/commit/
e1fd6dc6d5adf7c4107e60fdb8a6bcb5fc57069f
Jan Kotas [Thu, 25 Feb 2016 06:24:59 +0000 (22:24 -0800)]
Fix build break - add precompiled header
Commit migrated from https://github.com/dotnet/coreclr/commit/
4ab569915e02a4c314a772a43732d58fa67ebeff
Jan Kotas [Thu, 25 Feb 2016 06:07:57 +0000 (22:07 -0800)]
Merge pull request dotnet/coreclr#3339 from RussKeldorph/msvcrt
Replace reference to msvcr110.dll with msvcrt.dll in test b286991
Commit migrated from https://github.com/dotnet/coreclr/commit/
81e977ce7be76c4bda86aeb952d13dc136998341
Jan Kotas [Thu, 25 Feb 2016 04:28:57 +0000 (20:28 -0800)]
Merge pull request dotnet/coreclr#3334 from brianrob/perfmap_crossgen_r2r
Fix PerfMap::GetNativeImageSignature to work for ready to run images
Commit migrated from https://github.com/dotnet/coreclr/commit/
f89218fcb92c45b0fb045bf61253991b5cbd5883
Carol Eidt [Thu, 25 Feb 2016 04:18:43 +0000 (20:18 -0800)]
Merge pull request dotnet/coreclr#3296 from CarolEidt/NonLeafLongOpnd3292
Handle long operators with non-leaf operands
Commit migrated from https://github.com/dotnet/coreclr/commit/
47489e02d035e207d89f54bf7714c33e24a04882
Jan Kotas [Thu, 25 Feb 2016 03:06:19 +0000 (19:06 -0800)]
Merge pull request dotnet/coreclr#3340 from stephentoub/debuggernotify_model
Ensure Debugger.NotifyOfCrossthreadDependency is exposed from mscorlib
Commit migrated from https://github.com/dotnet/coreclr/commit/
b41c31be22c217c14a2d25ec9f9649bb5f28d6ea
Jan Kotas [Thu, 25 Feb 2016 03:06:04 +0000 (19:06 -0800)]
Merge pull request dotnet/coreclr#3341 from jkotas/tokenkind-newobj
Add CORINFO_TOKENKIND_NewObj
Commit migrated from https://github.com/dotnet/coreclr/commit/
c707b0d874b671bd7316a1525f999708f5185901
Jan Kotas [Thu, 25 Feb 2016 02:15:11 +0000 (18:15 -0800)]
Merge pull request dotnet/coreclr#3331 from brianrob/crossgen_perfmap
Update Crossgen /CreatePerfMap to clear NGENWORKER_FLAGS_READYTORUN
Commit migrated from https://github.com/dotnet/coreclr/commit/
68569db603a6a0ff3a1414648a0e2b4ea0f870ce
Jan Kotas [Thu, 25 Feb 2016 00:58:56 +0000 (16:58 -0800)]
Merge pull request dotnet/coreclr#3348 from JohnChen0/master
Fix .gitignore so src/tools is not ignored
Commit migrated from https://github.com/dotnet/coreclr/commit/
fd3b7660e8374d4388d25edb507526c0b960d535
Pat Gavlin [Thu, 25 Feb 2016 00:29:55 +0000 (16:29 -0800)]
Merge pull request dotnet/coreclr#3333 from pgavlin/JitAllocatorCleanup
Remove dead definitions in alloc.h.
Commit migrated from https://github.com/dotnet/coreclr/commit/
b3492ccb912ea1e13c4f89e7ecc66b5023177733
Sivarv [Wed, 24 Feb 2016 23:56:25 +0000 (15:56 -0800)]
Merge pull request dotnet/coreclr#3345 from sivarv/vector3fix
Fix to second CoreFX SIMD test failure mentioned in issue dotnet/coreclr#2886.
Commit migrated from https://github.com/dotnet/coreclr/commit/
5d85c07b48ec44975e16eb6a0c22d2ccc16f7f1f
Rahul Kumar [Wed, 24 Feb 2016 21:30:48 +0000 (13:30 -0800)]
Merge pull request dotnet/coreclr#3343 from rahku/Helix
Helix testing : Add xunit.performance.core to core_root. required for few jit tests
Commit migrated from https://github.com/dotnet/coreclr/commit/
0d88461f079c94cce1dbfc005b41d88cf0bc124c
sivarv [Wed, 24 Feb 2016 19:26:15 +0000 (11:26 -0800)]
Fix to second CoreFX SIMD test failure mentioned in issue dotnet/coreclr#2886.
Root Cause:
The following managed method is executed by the test
Vector3 Vecor3.Normalize(Vector3)
Vector3 on Unix gets passed in two registers by caller of Normalize()
method. Within prolog of Normalie(), RyuJIt homes Vector3 arg by
writing only 12 bytes of arg regs xmm0/xmm1. As a result the upper
4-bytes could end up garbage. Further down test performs dot product
and the codegen of which makes the assumption that Vector3 types
when loaded in regs will have upper 4-bytes zero'ed out. Since
that assumption is violated, incorrect results gets computed and
hence CoreFx test failure not fiding expected result.
Fix: While homing Vector3 arg treat it as TYP_SIMD16 and home
16-bytes of arg regs xmm0/xmm1.
Also added a TODO comment on the assumptions RyuJIT is making on
Vector3 type. Will be opening a Git issue for the same.
Commit migrated from https://github.com/dotnet/coreclr/commit/
c12afaa189db63f67720c64e792e9846a58d7604
Andy Ayers [Wed, 24 Feb 2016 18:41:21 +0000 (10:41 -0800)]
Merge pull request dotnet/coreclr#3315 from AndyAyersMS/InlineRefactor5
InlineRefactoring: introducing InlinePolicy
Commit migrated from https://github.com/dotnet/coreclr/commit/
71106b6403a3497a3742d0e7b788b81098a9b007
Jan Kotas [Wed, 24 Feb 2016 17:23:01 +0000 (09:23 -0800)]
Merge pull request dotnet/coreclr#3233 from vancem/RemoveSecurityCheck
Revert "Revert "Remove useless security checks""
Commit migrated from https://github.com/dotnet/coreclr/commit/
dbff91b27458ee1472ea4ed3f68f49e40b3df5ed
Kyungwoo Lee [Wed, 24 Feb 2016 17:14:48 +0000 (09:14 -0800)]
Merge pull request dotnet/coreclr#3316 from kyulee1/fixmustexpand
Fix for pMustExpand early fail.
Commit migrated from https://github.com/dotnet/coreclr/commit/
4c3193cbda64ed2be1354a1ca739c9eed84cfeeb
dotnet-bot [Wed, 24 Feb 2016 16:51:21 +0000 (08:51 -0800)]
Fix for Bug 192726:[amd64][ilGen] gtVNPair_GetLiberal assert
The previously added asserts in fgMorph about valid value numbers are not always true. In the failing case, it turned out a GT_COMMA came out of fgMorph after value numbering did have a NoVN value number. The fix here is to simply remove the asserts since the code there does not really care about what value numbers the child expressions have.
[tfs-changeset: 1578470]
Commit migrated from https://github.com/dotnet/coreclr/commit/
5417290155cc3fd6e9f6fbf58d95da11e0d89179
Jan Kotas [Wed, 24 Feb 2016 16:07:23 +0000 (08:07 -0800)]
Add CORINFO_TOKENKIND_NewObj
CoreRT implementation of the JIT-EE interface needs to know whether the token is coming from newobj instruction
Commit migrated from https://github.com/dotnet/coreclr/commit/
0f48c5d718b66689bd269bb3d47239ea94562da3
stephentoub [Wed, 24 Feb 2016 16:03:50 +0000 (11:03 -0500)]
Ensure Debugger.NotifyOfCrossthreadDependency is exposed from mscorlib
Commit migrated from https://github.com/dotnet/coreclr/commit/
893c951dd469fb4d96bbded5261651601493e2bf
Russ Keldorph [Wed, 24 Feb 2016 15:40:46 +0000 (07:40 -0800)]
Replace reference to msvcr110.dll with msvcrt.dll in test b286991
Removes unnecessary (and unsupported) dependency and makes the test
consistent with its peers.
Commit migrated from https://github.com/dotnet/coreclr/commit/
6f55e88c29084c72dbc628f89e52b785e4534989
Pallavi Taneja [Tue, 23 Feb 2016 23:54:09 +0000 (15:54 -0800)]
[Fix build break] In the previous change I exposed some APIs in mscorlib.dll to unblock System.Reflection change. However, crossgen.exe trips on this mscorlib.dll since some of the methods it uses is not part of the FEATURE_CORECLR. This change simply exposes these APIs for now.
[tfs-changeset: 1578199]
Commit migrated from https://github.com/dotnet/coreclr/commit/
89f7be2c96392febd6ac0327d8d4a6317201d8fc
Pat Gavlin [Tue, 23 Feb 2016 23:46:23 +0000 (15:46 -0800)]
Remove dead definitions in alloc.h.
Just what it says on the tin.
Commit migrated from https://github.com/dotnet/coreclr/commit/
6b50b538e0c91a46da9f266d1aa01435cda8a34f
Brian Robbins [Tue, 23 Feb 2016 23:34:44 +0000 (15:34 -0800)]
Fix PerfMap::GetNativeImageSignature to work for ready to run images.
Commit migrated from https://github.com/dotnet/coreclr/commit/
fcafa823027bfac03ef021c439962e8d574702cd
Brian Robbins [Tue, 23 Feb 2016 22:01:12 +0000 (14:01 -0800)]
Update crossgen /CreatePerfMap to clear NGENWORKER_FLAGS_READYTORUN.
Commit migrated from https://github.com/dotnet/coreclr/commit/
78f3320ae95430479fe375240989236587262415
Pat Gavlin [Tue, 23 Feb 2016 21:53:32 +0000 (13:53 -0800)]
Expose a hosting interface for the JIT.
This is the first significant step towards removing the JIT's dependence on utilcode.
This change introduces a new interface, `ICorJitHost`, that allows functionality that
would usually be provided by the OS to be overridden by the program that is hosting
the JIT. At the moment, this is limited to memory allocation and configuration value
(e.g. environment variable) access. If the JIT exports a function named `jitStartup`,
an instance of the `ICorJitHost` must be provided via that function before the first
call to `getJit`.
The VM and other implementors of the JIT interface have been updated accordingly.
Most implementors should use the common implementation of `ICorJitHost` (cleverly
named `JitHost`) in utilcode which respects the CLR's hosting policy.
Note that this change does not update RyuJIT (or any other JITs) to use any of the
functionality exposed by `ICorJitHost`; that work is left for future changes.
[tfs-changeset: 1578176]
Commit migrated from https://github.com/dotnet/coreclr/commit/
dfd6ab2348b4b151bb90d3bd7deb6a7304bbafac
Kyungwoo Lee [Tue, 23 Feb 2016 16:34:59 +0000 (08:34 -0800)]
Fix for pMustExpand early fail.
When EE tells Jit to enforce intrinsic expansion, we also checked whether
the intrinsic will be turned into a user call by IsIntrinsicImplementedByUserCall.
In fact, this API is primarily for math intrinsic and thus somewhat ambiguous since
even for any arbitrary non-math intrinsic ID, it returns true.
There are some side-effects, so I didn't refactor this API in this change.
Instead, the fix for pMustExpand is to check whether gtFlags has GTF_CALL.
Commit migrated from https://github.com/dotnet/coreclr/commit/
650a53b9d0778525cfec881e6ea88d58e15451cd
tijoytom [Tue, 23 Feb 2016 15:18:11 +0000 (15:18 +0000)]
Adding more interop tests.
Commit migrated from https://github.com/dotnet/coreclr/commit/
ac71f8a8a4ed23bbcacb449537a8bce2053c9f29
stephentoub [Mon, 22 Feb 2016 19:58:49 +0000 (14:58 -0500)]
Fix Guid.TryParse to not throw FormatException
In certain situations, e.g.
```
Guid g;
Guid.TryParse("{0xdddddddd, 0xdddd, 0xdddd,{0xdd0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}}", out g);
```
Guid.TryParse is throwing a FormatException rather than returning false. This is due to a call to Convert.ToInt32 on one code path that's throwing.
Commit migrated from https://github.com/dotnet/coreclr/commit/
73e596d0a44df010b6c66dc4f0a7342cb7955ee0
Carol Eidt [Mon, 22 Feb 2016 18:32:20 +0000 (10:32 -0800)]
Handle long operators with non-leaf operands on RyuJIT/x86
For non-leaf operands, we need to reorder more than just single nodes.
More complex handling is required if the two nodes being reordered
have side effects (that is NYI for now). Otherwise, we need to link
the first node in each sub-tree with the previous sub-tree.
Fixes dotnet/coreclr#3292
Commit migrated from https://github.com/dotnet/coreclr/commit/
89945b63fb8984326f30f4014bcea596df40a191
Pallavi Taneja [Tue, 23 Feb 2016 19:03:19 +0000 (11:03 -0800)]
Expose necessary surface area required for API Convergence effort for System.Reflection
[tfs-changeset: 1578145]
Commit migrated from https://github.com/dotnet/coreclr/commit/
1ef30f932c1092ead58f7923f6dda999ae77780a
Andy Ayers [Mon, 22 Feb 2016 21:51:52 +0000 (13:51 -0800)]
InlineRefactoring: introducing InlinePolicy
Split the policy aspect of the InlineResult into a separate
policy object, acessed from the InlineResult via a base class.
Implement a LegacyPolicy to capture today's behavior.
Create a factory method for determining what policy to use. Right
now it always creates a LegacyPolicy. This is newed up for each
Inline decision, but since the InlineResult has relatively short
lifetime, we should probably recycle policy objects (might be
more desirable once they start having a bit more state).
Split out a bunch of the InlineDecision helper methods that lived
on InlineResult into global methods since policies will want to refer
to them too. Shame that enum classes don't allow member functions.
Commit migrated from https://github.com/dotnet/coreclr/commit/
d5d25db5934520997ef085bd5f973451fd15a947
Andy Ayers [Tue, 23 Feb 2016 16:21:51 +0000 (08:21 -0800)]
Merge pull request dotnet/coreclr#3300 from dotnet/InlineRefactor4f
InlineRefactoring: capture remaining failing cases in inline tree
Commit migrated from https://github.com/dotnet/coreclr/commit/
e9fa953a295d16b7e00e9192b4973743398358e9
Jan Kotas [Tue, 23 Feb 2016 15:03:14 +0000 (07:03 -0800)]
Merge pull request dotnet/coreclr#3301 from stephentoub/fix_guid_tryparse
Fix Guid.TryParse to not throw FormatException
Commit migrated from https://github.com/dotnet/coreclr/commit/
b8f49126e79e850382d8837241b0dd27566de91f
Jan Kotas [Tue, 23 Feb 2016 14:59:03 +0000 (06:59 -0800)]
Merge pull request dotnet/coreclr#3307 from krytarowski/netbsd-support-56
Fix build issue on NetBSD: Include <stdarg.h> for va_list
Commit migrated from https://github.com/dotnet/coreclr/commit/
c9dc9eab848e88142329435348538feedf9af03f
Andy Ayers [Mon, 22 Feb 2016 18:38:49 +0000 (10:38 -0800)]
InlineRefactoring: capture remaining failing cases in inline tree
The main ininling loop in `fgInline` currently only looks at calls
that are inline candidates and at top-level in their statements.
This is sensible since any call that is an inline candidate has been
hoisted to top-level during importing.
However, to find all the failed inline cases, the jit also needs to
look through the full tree to find calls that were not identified as
candidates.
For instance, in the Secant test, the jit decides to inline `TestBase`
into `Main`. While importing the code for `TestBase` for inlining, the
jit sees that the call to `Bench` is marked with
`[MethodImpl(MethodImplOptions.NoInlining)]` and so the call is not
considered to be an inline candidate. And because `Bench` returns a
value, the call expression is in a subtree under an assign expression.
Thus the failure to inline `Bench` is overlooked by the current code.
```
;; current code
Inlines into Secant:Main():int
[IL=0000 TR=000001] [below ALWAYS_INLINE size] Secant:TestBase():bool
```
With this change, under DEBUG, the main inline control loop in `fgInline`
now also scans the tree for non-candidates, and adds their failures
to the InlineContext tree in appropriate locations.
`fgMorphInline` and `fgMorphInlineHelper` are now simpified since they
can assume any call they see must be a candidate.
The jit now also only notes failures for `CT_USER_FUNC` calls, since
otherwise the trees would be full of failed calls to helpers and the
like.
With this change, the jit can now report that `Bench` is a failed inline
into `Main`.
```
;; new code
Inlines into Secant:Main():int
[IL=0000 TR=000001] [below ALWAYS_INLINE size] Secant:TestBase():bool
[IL=0000 TR=000021] [FAILED: noinline per IL/cached result] Secant:Bench():bool
```
Commit migrated from https://github.com/dotnet/coreclr/commit/
fff03183878a074539544f9b3c3d1cda8176fc85
Lubomir Litchev [Tue, 23 Feb 2016 03:25:46 +0000 (19:25 -0800)]
Merge pull request dotnet/coreclr#3303 from LLITCHEV/PutArgStk-GC-hole
Fix a hole in the GC generated for PutArgStructStk.
Thanks all!
Commit migrated from https://github.com/dotnet/coreclr/commit/
bdd5be00414fc53d427a03f515e447f73f4fd5c5
Jan Kotas [Tue, 23 Feb 2016 03:04:24 +0000 (19:04 -0800)]
Merge pull request dotnet/coreclr#3304 from andschwa/sigchld
Remove mask of SIGCHLD
Commit migrated from https://github.com/dotnet/coreclr/commit/
0b1b9f4052de4019bb111f835771dfbba9c814c9
Rahul Kumar [Tue, 23 Feb 2016 02:03:28 +0000 (18:03 -0800)]
Add xunit.performance.core to core_root. required for few jit tests
Commit migrated from https://github.com/dotnet/coreclr/commit/
e1a873cc9215fe92831c4b8c665fc07d60746b43
Aditya Mandaleeka [Tue, 23 Feb 2016 02:03:20 +0000 (18:03 -0800)]
Merge pull request dotnet/coreclr#3248 from adityamandaleeka/twowaypipe_cleanup
Disambiguate debug pipe names with more than just PID
Commit migrated from https://github.com/dotnet/coreclr/commit/
0a3fe0f45ae75f31db0b5d2518847ed51b4f13dd
Lubomir Litchev [Mon, 22 Feb 2016 22:45:53 +0000 (14:45 -0800)]
Fix a hole in the GC generated for PutArgStructStk.
On System V there is a hole (tanks @CarolEidt for pointing it out) where
while copying struct to the stack in the OutgoingParamArea the GC-ness
for the register used to copy the struct is not properly set.
This change fixes the issue.
This change also makes sure when copying to/from stack, an emitAttr of
EA_PTRSIZE is used - stack variables are never moved by GC, so using this
type in such case should is fine.
Commit migrated from https://github.com/dotnet/coreclr/commit/
21db33e10cfee04f914fdaceefa1ed2fd2ad1f52
Kamil Rytarowski [Tue, 23 Feb 2016 00:17:42 +0000 (01:17 +0100)]
Fix build issue on NetBSD: Include <stdarg.h> for va_list
This has been triggered during llilc build.
Commit migrated from https://github.com/dotnet/coreclr/commit/
5c8e36a432f78f6535121b3e271804d49e8e6814
Andrew Schwartzmeyer [Mon, 22 Feb 2016 23:08:05 +0000 (15:08 -0800)]
Remove mask of SIGCHLD
When a .NET Core program invoked a process that invoked its own child,
the masking of SIGCHLD prevented the process from recognizing its child
had exited, which some processes require. This caused the .NET Core app
to hang in certain internal scenarios.
Commit migrated from https://github.com/dotnet/coreclr/commit/
d0ede1557b29f833268845ba85fd27bb66fcb23b
Jan Kotas [Mon, 22 Feb 2016 21:47:27 +0000 (13:47 -0800)]
Merge pull request dotnet/coreclr#3293 from jkotas/r2r-default-callconv
Use default calling convention small type widening rules for R2R
Commit migrated from https://github.com/dotnet/coreclr/commit/
50d84032861511d703125d80b9b4a6da11c2650a
Jan Kotas [Mon, 22 Feb 2016 21:47:08 +0000 (13:47 -0800)]
Merge pull request dotnet/coreclr#3298 from jkotas/ryujit-version
Update RyuJIT package version
Commit migrated from https://github.com/dotnet/coreclr/commit/
9a4dbc7fecf1dbafea614882c0c44ff22ee4ca8d
William Godbe [Mon, 22 Feb 2016 21:39:00 +0000 (13:39 -0800)]
Merge pull request dotnet/coreclr#3302 from wtgodbe/datetime
Integrate ToF version of DateTimeKind test to prevent failures on non-Windows platforms
Commit migrated from https://github.com/dotnet/coreclr/commit/
1cf4b0eb05fe2ae3ec6ccc0688290195bc9d5fcb
stephentoub [Mon, 22 Feb 2016 19:58:49 +0000 (14:58 -0500)]
Fix Guid.TryParse to not throw FormatException
In certain situations, e.g.
```
Guid g;
Guid.TryParse("{0xdddddddd, 0xdddd, 0xdddd,{0xdd0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}}", out g);
```
Guid.TryParse is throwing a FormatException rather than returning false. This is due to a call to Convert.ToInt32 on one code path that's throwing.
Commit migrated from https://github.com/dotnet/coreclr/commit/
6f387a835b4da5fce3bc199bd4286f15467e2f52
Eugene Rozenfeld [Mon, 22 Feb 2016 21:12:18 +0000 (13:12 -0800)]
Merge pull request dotnet/coreclr#3244 from erozenfeld/SIMDInit
Fix for SIMD Initialize intrinsic expansion.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7728a1274d3729b0691602f4090e7ffcbe53018c
Sejong Oh [Mon, 22 Feb 2016 20:36:12 +0000 (12:36 -0800)]
Merge pull request dotnet/coreclr#3259 from sejongoh/add_corefx_minopts
Add minopts and fix few bugs
Commit migrated from https://github.com/dotnet/coreclr/commit/
c1109f39a7298b8e8ccec1b48ead102932fa9516
Sejong Oh [Fri, 19 Feb 2016 20:55:53 +0000 (12:55 -0800)]
Add minopts and fix few bugs
Commit migrated from https://github.com/dotnet/coreclr/commit/
55894a7344b4a23a22d1a24deffdd562a05f06bd
William Godbe [Mon, 22 Feb 2016 20:11:28 +0000 (12:11 -0800)]
Integrate ToF version of DateTimeKind test to prevent failures on non-Windows platforms
Commit migrated from https://github.com/dotnet/coreclr/commit/
f5bdec238852f4e0e164508acb633678879a6bfd
Jan Kotas [Mon, 22 Feb 2016 19:42:58 +0000 (11:42 -0800)]
Merge pull request dotnet/coreclr#3294 from jkotas/delete-zero-offset-allowed
Delete FEATURE_REF_ZERO_OFFSET_ALLOWED
Commit migrated from https://github.com/dotnet/coreclr/commit/
98c2b749ef5b7441f79d2ce1cfaf2665b7f138cf
Rahul Kumar [Mon, 22 Feb 2016 19:37:11 +0000 (11:37 -0800)]
Merge pull request dotnet/coreclr#3266 from rahku/Helix
add helix run support to coreclr repo
Commit migrated from https://github.com/dotnet/coreclr/commit/
e4be82f41fa5032b6a622e74404e92468b5806a8
Rahul Kumar [Mon, 25 Jan 2016 22:50:20 +0000 (14:50 -0800)]
add helix run support to coreclr repo
Commit migrated from https://github.com/dotnet/coreclr/commit/
a8741647cfa038e67a644237bd0806b78fb77b46
Jan Kotas [Mon, 22 Feb 2016 19:29:30 +0000 (11:29 -0800)]
Update RyuJIT package version
Commit migrated from https://github.com/dotnet/coreclr/commit/
e538b22fb0fa25c364d9348d5af590eef940a006
Carol Eidt [Mon, 22 Feb 2016 18:47:28 +0000 (10:47 -0800)]
Merge pull request dotnet/coreclr#3270 from CarolEidt/x86TypeCtxtOnFrame
Mark compTypeCtxtArg as lvOnFrame
Commit migrated from https://github.com/dotnet/coreclr/commit/
284729c614bd87dc7db2834dbcde909fd4275116
Vance Morrison [Mon, 22 Feb 2016 18:31:44 +0000 (10:31 -0800)]
Add in code to do NullArgumentChecks for compatibiity
Commit migrated from https://github.com/dotnet/coreclr/commit/
d47f6dce43ce951e48c431a7ececd9e0c54cb925
Gaurav Khanna [Mon, 22 Feb 2016 18:10:06 +0000 (09:10 -0900)]
Merge pull request dotnet/coreclr#3282 from gkhanna79/WinX86Nuget
Generate WinX86 Nuget package
Commit migrated from https://github.com/dotnet/coreclr/commit/
7134c1fda85aa147b74401d99275df2a2bd7a985
Jan Kotas [Mon, 22 Feb 2016 17:47:53 +0000 (09:47 -0800)]
Delete FEATURE_REF_ZERO_OFFSET_ALLOWED
Commit migrated from https://github.com/dotnet/coreclr/commit/
ba504fb286a56178e5e9d1a830438de553bd6298
Andy Ayers [Mon, 22 Feb 2016 17:38:39 +0000 (09:38 -0800)]
Merge pull request dotnet/coreclr#3289 from AndyAyersMS/InlineRefactor4e
Inline refactoring: split up depth and recursion checks
Commit migrated from https://github.com/dotnet/coreclr/commit/
bc60ca1cc2602b3ce667464be1d065af1df7e0f7
Jan Kotas [Mon, 22 Feb 2016 17:38:34 +0000 (09:38 -0800)]
Use default calling convention small type widening rules for R2R
Sticking to default calling convention is key for interoperability that is the primary goal of R2R.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7f61feafae3cdc9e560629e0bf2a03e64936a7b5
Gaurav Khanna [Sun, 21 Feb 2016 01:35:42 +0000 (17:35 -0800)]
Generate WinX86 Nuget package
Commit migrated from https://github.com/dotnet/coreclr/commit/
7077d3a5bad55d011c6c838d4ffab22cc5097ae3
Matt Mitchell [Mon, 22 Feb 2016 16:10:48 +0000 (08:10 -0800)]
Merge pull request dotnet/coreclr#3286 from sejongoh/add_export
Add export to define environment variables
Commit migrated from https://github.com/dotnet/coreclr/commit/
e7dfcbb625d52f9d04dfe8f5f78349795178ac8b
Jan Vorlicek [Mon, 22 Feb 2016 12:37:36 +0000 (13:37 +0100)]
Merge pull request dotnet/coreclr#3255 from juergenhoetzel/build_script_fixes
Handle CMakeArgs correctly
Commit migrated from https://github.com/dotnet/coreclr/commit/
4e15bf1e269ceb51dbbc18df2cfb73952f4028db
Matt Ellis [Mon, 22 Feb 2016 06:19:14 +0000 (22:19 -0800)]
Merge pull request dotnet/coreclr#3260 from gkhanna79/CentOS
Fixes to build CentOS CoreCLR Nuget Package
Commit migrated from https://github.com/dotnet/coreclr/commit/
b4304b1ad2c0aee2363c3cffb5485d9844f70d73
Jan Kotas [Mon, 22 Feb 2016 02:36:30 +0000 (18:36 -0800)]
Merge pull request dotnet/coreclr#3290 from krytarowski/netbsd-support-55
PAL tests on NetBSD: Clean-up
Commit migrated from https://github.com/dotnet/coreclr/commit/
4bdea050e863027da07c7c8eb8d1c6dfa7dcbab3
Kamil Rytarowski [Mon, 22 Feb 2016 00:01:04 +0000 (01:01 +0100)]
Temporarily disable paltest_pal_sxs_test1 on NetBSD
This test has been also disabled on FreeBSD as hardware exceptions
always seem to abort on NetBSD as well.
Related issues: dotnet/coreclrdotnet/coreclr#2090 dotnet/coreclrdotnet/coreclr#3287
Commit migrated from https://github.com/dotnet/coreclr/commit/
ea2bbc1f34240764bf9683c27fab632a9a103308
Kamil Rytarowski [Sun, 21 Feb 2016 23:43:15 +0000 (00:43 +0100)]
Fix typo in the name of the paltest_getcurrentthread_test2 test
It was recently disabled on NetBSD and due to pasto it reports a wrong name.
Commit migrated from https://github.com/dotnet/coreclr/commit/
693034eeb712a6a008d52edb39122aafdcd108e2
Andy Ayers [Sat, 20 Feb 2016 19:21:08 +0000 (11:21 -0800)]
Inline refactoring: split up depth and recursion checks
Separate out the recursive inline and inline too deep obervations.
Have the checker update the inline result directly rather than
deferring to the caller.
Add a bit more commentary on how the various inline classes
are used during compilation.
Commit migrated from https://github.com/dotnet/coreclr/commit/
336832d2119d3877f633891b367315ee935afdd7
Andy Ayers [Sun, 21 Feb 2016 19:37:42 +0000 (11:37 -0800)]
Merge pull request dotnet/coreclr#3275 from AndyAyersMS/InlineRefactor4d
InlineRefactoring: start to capture failures in the inline tree
Commit migrated from https://github.com/dotnet/coreclr/commit/
c2a8bfad36f433fed397efc1419f948709ccfc5e
Jan Kotas [Sun, 21 Feb 2016 14:22:06 +0000 (06:22 -0800)]
Merge pull request dotnet/coreclr#3278 from jamesqo/patch-7
Short-circuit for empty strings in string.Insert and Remove
Commit migrated from https://github.com/dotnet/coreclr/commit/
53148ebbc2b62f7a9b0d2369003ef7087a4c3e3c
Jan Kotas [Sun, 21 Feb 2016 14:11:54 +0000 (06:11 -0800)]
Merge pull request dotnet/coreclr#3285 from krytarowski/netbsd-support-54
Fix test issue on NetBSD: Walk-around getrusage(2) implementation nits
Commit migrated from https://github.com/dotnet/coreclr/commit/
dec83bd64d40fcff76e14f5700b8fb69413e4057
Sejong Oh [Sun, 21 Feb 2016 07:51:26 +0000 (23:51 -0800)]
Add export to define environment variables
Commit migrated from https://github.com/dotnet/coreclr/commit/
85df1f59fae915e0e165d3649d329047a931eed2
Kamil Rytarowski [Sun, 21 Feb 2016 04:36:03 +0000 (05:36 +0100)]
Fix test issue on NetBSD: Walk-around getrusage(2) implementation nits
The following code:
int main(int argc, char **argv)
{
int i, j, k, total;
struct rusage resUsage1, resUsage2;
if (getrusage (RUSAGE_SELF, &resUsage1) == -1)
errx(1, "getrusage");
/* simulate some activity */
for( i=0; i<1000; i++ )
{
for( j=0; j<1000; j++ )
{
total = j * i;
for( k=0; k<1000; k++ )
{
total += k + i;
}
}
}
if (getrusage (RUSAGE_SELF, &resUsage2) == -1)
errx(1, "getrusage");
printf("kernel1 %ld.%06ld\n", resUsage1.ru_stime.tv_sec, resUsage1.ru_stime.tv_usec);
printf("kernel2 %ld.%06ld\n", resUsage2.ru_stime.tv_sec, resUsage2.ru_stime.tv_usec);
printf("user1 %ld.%06ld\n", resUsage1.ru_utime.tv_sec, resUsage1.ru_utime.tv_usec);
printf("user2 %ld.%06ld\n", resUsage2.ru_utime.tv_sec, resUsage2.ru_utime.tv_usec);
return 0;
}
Returns the following values:
$ ./test
kernel1 0.000262
kernel2 0.000000
user1 0.000262
user2 2.279965
The reason for it is as follows:
The reason is that the scheduler keeps a precise total cpu time of
a process but the systime/usertime is only sampled by a much slower
clock. The ratio systime/usertime is then used to return an approximation
so that systime and usertime sum up to the total time(*).
As a result it is possible that usertime or systime go backwards.
FreeBSD has implemented a workaround by remembering reported
usertime/systime values for a process and clamping getrusage()
against these values. As a result the usertime/systime value
is usually too high but it is monotonic.
Another approach would be to round down the usertime/systime values,
by not approximating 'measurments' that do not exist. The result
would be that usertime/systime values that are too low and don't
sum up to the total CPU time but are again monotonic.
The approximation is done in kern_resource/calc().
(*) The sampled interrupt time is also included.
-- by Michael van Elst
-- http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=30115
Walkaround it by doing kernel-work with subsequent malloc(3) and free(3) calls.
Note that doing these calls for smaller chunks (it looks like a compiler/libc
can optimize it without going to the host kernel) or just 1000 times is not
sufficient.
Commit migrated from https://github.com/dotnet/coreclr/commit/
4c389ad3e373cf4bb6ae643e8a91b7104eb6c39a
James Ko [Sun, 21 Feb 2016 02:44:23 +0000 (21:44 -0500)]
Short-circuit for empty strings in Insert/Remove
Commit migrated from https://github.com/dotnet/coreclr/commit/
74709851898330c6ac3a20eb04d085e9b0e2dcf0
Jan Kotas [Sun, 21 Feb 2016 02:27:09 +0000 (18:27 -0800)]
Merge pull request dotnet/coreclr#3280 from jamesqo/patch-8
Avoid string allocations in some Concat overloads
Commit migrated from https://github.com/dotnet/coreclr/commit/
a8e10c51b050917606b755b1f11f2a3dd9436dcf
Jan Kotas [Sun, 21 Feb 2016 01:01:42 +0000 (17:01 -0800)]
Merge pull request dotnet/coreclr#3279 from krytarowski/netbsd-support-53
Disable not relevant tests for NetBSD: SCHED_OTHER may not be reassignable
Commit migrated from https://github.com/dotnet/coreclr/commit/
77374b2d56441e924d0340a0c3da04e19a3d53dc
Kamil Rytarowski [Sat, 20 Feb 2016 23:44:02 +0000 (00:44 +0100)]
Remove trailing whitespace
Commit migrated from https://github.com/dotnet/coreclr/commit/
f05754aa297c3bb66a296bea1f3e7ffba09a5c47
James Ko [Sat, 20 Feb 2016 23:47:24 +0000 (18:47 -0500)]
Avoid string allocations in some Concat overloads
Commit migrated from https://github.com/dotnet/coreclr/commit/
b99e5c1638a7e909c918be313ef386b7d0ccb3c3
Kamil Rytarowski [Sat, 20 Feb 2016 23:41:04 +0000 (00:41 +0100)]
Disable not relevant tests for NetBSD: SCHED_OTHER may not be reassignable
This addresses the following issues:
threading/GetCurrentThread/test1/paltest_getcurrentthread_test1. Exit code: 1
threading/GetCurrentThread/test2/paltest_getcurrentthread_test2. Exit code: 1
threading/GetProcessTimes/test2/paltest_getprocesstimes_test2. Exit code: 1
Commit migrated from https://github.com/dotnet/coreclr/commit/
c341d9b33e5b827e48f52671a21bf3dde89fd5c8
Sergiy Kuryata [Sat, 20 Feb 2016 21:56:34 +0000 (13:56 -0800)]
Merge pull request dotnet/coreclr#3265 from wtgodbe/coverage
Add option to runtest.sh to generate code coverage reports for coreclr
Commit migrated from https://github.com/dotnet/coreclr/commit/
2a694dd1cea6cd7d176893ad661041cd1dacf9a2
Jan Kotas [Sat, 20 Feb 2016 19:39:27 +0000 (11:39 -0800)]
Merge pull request dotnet/coreclr#3262 from wtgodbe/disable
Delete poorly-written tests failing on OSX
Commit migrated from https://github.com/dotnet/coreclr/commit/
a4bc674885e548d039ec68a139c48f2be8c90e2a
Jan Kotas [Sat, 20 Feb 2016 19:38:04 +0000 (11:38 -0800)]
Merge pull request dotnet/coreclr#3274 from jamesqo/patch-5
Remove unnecessary ref parameters from String.cs
Commit migrated from https://github.com/dotnet/coreclr/commit/
168db67b352e3a43acbbff8c07b215b42e5d751b
James Ko [Sat, 20 Feb 2016 17:24:02 +0000 (12:24 -0500)]
Remove unnecessary ref parameters from String.cs
For some reason, there seems to be some code in String.Split that takes ref parameters, even though they aren't actually assigned to.
This commit removes the `ref` annotations from the methods and their callers.
Commit migrated from https://github.com/dotnet/coreclr/commit/
7ce28d1a2efd44eeeb6bc15d2dd11272e4759df6
Jan Kotas [Sat, 20 Feb 2016 16:34:38 +0000 (08:34 -0800)]
Merge pull request dotnet/coreclr#3221 from jamesqo/patch-5
Optimize String.Replace when the chars are the same
Commit migrated from https://github.com/dotnet/coreclr/commit/
a2010dfb628b2d7409a2ad9752309388181e8823
Jan Kotas [Sat, 20 Feb 2016 16:29:28 +0000 (08:29 -0800)]
Merge pull request dotnet/coreclr#3269 from JoshVarty/master
Fix ecma-spec link
Commit migrated from https://github.com/dotnet/coreclr/commit/
8b4162ebd4b4e9deb5f8829404f671cda4d71c36
Jan Kotas [Sat, 20 Feb 2016 16:27:46 +0000 (08:27 -0800)]
Merge pull request dotnet/coreclr#3273 from krytarowski/netbsd-support-52
Disallow setting of priority for SCHED_OTHER threads on NetBSD
Commit migrated from https://github.com/dotnet/coreclr/commit/
44cd35e3d9a8eda6713c1bbdebe85609f055323d
Kamil Rytarowski [Sat, 20 Feb 2016 14:51:18 +0000 (15:51 +0100)]
Disallow setting of priority for SCHED_OTHER threads on NetBSD
There are 7 PAL tests that are falling down due to calling
pthread_setschedparam(3) on NetBSD.
Diving into the kernel code I have found that SCHED_OTHER does not support
setting priorities other than PRI_NONE.
/* Disallow setting of priority for SCHED_OTHER threads */
if (lpolicy == SCHED_OTHER && pri != PRI_NONE) {
lwp_unlock(t);
error = EINVAL;
break;
}
-- NetBSD sources sys/kern/sys_sched.c Line 167
/usr/include/sys/param.h:#define PRI_NONE (-1)
It looks like the same rule applies for Linux:
SCHED_OTHER is the default universal time-sharing scheduler policy used
by most processes, SCHED_FIFO and SCHED_RR are intended for special
time-critical applications that need precise control over the way in
which runnable processes are selected for execution. Processes sched-
uled with SCHED_OTHER must be assigned the static priority 0, processes
scheduled under SCHED_FIFO or SCHED_RR can have a static priority in
the range 1 to 99. Only processes with superuser privileges can get a
ordering within the list of runnable processes with equal static prior-
ity.
-- http://ccrma.stanford.edu/planetccrma/man/man2/sched_setscheduler.2.html
Standard says:
The pthread_getschedparam() and pthread_setschedparam() functions shall,
respectively, get and set the scheduling policy and parameters of individual
threads within a multi-threaded process to be retrieved and set. For
SCHED_FIFO and SCHED_RR, the only required member of the sched_param
structure is the priority sched_priority. For SCHED_OTHER, the affected
scheduling parameters are implementation-defined.
The policy parameter may have the value SCHED_OTHER, SCHED_FIFO, or
SCHED_RR. The scheduling parameters for the SCHED_OTHER policy are
implementation-defined. The SCHED_FIFO and SCHED_RR policies shall have a
single scheduling parameter, priority.
http://pubs.opengroup.org/onlinepubs/
9699919799/functions/pthread_getschedparam.html
The culprit code is here: src/pal/src/thread/thread.cpp Line 1276
Fix dotnet/coreclr#3272
Commit migrated from https://github.com/dotnet/coreclr/commit/
d279c120b271393726920d85f46c2b503cb1b14d