platform/upstream/coreclr.git
5 years agoReference in box HW intrinsics (#19137)
Jacek Blaszczynski [Fri, 27 Jul 2018 05:35:51 +0000 (07:35 +0200)]
Reference in box HW intrinsics (#19137)

* Update BuildTools, CoreClr, CoreFx, PgoData to preview1-03025-01, preview1-26726-01, preview1-26725-04, master-20180726-0111, respectively

* Reference System.Runtime.Intrinsics in box package

* Disable X509Certificates tests for CoreFX update

5 years agoMerge pull request #19144 from BruceForstall/Fix13796
Bruce Forstall [Fri, 27 Jul 2018 04:42:30 +0000 (21:42 -0700)]
Merge pull request #19144 from BruceForstall/Fix13796

Re-enable arm64 tests that no longer fail

5 years agoFixing the x86 hwintrinsics to not assert for invalid generic types.
Tanner Gooding [Thu, 26 Jul 2018 20:46:48 +0000 (13:46 -0700)]
Fixing the x86 hwintrinsics to not assert for invalid generic types.

5 years agoMerge pull request #19153 from adityamandaleeka/fix_buildtest_help
Aditya Mandaleeka [Thu, 26 Jul 2018 23:04:13 +0000 (16:04 -0700)]
Merge pull request #19153 from adityamandaleeka/fix_buildtest_help

Fix batch syntax error in help text

5 years agoFix syntax error in help text.
Aditya Mandaleeka [Thu, 26 Jul 2018 22:56:01 +0000 (15:56 -0700)]
Fix syntax error in help text.

5 years agoreenable corefx System.Runtime.Tests on arm32 (#19128)
Sergey Andreenko [Thu, 26 Jul 2018 22:46:53 +0000 (15:46 -0700)]
reenable corefx System.Runtime.Tests  on arm32 (#19128)

#17585 the issue was fixed long time ago, but this exclusion was forgotten.

5 years agoAdding the Microsoft.NET.Sdk.IL pkgproj
Tanner Gooding [Fri, 20 Jul 2018 20:33:10 +0000 (13:33 -0700)]
Adding the Microsoft.NET.Sdk.IL pkgproj

5 years agoRe-enable arm64 tests that no longer fail
Bruce Forstall [Thu, 26 Jul 2018 20:37:20 +0000 (13:37 -0700)]
Re-enable arm64 tests that no longer fail

Fixes #13796, #12549

Note that test GitHub_11408 is still disabled, now against issue #11408.

5 years agoSwitch to using MicrosoftNETCorePlatformsPackageVersion as the RuntimeFrameworkVersio...
Chris Sienkiewicz [Thu, 26 Jul 2018 16:57:19 +0000 (09:57 -0700)]
Switch to using MicrosoftNETCorePlatformsPackageVersion as the RuntimeFrameworkVersion parameter in the test wrappers and SDK props file (#19130)

5 years agoUpdate CoreFX documentation (#19092)
Andon Andonov [Thu, 26 Jul 2018 02:10:17 +0000 (19:10 -0700)]
Update CoreFX documentation (#19092)

* Update CoreFX documentation

* Add test binary refresh and parallelization sections

* Add test exclusion information

5 years agoSdk test projects (#19044)
Chris Sienkiewicz [Wed, 25 Jul 2018 18:13:27 +0000 (11:13 -0700)]
Sdk test projects (#19044)

Change the associated targets and props files in the test directory to allow the test csproj's to be built as SDK style projects alongside traditional style projects.

Remove CodeTaskFactory:
- Allows the projects to be built using the core version of msbuild/dotnet build
- Converted to using msbuild property expansion instead

Add directory.build.{props,targets}:
- Currently we just import the dirs.props and targets, but means SDK style projects don't need to explicitly include these files
- We probably want to move all projects over to using these in the future, but this keeps the changes smaller for now

Specific code for SDK projects:
- There are a several changes required to build an SDK project. This change guards them behind conditionals so that only the new style projects see them. When we get to the point that there are only new projects, we can remove the guards (probably at the same time as ditching the dir.props)

Reordered build targets:
- Because SDK projects implicitly import the build targets, we can no longer re-define the build targets unconditionally knowing they will likely be overwritten.
- Instead we move the overwritten targets to separate files, and include these conditionally based on properties. In this way there is always a build defined for SDK projects, which can then be overwritten to do nothing as needed.

5 years agoRemoving duplicate CoreCLRTestLibrary project references
Tanner Gooding [Fri, 20 Jul 2018 18:07:30 +0000 (11:07 -0700)]
Removing duplicate CoreCLRTestLibrary project references

5 years agoRegenerating the x86 HWIntrinsic templated tests
Tanner Gooding [Fri, 20 Jul 2018 17:52:21 +0000 (10:52 -0700)]
Regenerating the x86 HWIntrinsic templated tests

5 years agoRemoving `Random random = new Random()` from the HWIntrinsic templates
Tanner Gooding [Fri, 20 Jul 2018 17:50:14 +0000 (10:50 -0700)]
Removing `Random random = new Random()` from the HWIntrinsic templates

5 years agoRealigning the HWIntrinsic template metadata tables
Tanner Gooding [Fri, 20 Jul 2018 17:47:47 +0000 (10:47 -0700)]
Realigning the HWIntrinsic template metadata tables

5 years agoReplacing usages of random with TestLibrary.Generator in the HWIntrinsic template...
Tanner Gooding [Fri, 20 Jul 2018 17:32:47 +0000 (10:32 -0700)]
Replacing usages of random with TestLibrary.Generator in the HWIntrinsic template metadata

5 years agoAdding TestLibrary.Generator methods for unsigned types
Tanner Gooding [Fri, 20 Jul 2018 17:19:33 +0000 (10:19 -0700)]
Adding TestLibrary.Generator methods for unsigned types

5 years agoFix mscordbi metadata reader alignment bug on Linux. (#19070)
Mike McLaughlin [Tue, 24 Jul 2018 19:19:59 +0000 (12:19 -0700)]
Fix mscordbi metadata reader alignment bug on Linux. (#19070)

Works fine on Windows minidumps, but on Linux (via OpenVirtualProcess
for production breakpoints and future core dumps) the compiler's struct
alignment rules are different. On Windows, classes/structs are aligned
based on the largest field. On Linux, they are 4 byte aligned regardless
of the field sizes.

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

5 years agoRelease leaked ICorProfilerCallback9 in ~EEToProfInterfaceImpl (#19106)
Ilia [Tue, 24 Jul 2018 16:49:16 +0000 (19:49 +0300)]
Release leaked ICorProfilerCallback9 in ~EEToProfInterfaceImpl (#19106)

Bug: 19093

5 years agoMerge pull request #19099 from BruceForstall/Arm64DebugBuild
Bruce Forstall [Tue, 24 Jul 2018 15:29:07 +0000 (08:29 -0700)]
Merge pull request #19099 from BruceForstall/Arm64DebugBuild

Change Windows arm32/arm64 Debug normal/innerloop jobs to NOT run tests

5 years agoRevert "Revert "Fix some failures when using build-test.sh"" (#18919)
Russ Keldorph [Tue, 24 Jul 2018 15:25:59 +0000 (08:25 -0700)]
Revert "Revert "Fix some failures when using build-test.sh"" (#18919)

This reverts commit 184c3504e763ea7147505a8d49cb54b43cc82d78.

5 years agoWork around cmd command length limit in xunit Exec task (#19095)
Sven Boemer [Tue, 24 Jul 2018 15:22:31 +0000 (08:22 -0700)]
Work around cmd command length limit in xunit Exec task (#19095)

On Windows, the Exec task passes the command to cmd, so long commands
run into the command length limit (see
https://github.com/Microsoft/msbuild/issues/2530). This workaround
shortens the xunit command line by replacing the path to the test
binary directory with an environment variable.

5 years agoAdd root MSBuild targets for Interop managed test assets (#19069)
Aaron Robinson [Tue, 24 Jul 2018 01:40:17 +0000 (18:40 -0700)]
Add root MSBuild targets for Interop managed test assets (#19069)

Add root CMake file for Interop native test assets

5 years agoChange Windows arm32/arm64 Debug normal/innerloop jobs to NOT run tests
Bruce Forstall [Mon, 23 Jul 2018 23:20:26 +0000 (16:20 -0700)]
Change Windows arm32/arm64 Debug normal/innerloop jobs to NOT run tests

We don't want these Debug jobs to run tests, because Debug testing is
slow, and we have few machine resources. It's a bit of a bug that we
are currently running tests, because the job is named with "Build", not
"Build and Test".

So make it do what the name says: Debug normal/innerloop arm32/arm64 jobs
will not run tests.

This is asymmetric, unfortunately. I might prefer that the Debug jobs get
generated as "Build and Test", but just not be triggered. (But be available
for triggering.) Or perhaps just not get generated. That might require a
separate set of just "Build" jobs that could be useful in some scenarios,
such as for what the current Debug "Build" only jobs are currently used for.

5 years agoAdd missing FlushInstructionCache to Thread::CommitGCStressInstructionUpdate (#18784)
Egor Chesakov [Mon, 23 Jul 2018 21:15:07 +0000 (14:15 -0700)]
Add missing FlushInstructionCache to Thread::CommitGCStressInstructionUpdate (#18784)

5 years agoDisable tests failing on ARM32 in https://github.com/dotnet/coreclr/pull/18784 (...
Egor Chesakov [Mon, 23 Jul 2018 21:13:20 +0000 (14:13 -0700)]
Disable tests failing on ARM32 in https://github.com/dotnet/coreclr/pull/18784 (#19087)

5 years agoR2RDump - UnwindInfo for x86 (#18994)
Amy [Mon, 23 Jul 2018 20:35:57 +0000 (13:35 -0700)]
R2RDump - UnwindInfo for x86 (#18994)

* UnwindInfo for x86

* Update tests

5 years agoChange gtExtractSideEffList to use GenTreeVisitor (#18257)
mikedn [Mon, 23 Jul 2018 19:21:34 +0000 (22:21 +0300)]
Change gtExtractSideEffList to use GenTreeVisitor (#18257)

* Change gtExtractSideEffList to use GenTreeVisitor

The tree traversal logic in gtExtractSideEffList is basically an incomplete duplicate of GenTreeVisitor's traversal logic. It lacks handling for GT_ARR_ELEM and GT_ARR_OFFSET so if this are encountered any side effects their children may have are silently dropped.

In addition, side effect ordering was not always preserved. The comma list is built by prepending nodes to it so side effects have to be visited in reverse execution order. The old code did this only for simple opers, for special nodes such as GT_ARR_BOUNDS_CHECK normal execution order was used.

This actually complicates a bit the GenTreeVisitor implementation as side effects need to be first stored in an array. The number of side effects is usually small (<= 4) so this shouldn't be a problem.

* Use GTF_SIDE_EFFECT in optPrepareTreeForReplacement

Assertion propagation doesn't have any way to ensure that it is safe to remove class constructor calls so GTF_PERSISTENT_SIDE_EFFECTS_IN_CSE should not be used here.

Likewise, GTF_EXCEPT side effects must be preserved as well. VN doesn't always propagate exceptions so it's possible to end up with a tree that has a constant VN and contains exception side effects.

* Add tests for 18232

* CR feedback

5 years agoPartial R2R IBC fixes (#19073)
Jan Kotas [Mon, 23 Jul 2018 19:17:56 +0000 (12:17 -0700)]
Partial R2R IBC fixes (#19073)

* Partial R2R IBC fixes

- Log use method code access in all cases, not just when the method is JITed
- Add workaround for CONTRACT_VIOLATION that shows up in checked builds when collecting IBC data
- Make /ReadyToRun switch work for CoreLib

5 years agoJIT: some lclvars related cleanup (#19077)
Andy Ayers [Mon, 23 Jul 2018 18:47:17 +0000 (11:47 -0700)]
JIT: some lclvars related cleanup (#19077)

Consolidate various compiler globals used when setting local var ref
counts by folding them into the visitor:
* lvaMarkRefsCurBlock
* lvaMarkRefsCurStmt
* lvaMarkRefsWeight

Remove the largely vestigial `lvPrefReg` and associated methods to set
or modify this field. Haven't verified but this is likely a remmant of
the legacy backend.

In the one remaning use (lcl var sorting predicates), swap in `lvIsRegArg`
instead, which gets most of the same cases.

5 years agoRemove hosthook api (#19079)
Aaron Robinson [Mon, 23 Jul 2018 10:30:57 +0000 (03:30 -0700)]
Remove hosthook api (#19079)

* Remove CallNeedsHostHook() API

* Remove IsHostHookEnabled() API and with it related dead code

* Remove code enabling host hooks (i.e. COMPlus_GenerateStubForHost)
Remove function declarations for creating host hooks
Update comments

5 years agoEnable profiler attach on Windows (#18762)
Sung Yoon Whang [Mon, 23 Jul 2018 03:56:42 +0000 (20:56 -0700)]
Enable profiler attach on Windows (#18762)

* try building clr with prof attach enabled

* define ICLRProfiling interface

* profattach.dll now builds with CreateCLRProfiling export

* remove try catch

* basic attach working now

* build with profiler attach feature only on win

* Fix linux build

* cleanup

* more cleanup

* more cleanup

* remove profattach dll

* remove useless unix exports in mscorwks

* remove profattach from dll cmakelist

* Add back ifdef

* cleanup

* change LINUX to UNIX in clrdefinitions

* Fix broken checked builds

* Remove CLRProfilingClassFactory and metadata.h include from profattach.cpp

* remove useless extern C

* Add this back in

* adding ifndef DACCESS_COMPILE

* Try building with FWD define ICLRProfiling interface

* Test commit - removing additional definition from metahost.h to see if this will pass CI runs

* Address pr comments

5 years agoJIT: stateful local ref counts and weights (#19068)
Andy Ayers [Sun, 22 Jul 2018 16:12:10 +0000 (09:12 -0700)]
JIT: stateful local ref counts and weights (#19068)

Introduce a notion of state for local var ref counts and weighted ref counts.
Accesses and current state must agree.

State is invalid initially, enabled for an early period around bits of morph,
invalid again for a time, and then enabled normally once lvaMarkRefs is called.

Accesses normally specify RCS_NORMAL as the desired state, but in the accesses
of selected ref counts in morph, specify RCS_EARLY.

Revise how we decide if normal ref counting is active by changing
`lvaLocalVarRefCounted` into a method.

Update `gtIsLikelyRegVar` to not access ref counts when they're not in a valid
state.

Change weight APIs over to use `weight_t`.

6 years agoMerge pull request #19049 from acmyu/issue19030
Bruce Forstall [Sat, 21 Jul 2018 00:08:51 +0000 (17:08 -0700)]
Merge pull request #19049 from acmyu/issue19030

R2RDump - Skip R2RDumpTests in crossgen tests

6 years agoMerge pull request #19067 from CarolEidt/FixStructRefCnt
Carol Eidt [Fri, 20 Jul 2018 23:17:04 +0000 (16:17 -0700)]
Merge pull request #19067 from CarolEidt/FixStructRefCnt

Remove incRefCnt from fgMakeOutgoingStructArgCopy

6 years agoMerge pull request #19065 from briansull/fix_19022
Brian Sullivan [Fri, 20 Jul 2018 22:36:25 +0000 (15:36 -0700)]
Merge pull request #19065 from briansull/fix_19022

The SIMD types must use the struct code path - Fixes issue 19022

6 years agoImprove narrowing of GT_AND nodes. (#18995)
Eugene Rozenfeld [Fri, 20 Jul 2018 22:35:47 +0000 (15:35 -0700)]
Improve narrowing of GT_AND nodes. (#18995)

This is a follow-up to to #18816 which resulted in a 6 byte regression in one of the
desktop SuperPMI methods. This change removes that regression and adds a number
of improved diffs.

If we are narrowing GT_AND to an unsigned type and one of the operands can be narrowed
into that type, the result of the GT_AND will also fit into that type and can be narrowed.
The same is true if one of the operands is an int const and can be narrowed into 'dsst'.

The change also ensures that we don't call optNarrowTree(false) more than once on each of the
GT_AND operands.

6 years agoUpdate documentation for testing (#19063)
Aaron Robinson [Fri, 20 Jul 2018 22:27:28 +0000 (15:27 -0700)]
Update documentation for testing (#19063)

* Update documentation for testing

6 years agoJIT: handle implicit local var references via local var attribute bit (#19012)
Andy Ayers [Fri, 20 Jul 2018 21:56:09 +0000 (14:56 -0700)]
JIT: handle implicit local var references via local var attribute bit (#19012)

Instead of relying on ref count bumps, add a new attribute bit to local
vars to indicate that they may have implicit references (prolog, epilog,
gc, eh) and may not have any IR references.

Use this attribute bit to ensure that the ref count and weighted ref count for
such variables are never reported as zero, and as a result that these variables
end up being allocated and reportable.

This is another preparatory step for #18969 and frees the jit to recompute
explicit ref counts via an IR scan without having to special case the counts
for these variables.

The jit can no longer describe implicit counts other than 1 and implicit weights
otehr than BB_UNITY_WEIGHT, but that currently doesn't seem to be very important.

The new bit fits into an existing padding void so LclVarDsc remains at 128 bytes
(for windows x64).

6 years agoFix unnnecessary reference to DateTimeFormatInfo.DecimalSeparator (#19064)
Stephen Toub [Fri, 20 Jul 2018 21:11:24 +0000 (17:11 -0400)]
Fix unnnecessary reference to DateTimeFormatInfo.DecimalSeparator (#19064)

6 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview1-03020-01, preview1-26720...
dotnet-maestro-bot [Fri, 20 Jul 2018 12:47:21 +0000 (05:47 -0700)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview1-03020-01, preview1-26720-05, preview1-26720-01, master-20180720-0221, respectively

6 years agoDisable manual COM registration logic on ARM32 (#19042)
Aaron Robinson [Fri, 20 Jul 2018 20:07:25 +0000 (13:07 -0700)]
Disable manual COM registration logic on ARM32 (#19042)

* Add advapi32.lib to the list of libs to link against on ARM.
Remove conditional build on ARM in source.

* Manually edit ARM and ARM64 test lists.

6 years agoZapper::CompileAssembly: save NI file atomically (#19059)
Konstantin Baladurin [Fri, 20 Jul 2018 18:19:08 +0000 (21:19 +0300)]
Zapper::CompileAssembly: save NI file atomically (#19059)

It can get rid of possible problems with corrupted NI files if crossgen
will be killed during image saving.

6 years agoRemove incRefCnt from fgMakeOutgoingStructArgCopy
Carol Eidt [Fri, 20 Jul 2018 14:24:39 +0000 (07:24 -0700)]
Remove incRefCnt from fgMakeOutgoingStructArgCopy

6 years agoMerge pull request #19040 from CarolEidt/DiffFix
Carol Eidt [Fri, 20 Jul 2018 14:20:05 +0000 (07:20 -0700)]
Merge pull request #19040 from CarolEidt/DiffFix

JitDump improvements

6 years agoAdd Tizen 5.0 RID (#19057)
Gleb Balykov [Fri, 20 Jul 2018 14:13:49 +0000 (17:13 +0300)]
Add Tizen 5.0 RID (#19057)

6 years agoImprove throughput of TimeSpan.ToString/TryFormat with "g"/"G" (#19051)
Stephen Toub [Fri, 20 Jul 2018 10:56:57 +0000 (03:56 -0700)]
Improve throughput of TimeSpan.ToString/TryFormat with "g"/"G" (#19051)

* Improve throughput of TimeSpan.ToString/TryFormat with "g"/"G"

TimeSpan has three standard formats: "c", "g", and "G".  Yesterday I updated its implementation with throughput improvements for "c" (the default) based on porting the design from Utf8Formatter; this PR does so for "g"/"G".

Initially I wasn't going to handle "g"/"G" as they factor in culture (Utf8Formatter doesn't), but even with accessing the current culture there are still significant wins to be had.  I was also going to keep the "c" and "g"/"G" implementations separate, to avoid bogging down the default "c" formatting with additional conditions needed to support "g"/"G", but the overhead incurred for that turns out to be minimal enough that it's worth keeping one implementation rather than two mostly-similar ones... the impact on "c" is mostly within noise.

This PR makes a significant throughput improvement for "g"/"G" formatting.  It also removes several unnecessary allocations, such that TryFormat with "g"/"G" is now allocation-free (and ToString just allocates the asked-for string).

* Address PR feedback

6 years agoMinor interop code changes (#19005)
Aaron Robinson [Fri, 20 Jul 2018 07:48:07 +0000 (00:48 -0700)]
Minor interop code changes (#19005)

* Remove SpecialIsGenericTypeVisibleFromCom() from header file

* Clean up if check resulting from remoting code removal

6 years agoFixed missing readonly attribute (#19052)
Phil Garcia [Fri, 20 Jul 2018 07:28:39 +0000 (00:28 -0700)]
Fixed missing readonly attribute (#19052)

6 years agoAdd issues with COM tests in the helix build. (#19047)
Aaron Robinson [Fri, 20 Jul 2018 02:42:48 +0000 (19:42 -0700)]
Add issues with COM tests in the helix build. (#19047)

Presently COM tests does not appear to run properly on Windows.Nano but
there is no way to special case that OS so disabling them on all builds.

6 years agoSkip R2RDumpTests in crossgen tests, test unsupported on ARM
Amy Yu [Fri, 20 Jul 2018 00:01:50 +0000 (17:01 -0700)]
Skip R2RDumpTests in crossgen tests, test unsupported on ARM

6 years agoFixes issue 19022
Brian Sullivan [Fri, 20 Jul 2018 00:56:34 +0000 (17:56 -0700)]
Fixes issue 19022
The SIMD types need to use the struct path when we are building
the zero-initializations in fgMorphRecursiveFastTailCallIntoLoop

6 years agoRemoving WINCORESYS usages from the test projects
Tanner Gooding [Thu, 19 Jul 2018 19:16:06 +0000 (12:16 -0700)]
Removing WINCORESYS usages from the test projects

6 years agoEnable the no tiered compilation innerloop PR legs (#18953)
Noah Falk [Thu, 19 Jul 2018 23:36:34 +0000 (16:36 -0700)]
Enable the no tiered compilation innerloop PR legs (#18953)

Enable the no tiered compilation innerloop PR legs

6 years agoAdding a project reference for CoreCLRTestLibrary to the hwintrinsic test dir.props
Tanner Gooding [Thu, 19 Jul 2018 18:30:24 +0000 (11:30 -0700)]
Adding a project reference for CoreCLRTestLibrary to the hwintrinsic test dir.props

6 years agoRegenerating the HWIntrinsic tests from the updated templates
Tanner Gooding [Thu, 19 Jul 2018 18:00:46 +0000 (11:00 -0700)]
Regenerating the HWIntrinsic tests from the updated templates

6 years agoUpdating the templated HWIntrinsic tests to use `TestLibrary.TestFramework` for logging.
Tanner Gooding [Thu, 19 Jul 2018 17:30:32 +0000 (10:30 -0700)]
Updating the templated HWIntrinsic tests to use `TestLibrary.TestFramework` for logging.

6 years agoBuild xunit wrappers the same way on windows and unix (#18695)
Sven Boemer [Thu, 19 Jul 2018 20:44:16 +0000 (13:44 -0700)]
Build xunit wrappers the same way on windows and unix (#18695)

* Initial change to allow build wrappers and runtest.py

* Build xunit wrappers on unix

The generated wrapper needs to target netcoreapp on unix. I had to
exclude assets from the xunit package and introduce a dependency on
the private corefx bits, to resolve a dependency conflict in which the
generated wrapper was depending on an older System.Runtime.dll than
the helper library.

I also disabled binclash logging, because the wrapper build binplaces
the helper library to the same location multiple times. I couldn't
find a simple way to disable binclash logging for the wrapper build
only, since that requires passing an empty switch to run.exe, and bash
word splitting makes this nontrivial from build-test.

* Correctly generate TestEnv xplat

Note that this will still require changes to the test wrapper
to actually source the TestEnv on unix

* Build xunit wrappers using SDK

* Target netcoreapp2.0 in xunit wrappers

This way, the wrappers can build even if the 2.1 SDK isn't installed on
the machine.

* Restore to packages directory for xunit wrappers

* Move common properties out to dir.common.props

When building wrappers using the SDK, we need some basic
properties (like the build os/arch/config, and the output directories)
to be set. I factored out properties used by both the old test build
and the new SDK-project test build.

At first I tried using Directory.Build.props (which is automatically
imported by the SDK), but our test build already imports SDK targets
in various places, so this was resulting in duplicate
imports. Instead, I used dir.common.props, and made the imports
explicit.

* Remove desktop-specific test wrapper csproj

* Pass build os/arch/type and logsdir to msbuild from runtest.py

* Remove xunit wrapper helper library from traversal build

* Fix parameter passing in build-test.sh

Use bash arrays to pass parameters for the build command. This makes
it possible to pass arguments with spaces to build_Tests_internal. We
use this to disable binclashlogging selectively (for the xunit wrapper
build only).

* Clean up factored .props files

* Undo runtest.sh changes

* Use latest xunit console runner everywhere

* Remove extra StaticDependency on xunit.runner.console

* Eliminate tests/src/dir.common.props, and rename dir.sdkbuild.props

tests/src/dir.common.props was only used for the desktop-specific
xunit wrapper helper library. There's no need for it any more, so its
properties have been moved into tests/src/dir.props.

dir.sdkbuild.props has been renamed to dir.common.props, since it
contains properties used by SDK projects and buildtools projects.

This change also re-enables the test build.

* Reintroduce dir.sdkbuild.props as a place for SDK-only props

With this, some properties shared by SDK projects can go in a global
location. The TargetFramework is shared by all SDK projects in the
test tree.

This change also uses a property for the xunit package directory that
contains the xunit.console.dll we copy to core_root.

* Add xml namespace to dir.common.props

This fixes a failure in the windows build.

* Satisfy xunit analyzer

* Satisfy xunit analyzer again

* Use SDK msbuild to build wrappers

On windows, the use of run.exe, config.json, and msbuild.cmd uses
msbuild.exe on the path. This change will build wrappers using the
local SDK via "dotnet msbuild", bypassing run.exe. Run.exe will go
away entirely with the move from buildtools to arcade, so other build
invocatios should follow suit.

* Remove Microsoft.CSharp.Core.targets workaround

UseBuildTools used to be true all the time. Now that we are building
wrappers on core, UseBuildTools becomes false. However, the rest of
the runtest.proj expects to build using buildtools, so we keep
UseBuildTools true until we switch to arcade.

The CSharpCoreTargetsPath was imported when running on core only. This
used to happen only on unix, but now it also happens when building
runtest.proj for the xunit wrappers on windows. On unix, this targets
file was a symlink to itself to work around some buildtools logic that
expected the file to exist. This workaround no longer appears
necessary, and on windows, this was never used in the first place, so
this change removes it.

* Remove UseRoslynCompilers prop and unify roslyn import

UseRoslynCompilers was introduced in buildtools by
https://github.com/dotnet/buildtools/pull/947, with different
behaviors on windows/unix. It was removed by
https://github.com/dotnet/buildtools/pull/1974, so we can unify our
roslyn imports now.

* Don't copy xunit dlls to corefx test host

The corefx tests run on specific versions of xunit dlls, defined in
CoreFX.depproj. We want to use these versions in the test host, not
those in CORE_ROOT, so exclude these from being copied to the test host
directory. This fixes the failing corefx tests.

* Don't pass run.exe arguments through build-test.cmd in test pipeline

These arguments get passed along to the xunit wrapper build as
unprocessed build args. They need to work for "dotnet msbuild" (used
for the wrapper build) as well as for run.exe.

* Fix parameter passing of priority arg in build-test.cmd

UnprocessedBuildArgs should contain arguments in the format expected by
msbuild, not by run.exe.

* Fix parameter passing of unprocessed args in build-test.cmd

The "--" syntax is used by run.exe to pass everything following to
msbuild directly. It should not be a part of unprocessed args.

* Pass TargetsWindowsArg to wrapper build in build-test.cmd

Helix builds tests on windows and runs them on unix using the xunit
wrappers. When cross-building the wrappers like this, TargetsWindows
is set to false by the test build pipeline. This variable ensures that
the wrapper uses correct directory separators when invoking the test
.sh file.

* Pass BuildTestsAgainstPackages arg to exclude unix tests

Helix builds xunit wrappers on windows, and runs them on unix. The
BuildTestsAgainstPackages should currently be set to true in the
windows wrapper build to properly filter the .cmd files based on
exclusions in issues.targets.

6 years agoFix desktop build break
Jan Kotas [Wed, 18 Jul 2018 21:02:13 +0000 (14:02 -0700)]
Fix desktop build break

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
6 years agoJitDump improvements
Carol Eidt [Thu, 19 Jul 2018 19:11:20 +0000 (12:11 -0700)]
JitDump improvements

- Reduce the size of "diffable" values (I've been encountering a number of diffs on x86; 2 bits seems to take care of it)
- Dump a note when we start morphing args for a call.

6 years agoMerge pull request #18999 from CarolEidt/Fix16359
Carol Eidt [Thu, 19 Jul 2018 18:08:33 +0000 (11:08 -0700)]
Merge pull request #18999 from CarolEidt/Fix16359

Arm64: Fix handling of IP0 & IP1

6 years agoMerge pull request #19032 from BruceForstall/DisableR2rDumpTestForJitStress
Bruce Forstall [Thu, 19 Jul 2018 18:04:49 +0000 (11:04 -0700)]
Merge pull request #19032 from BruceForstall/DisableR2rDumpTestForJitStress

Disable r2rdump test for JIT stress currently

6 years agoDisable r2rdump test for JIT stress currently
Bruce Forstall [Thu, 19 Jul 2018 17:10:02 +0000 (10:10 -0700)]
Disable r2rdump test for JIT stress currently

Tracked by issue #19011

6 years agoMerge pull request #19004 from BruceForstall/FixX86UbuntuJobs
Bruce Forstall [Thu, 19 Jul 2018 16:02:24 +0000 (09:02 -0700)]
Merge pull request #19004 from BruceForstall/FixX86UbuntuJobs

Disable failing Ubuntu x86 jobs

6 years agoUse mcontext_t instead of sigcontext (#18983)
Kai Ruhnau [Thu, 19 Jul 2018 15:41:15 +0000 (17:41 +0200)]
Use mcontext_t instead of sigcontext (#18983)

The type of uc_mcontext has always been `mcontext_t`, but earlier versions of Glibc just typedef'ed this to `sigcontext`.

Newer versions of Glibc (since 2.27) [introduced an explicit struct type](https://sourceware.org/git/?p=glibc.git;a=blobdiff;f=sysdeps/unix/sysv/linux/arm/sys/ucontext.h;h=192d1bdeac3e62e13110f68614f7af624047c3a9;hp=2abceef2a4ca9bbb6e42208eaee548228b041e5b;hb=4fa9b3bfe6759c82beb4b043a54a3598ca467289;hpb=5898f4548efdcd7c0fd437a74eeb80facc51a117) and now compilation fails.

6 years agoAdd MemoryMarshal.AsRef implementation (#19021)
Jan Kotas [Thu, 19 Jul 2018 15:29:36 +0000 (08:29 -0700)]
Add MemoryMarshal.AsRef implementation (#19021)

Contributes to https://github.com/dotnet/corefx/issues/30613

6 years agoFix opinfo: InlineR should only read 8 bytes (#18801)
sunnycase [Thu, 19 Jul 2018 08:05:40 +0000 (16:05 +0800)]
Fix opinfo: InlineR should only read 8 bytes (#18801)

6 years agoEliminate arm64 contract asserts (#19015)
Noah Falk [Thu, 19 Jul 2018 07:28:31 +0000 (00:28 -0700)]
Eliminate arm64 contract asserts (#19015)

These methods don't trigger GC but were previously marked as if they did. Correcting the marking will eliminate spurious asserts.

6 years agoUpdate CoreClr to preview1-26719-01 (#19016)
dotnet-maestro-bot [Thu, 19 Jul 2018 07:16:55 +0000 (00:16 -0700)]
Update CoreClr to preview1-26719-01 (#19016)

6 years agoImplement GetComObjectData and SetComObjectData (#18900)
Hugh Bellamy [Thu, 19 Jul 2018 03:29:30 +0000 (04:29 +0100)]
Implement GetComObjectData and SetComObjectData (#18900)

* Cleanup Marshal.cs

* Cleanup __ComObject

* Implement GetComObjectData and SetComObjectData

* Build fixes

* PR feedback and more marshal cleanup

* More feedback

* Disable corefx tests

* Address PR feedback

* Fix build breaking typo

* Test disable

6 years agoBasic .NET client tests (#18843)
Aaron Robinson [Thu, 19 Jul 2018 00:52:02 +0000 (17:52 -0700)]
Basic .NET client tests (#18843)

- Add support for a testing primitive marshalling with a native COM server
and .NET client. This uses RegFree COM for activation.
- Remove ClassicCOM tests
- Bring back tests for activation via reflection

6 years agoDisable failing Ubuntu x86 jobs
Bruce Forstall [Wed, 18 Jul 2018 23:33:54 +0000 (16:33 -0700)]
Disable failing Ubuntu x86 jobs

Also add a minimal fix that fixes a current problem, but isn't
expected to help fix the entire issue.

Failures tracked by https://github.com/dotnet/coreclr/issues/19003.

6 years agoImprove TimeSpan.ToString/TryFormat throughput for default format (#18990)
Stephen Toub [Wed, 18 Jul 2018 23:10:42 +0000 (16:10 -0700)]
Improve TimeSpan.ToString/TryFormat throughput for default format (#18990)

6 years agoProperly type morphed NEG nodes (#18837)
Jakob Botsch Nielsen [Wed, 18 Jul 2018 22:57:17 +0000 (00:57 +0200)]
Properly type morphed NEG nodes (#18837)

* Properly type optimized NEG nodes

When the JIT was morphing trees like '-1 * expr', it would turn the
multiplication into a NEG node with the same type as its right operand.
This is a problem when the right operand was a small type like TYP_UBYTE
because the NEG node always produces a widened result. This could cause
problems when the negation was fed into something that depended on the
type, such as a cast to TYP_UBYTE: here the JIT would conclude that the
cast could be dropped, and end up producing a widened result.

The solution is to give the tree the actual type of the NEG node.

Also add a test for this case and for a similar case of '0 - expr',
which already had a fix.

Fix #18780

* Address PR feedback

* Clarify comment

6 years agoJIT: force all local var ref counts to be accessed via API (#18979)
Andy Ayers [Wed, 18 Jul 2018 21:35:08 +0000 (14:35 -0700)]
JIT: force all local var ref counts to be accessed via API (#18979)

This is a preparatory change for auditing and controlling how local
variable ref counts are observed and manipulated.

See #18969 for context.

No diffs seen locally. No TP impact expected.

There is a small chance we may see some asserts in broader testing
as there were places in original code where local ref counts were
incremented without checking for possible overflows. The new APIs
will assert for overflow cases.

6 years agoUpdate CoreClr, PgoData to preview1-26718-05, master-20180718-0214, respectively...
dotnet-maestro-bot [Wed, 18 Jul 2018 20:46:37 +0000 (13:46 -0700)]
Update CoreClr, PgoData to preview1-26718-05, master-20180718-0214, respectively (#18978)

6 years agoArm64: Fix handling of IP0 & IP1
Carol Eidt [Wed, 18 Jul 2018 20:41:59 +0000 (13:41 -0700)]
Arm64: Fix handling of IP0 & IP1

These are sometimes mandated to be allocated to certain nodes, but they were not in the list of allocatable registers (REG_VAR_ORDER). This led to special handling in LSRA, which, it turns out, was incomplete. This resulted in failures for JitStressRegs=0x200.
Based on the discussion in #14607, this adds IP0 to RBM_CALLEE_TRASH_NOGC, and fixes the REG_VAR_ORDER.

Fix #14607, Fix #16359, Fix #17861

6 years agoMerge pull request #18970 from BruceForstall/FixAltjitCorefxTests
Bruce Forstall [Wed, 18 Jul 2018 19:29:21 +0000 (12:29 -0700)]
Merge pull request #18970 from BruceForstall/FixAltjitCorefxTests

Fix corefx altjit test jobs

6 years agoR2RDump - Test infrastructure (#18745)
Amy [Wed, 18 Jul 2018 19:26:36 +0000 (12:26 -0700)]
R2RDump - Test infrastructure (#18745)

* Test infrastructure for R2RDump, compare xml and output diff

* Add R2RDumpTest to build-tests

* Fix errors causing tests to fail

* Create XUnitWrapper for R2RDumpTest

* Generate readytorun binaries from source code, copy expected xml output files to executable's directory

* Test R2RDump through commandline instead of calling R2RDump functions

* Fix errors

* Prevent duplicate xml tags

* Read test xml from string instead of file

* Fix test bugs

* Call dotnet r2rdump from msbuild

* Fix errors

* Use right slash for paths in bash

* Use different expected xml for different architectures

* R2RDumpTests for non-Windows

* Add more test cases

* Fix errors

* Supress warnings, avoid error when parsing x86 images

* Add license headers

6 years agoRevert "Improve narrowing of GT_AND nodes. (#18916)" (#18975)
Jan Kotas [Wed, 18 Jul 2018 19:00:42 +0000 (12:00 -0700)]
Revert "Improve narrowing of GT_AND nodes. (#18916)" (#18975)

This reverts commit c0bad3c66218f61dd3e4f151b9d2eae22c6d88d2.

6 years agoUse FD_CLOEXEC instead of 1. (#18976)
Jay Krell [Wed, 18 Jul 2018 19:00:19 +0000 (12:00 -0700)]
Use FD_CLOEXEC instead of 1. (#18976)

6 years agoMerge pull request #18941 from CarolEidt/Fix18884
Carol Eidt [Wed, 18 Jul 2018 18:01:46 +0000 (11:01 -0700)]
Merge pull request #18941 from CarolEidt/Fix18884

Kill RCX when used by shift

6 years agoUse api-set instead of combase.dll (#18981)
Jan Kotas [Wed, 18 Jul 2018 17:42:00 +0000 (10:42 -0700)]
Use api-set instead of combase.dll (#18981)

6 years agoRemove unuseful null check on Activator.CreateInstance (#18806)
Marco Rossignoli [Wed, 18 Jul 2018 10:43:02 +0000 (12:43 +0200)]
Remove unuseful null check on Activator.CreateInstance (#18806)

6 years agoOptimize {Try}FormatDecimal (#18935)
Pent Ploompuu [Wed, 18 Jul 2018 10:14:49 +0000 (13:14 +0300)]
Optimize {Try}FormatDecimal (#18935)

6 years agoDelete Span ifdefs that are no longer needed (#18982)
Jan Kotas [Wed, 18 Jul 2018 10:13:15 +0000 (03:13 -0700)]
Delete Span ifdefs that are no longer needed (#18982)

6 years agoFix corefx altjit test jobs
Bruce Forstall [Tue, 17 Jul 2018 21:32:33 +0000 (14:32 -0700)]
Fix corefx altjit test jobs

Recently, the corefx build switched from using the VS installed msbuild
to using "dotnet msbuild" for doing builds. This changed the way
command-line parsing was handled.

If we continue to pass the WithoutCategories argument on the command-line,
it ends up requiring an extraordinary number of "escape" backslashes
to preserve exactly the right number of backslashes that will be passed
through to the actual invocation of msbuild. That seems complex and also
not robust to future change.

Instead, construct a response file with the simple required string,
that will be passed directly through to msbuild.

6 years agoEnable CoreFx tests disabled in https://github.com/dotnet/coreclr/issues/17753 (...
Egor Chesakov [Tue, 17 Jul 2018 23:22:27 +0000 (16:22 -0700)]
Enable CoreFx tests disabled in https://github.com/dotnet/coreclr/issues/17753 (#18967)

6 years agoClean-up number.cpp (#18964)
Pent Ploompuu [Tue, 17 Jul 2018 21:59:00 +0000 (00:59 +0300)]
Clean-up number.cpp (#18964)

6 years ago Add pooling for JIT scratch memory (#18924)
Jan Kotas [Tue, 17 Jul 2018 19:11:33 +0000 (12:11 -0700)]
 Add pooling for JIT scratch memory  (#18924)

Fixes #3408

6 years agoUpdate CoreClr, CoreFx, PgoData to preview1-26717-04, preview1-26717-04, master-20180...
dotnet-maestro-bot [Tue, 17 Jul 2018 19:10:53 +0000 (12:10 -0700)]
Update CoreClr, CoreFx, PgoData to preview1-26717-04, preview1-26717-04, master-20180717-0139, respectively (master) (#18961)

* Update CoreClr, CoreFx, PgoData to preview1-26717-04, preview1-26717-04, master-20180717-0139, respectively

* Disabled outdated tests

6 years agoUpdate NativeCallable attribute tests (#18946)
Aaron Robinson [Tue, 17 Jul 2018 18:12:02 +0000 (11:12 -0700)]
Update NativeCallable attribute tests (#18946)

* Update NativeCallable attribute tests

6 years agoMerge pull request #18938 from vancem/EventSourceShutdown
Vance Morrison [Tue, 17 Jul 2018 17:42:28 +0000 (10:42 -0700)]
Merge pull request #18938 from vancem/EventSourceShutdown

Add back in code deleted in .NET Core port.

6 years agoKill RCX when used by shift
Carol Eidt [Mon, 16 Jul 2018 18:37:40 +0000 (11:37 -0700)]
Kill RCX when used by shift

RCX must be explicitly killed. Otherwise, if there's a case of a def/use conflict - as in this test case where the shift amount is defined by a divide that must go in RAX, it won't be explicitly assigned to RCX,.
Also, the handling of conflicts must not use the register assignment of the def on the use  if it conflicts with the use register requirements, and vice versa.

Fix #18884

6 years agoMerge pull request #18891 from CarolEidt/Fix18153
Carol Eidt [Tue, 17 Jul 2018 15:54:42 +0000 (08:54 -0700)]
Merge pull request #18891 from CarolEidt/Fix18153

Ensure BuildUse uses the correct reg number

6 years agoMove Decimal to shared (#18948)
Pent Ploompuu [Tue, 17 Jul 2018 15:41:39 +0000 (18:41 +0300)]
Move Decimal to shared (#18948)

* Move Decimal to shared

* Remove DecimalCanonicalize{Internal}

6 years agoImprove throughput of {U}Int32/64.{Try}Parse for hex (#18952)
Stephen Toub [Tue, 17 Jul 2018 13:00:11 +0000 (06:00 -0700)]
Improve throughput of {U}Int32/64.{Try}Parse for hex (#18952)

* Improve throughput of {U}Int32/64.{Try}Parse for hex

- Copies/modifies the recently added TryParse32/64IntegerStyle routines for hex in order to provide more optimized parsing.
- Since AllowHexSpecifier can't be used with any other styles (other than allowing leading/trailing whitespace), deletes existing code paths for parsing hex.
- As I was copying code around, I kept getting bitten by different names used for the same thing, so I also standardized some parameter names in various helper functions.

* Clean up

- Remove a bunch of unnecessary 'unsafe' keywords
- Rephrase some while(true) loops as do/while loops for consistency and to avoid some repetition
- Remove an unnecessary wrapper function

6 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview1-03013-03, preview1-26716...
dotnet-maestro-bot [Tue, 17 Jul 2018 11:27:23 +0000 (04:27 -0700)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview1-03013-03, preview1-26716-04, preview1-26717-02, master-20180716-0324, respectively (master) (#18927)

* Update BuildTools, CoreClr, CoreFx, PgoData to preview1-03013-03, preview1-26716-04, preview1-26717-02, master-20180716-0324, respectively

* Update EventPipe StackWalker usage to specify ALLOW_INVALID_OBJECTS.

6 years agoDelete redundant broken offsetof definitions (#18947)
Jan Kotas [Tue, 17 Jul 2018 08:51:57 +0000 (01:51 -0700)]
Delete redundant broken offsetof definitions (#18947)

Fixes build breaks with latest Visual Studio Preview.

Fixes #18338

6 years agoApply tiering's call counting delay more broadly (#18610)
Koundinya Veluri [Tue, 17 Jul 2018 05:04:07 +0000 (22:04 -0700)]
Apply tiering's call counting delay more broadly (#18610)

Apply tiering's call counting delay more broadly

Issues
- When some time passes between process startup and first significant use of the app, startup perf with tiering can be slower because the call counting delay is no longer in effect
- This is especially true when the process is affinitized to one cpu

Fixes
- Initiate and prolong the call counting delay upon tier 0 activity (jitting or r2r code lookup for a new method)
- Stop call counting for a called method when the delay is in effect
- Stop (and don't start) tier 1 jitting when the delay is in effect
- After the delay resume call counting and tier 1 jitting
- If the process is affinitized to one cpu at process startup, multiply the delay by 10

No change in benchmarks.