platform/upstream/coreclr.git
5 years agoUpdate CoreClr, CoreFx, PgoData to preview-27309-02, preview.19059.7, master-20190109...
dotnet-maestro-bot [Thu, 10 Jan 2019 06:42:37 +0000 (22:42 -0800)]
Update CoreClr, CoreFx, PgoData to preview-27309-02, preview.19059.7, master-20190109.7, respectively (#21905)

5 years agoMerge pull request #21893 from AndyAyersMS/ReconcileInlineBudgetUsingSizeOfImportedIL
Andy Ayers [Thu, 10 Jan 2019 02:07:08 +0000 (18:07 -0800)]
Merge pull request #21893 from AndyAyersMS/ReconcileInlineBudgetUsingSizeOfImportedIL

JIT: modify inline budget update to use estimated imported IL size

5 years agoMerge pull request #21779 from mazong1123/fix-19166-checkproj-opt
Andy Ayers [Thu, 10 Jan 2019 01:41:39 +0000 (17:41 -0800)]
Merge pull request #21779 from mazong1123/fix-19166-checkproj-opt

Check the optimize settings of JIT test projects.

5 years agoImplement AssemblyDependencyResolver (#21896)
Jeremy Koritzinsky [Thu, 10 Jan 2019 00:02:36 +0000 (16:02 -0800)]
Implement AssemblyDependencyResolver (#21896)

* Implementation of ComponentDependencyResolver

PInvokes into hostpolicy.dll (which should live next to the runtime and thus always be reachable).
If the PInvoke fails (missing hostpolicy.dll) we will fail for now.

Adds tests for the API into CoreCLR repo. The main reason is that with corerun
we can easily mock the hostpolicy.dll since there's none to start with.
Writing the same tests in CoreFX or any other place which starts the runtime through
hostpolicy would require test-only functionality to exist in either the class itself
or in the hostpolicy.

* Fix test project file to work outside of VS

* Better test cleanup to not leave artifacts on disk.

* CDR native resolution tests

 Add native resolution tests

* Implements detailed error reporting for ComponentDependencyResolver.

Registers error writer with the hostpolicy to receive detailed errors. Uses that in the exception.

Modifications to the mock and the tests to be able to verify the functionality.

* Revert overly eager cleanup

* Change public API surface naming to match the approved API surface.

* Fix nits.

* Fix renames.

5 years agoSpecify the minimum supported version of macOS (#21816)
Egor Chesakov [Wed, 9 Jan 2019 23:18:47 +0000 (15:18 -0800)]
Specify the minimum supported version of macOS (#21816)

* Pass the minimum supported version of macOS option to both compile and link stages in configurecompiler.cmake

* Enable OSX.1012.Amd64.* open and internal queues and add OSX.1014.Amd64 queue in eng/platform-matrix.yml

5 years agoAdd tests for our layout-class marshalling (#20867)
Jeremy Koritzinsky [Wed, 9 Jan 2019 23:03:43 +0000 (15:03 -0800)]
Add tests for our layout-class marshalling (#20867)

* Add simple test for the LayoutClassMarshaler (most of the code is already covered by the struct marshalling tests).

* Add test for blittable layout class.

* Apparently layout classes are passed by value when passed as struct fields instead of byref.

5 years agoMove OperationStatus into shared source (#21912)
Levi Broderick [Wed, 9 Jan 2019 21:58:59 +0000 (13:58 -0800)]
Move OperationStatus into shared source (#21912)

This is the first step to moving OperationStatus from corefx into coreclr. It'll be used by the transcoding APIs which live in System.Private.CoreLib.

5 years agoAddressing https://github.com/dotnet/coreclr/issues/21461 (#21771)
José Rivero [Wed, 9 Jan 2019 21:48:30 +0000 (13:48 -0800)]
Addressing https://github.com/dotnet/coreclr/issues/21461 (#21771)

- Increase the polling interval to 20 seconds.
- Provide an opt-out option to the EventPipe file polling.

5 years agoFix DynamicMethodDesc memory leak (#21891)
Jan Vorlicek [Wed, 9 Jan 2019 21:21:03 +0000 (22:21 +0100)]
Fix DynamicMethodDesc memory leak (#21891)

The DynamicMethodTable::AddMethodsToList was incorrectly allocating the
MethodDescChunk from the domain's LoaderAllocator instead of the context
specific one. Thus the allocated memory was leaking after a collectible
AssemblyLoadContext was collected.

There was also a problem with the DynamicMethodDesc::Destroy being
called twice for collectible classes - once by
RuntimeMethodHandle::Destroy() and once when the DomainFile destructor
was called. Due to the primary issue, this problem was not visible,
since the domain's LoaderAllocator is never unmapped. But it started to
cause AV after the primary issue was fixed.

5 years agoChange CoreLib native image to be R2R by default on all platforms (#21497)
Fadi Hanna [Wed, 9 Jan 2019 21:19:04 +0000 (13:19 -0800)]
Change CoreLib native image to be R2R by default on all platforms (#21497)

5 years agoFix perf-prep to pass the branch name (#21911)
Michelle McDaniel [Wed, 9 Jan 2019 20:56:30 +0000 (12:56 -0800)]
Fix perf-prep to pass the branch name (#21911)

For the release branches, we need to specify the branch name when pulling down coreclr test artifacts, and not just pull down from master. This change modifies perf-prep.sh to allow us to specify the branch name, which we will then port to the release branches.

5 years agoMerge pull request #20772 from mikedn/ir-cleanup
Bruce Forstall [Wed, 9 Jan 2019 19:07:20 +0000 (11:07 -0800)]
Merge pull request #20772 from mikedn/ir-cleanup

Some IR cleanup

5 years agoRemove extraneous eightbytes check for native structures and add tests. (#21590)
Jeremy Koritzinsky [Wed, 9 Jan 2019 18:06:25 +0000 (10:06 -0800)]
Remove extraneous eightbytes check for native structures and add tests. (#21590)

* Remove extraneous eightbytes check and add tests.

* Interger -> Integer

* Missed Helper.cs

* Handle field sizes larger than 8 bytes in AssignClassifiedEightByteTypes

* Move CoreFX test case into CoreCLR.  Fix the SystemV eightbyte classifier to correctly classify the second eightbyte when a single field crosses the eightbyte boundary (such as an in-place array of three 4-byte enums).

* Enable passing user defined structs in in-place arrays in a structure if SystemV ABI expects it.

* Correctly handle a field spanning two full eightbytes.

* Just directly assign 0 to accumulatedSizeForEightByte

* Change multi-eightbyte field handling to be a loop as per PR feedback.

* Remove extraneous whitespace.

5 years agoSupport building with python3 on unix (#19356)
Omair Majid [Wed, 9 Jan 2019 17:28:48 +0000 (12:28 -0500)]
Support building with python3 on unix (#19356)

The windows build scripts try finding python in order of python3,
python2 and then python. The unix build scripts dont. They just try
python2 variants and then fail. This change makes brings them closer
together by letting users build using only python3.

5 years agoMore DispatchWrapper tweaks
Jan Kotas [Wed, 9 Jan 2019 12:17:49 +0000 (04:17 -0800)]
More DispatchWrapper tweaks

5 years agoRemoves PNSE version of DispatchWrapper and keep only single version with ifdef
Marek Safar [Wed, 9 Jan 2019 09:44:46 +0000 (10:44 +0100)]
Removes PNSE version of DispatchWrapper and keep only single version with ifdef

5 years agoDelete files moved to shared partition
Jan Kotas [Wed, 9 Jan 2019 06:55:58 +0000 (22:55 -0800)]
Delete files moved to shared partition

5 years agoMoves common COM type to shared corelib partition (dotnet/corert#6782)
Marek Safar [Wed, 9 Jan 2019 01:27:26 +0000 (02:27 +0100)]
Moves common COM type to shared corelib partition (dotnet/corert#6782)

* Moves common COM type to shared corelib partition

* Moves GetHRForException to PInvokeMarshal

* Add temporary CORECLR ifdef to ArrayWithOffset

* Apply cleanup from CoreCLR

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agofix DateTime overflow on ARM32 (#21902)
Tomas Weinfurt [Wed, 9 Jan 2019 10:53:35 +0000 (02:53 -0800)]
fix DateTime overflow on ARM32 (#21902)

5 years agoUpdate gtLclILoffs related comments
Mike Danes [Wed, 9 Jan 2019 06:42:02 +0000 (08:42 +0200)]
Update gtLclILoffs related comments

5 years agoMerge pull request #21867 from adityamandaleeka/fix_writebarrier_bounds_check
Aditya Mandaleeka [Wed, 9 Jan 2019 03:43:18 +0000 (19:43 -0800)]
Merge pull request #21867 from adityamandaleeka/fix_writebarrier_bounds_check

Fix write barrier bounds checks for ARM64 Unix.

5 years agoMerge pull request #21857 from AndyAyersMS/RangeCheckSmallTypes
Andy Ayers [Wed, 9 Jan 2019 02:42:59 +0000 (18:42 -0800)]
Merge pull request #21857 from AndyAyersMS/RangeCheckSmallTypes

JIT: infer ranges from small int type operations

5 years agoEnable FinalizeQueue SOS command for Unix (#21876)
Jan Vorlicek [Wed, 9 Jan 2019 02:00:36 +0000 (03:00 +0100)]
Enable FinalizeQueue SOS command for Unix (#21876)

The command is very useful and there seems to be no reason for it to not to be enabled on Unix.

5 years agoCopy address-taken SIMD intrinsic (#21884)
Carol Eidt [Wed, 9 Jan 2019 01:46:17 +0000 (17:46 -0800)]
Copy address-taken SIMD intrinsic (#21884)

* Copy address-taken SIMD intrinsic

This occurs, for example, when boxing the result of a SIMD intrinsic. This was being handled for the HW intrinsic case, but not the SIMD Vector intrinsics. Also, eliminate `OperIsSimdHWIntrisic` since it redundantly checks for the case of a SIMD result, even though it was always called in a context where the result is known to be a struct type.

Fix #21854

5 years agoExpose string.Concat(ReadOnlySpan, ...) (#21882)
Stephen Toub [Wed, 9 Jan 2019 01:01:36 +0000 (20:01 -0500)]
Expose string.Concat(ReadOnlySpan, ...) (#21882)

* Expose string.Concat(ReadOnlySpan, ...)

* Add String.Empty fast path to string.Concat(ReadOnlySpan, ...)

5 years agoUpdate Test exclusion for NativeLibraryTests in official builds. (#21858)
Swaroop Sridhar [Wed, 9 Jan 2019 00:01:20 +0000 (16:01 -0800)]
Update Test exclusion for NativeLibraryTests in official builds. (#21858)

Update issues.targets, to reflect the change in location of
NativeLibray tests.

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

5 years agoUse `saveNext` unwind opcode on arm64. (#21683)
Sergey Andreenko [Tue, 8 Jan 2019 23:40:50 +0000 (15:40 -0800)]
Use `saveNext` unwind opcode on arm64. (#21683)

* Use `saveNext` opcode on arm64.

* Support using of  `save_next` on int/float border.

* Delete the extra requirement that an epilog sequences can't start from `save_next`.

* response feedback

5 years agocheck for valid IL offsets before computing block ILsize
Andy Ayers [Tue, 8 Jan 2019 23:19:42 +0000 (15:19 -0800)]
check for valid IL offsets before computing block ILsize

5 years agoExtract cleanup changes from #21793. (#21852)
Jeremy Koritzinsky [Tue, 8 Jan 2019 22:50:42 +0000 (14:50 -0800)]
Extract cleanup changes from #21793. (#21852)

* Cleanup changes from #21793.

* Emit the data pointer offset directly into the IL stream (and calculate it as needed instead of passing it through)

* Fix broken assumption that OverrideProcArgs::na::m_pMT is the array type instead of the element type (which it was).

5 years agoJIT: modify inline budget update to use estimated imported IL size
Andy Ayers [Tue, 8 Jan 2019 19:27:32 +0000 (11:27 -0800)]
JIT: modify inline budget update to use estimated imported IL size

The inliner keeps a time budget to try and avoid pathological runaway inline
behavior (see #4375). The jit estimates the time impact of an inline using a
simple projection based on IL size. If an prospective inline would put the jit
over the time budget, the inline is blocked -- and note even aggressive inlines
can be blocked this way.

We now have a fair number of aggressive inline methods like
`Vector256<T>.IsSupported` where the IL is optimized early on by the jit and the
actual impact on the calling method is much less than the initial IL size would
suggest. For instance `IsSupported` is 286 bytes of IL, but the net contribution
of this method at jit time is either a constant 0 or 1, and so the effective size
is more like 2 bytes of IL.

This set of changes updates the jit to estimate the imported IL size of a method
when updating the budget.

Closes #21794.

5 years agoFix consistency between `-` and prefixless args in build.cmd (#20248)
Charles Milette [Tue, 8 Jan 2019 22:16:34 +0000 (17:16 -0500)]
Fix consistency between `-` and prefixless args in build.cmd (#20248)

* Fix consistency between `-` and prefixless args in build.com

* Remove -generatelayout

Already PR'd by someone else

5 years agoMerge pull request #20409 from lol768/patch-1
Bruce Forstall [Tue, 8 Jan 2019 22:02:15 +0000 (14:02 -0800)]
Merge pull request #20409 from lol768/patch-1

Add a note to clarify debugging w/ dotnet is fine

5 years agoUpdated "Viewing JIT Dumps" for .NET Core 3.0 (#21687)
Günther Foidl [Tue, 8 Jan 2019 21:15:48 +0000 (22:15 +0100)]
Updated "Viewing JIT Dumps" for .NET Core 3.0 (#21687)

* Updated "Viewing JIT Dumps" for .NET Core 3.0

plus some minor wording change

* Incorporated changes from https://github.com/dotnet/coreclr/pull/21859

5 years agoUpdate CoreClr, CoreFx to preview-27308-03, preview.19058.1, respectively (#21877)
dotnet-maestro-bot [Tue, 8 Jan 2019 21:00:27 +0000 (13:00 -0800)]
Update CoreClr, CoreFx to preview-27308-03, preview.19058.1, respectively (#21877)

5 years agoFix write barrier bounds checks for ARM64 Unix
Aditya Mandaleeka [Tue, 8 Jan 2019 02:52:10 +0000 (18:52 -0800)]
Fix write barrier bounds checks for ARM64 Unix

5 years agoMerge pull request #21880 from BruceForstall/FixTestReportsArchiving
Bruce Forstall [Tue, 8 Jan 2019 19:36:43 +0000 (11:36 -0800)]
Merge pull request #21880 from BruceForstall/FixTestReportsArchiving

Update test reports archiving

5 years agoUpdate test reports archiving
Bruce Forstall [Tue, 8 Jan 2019 19:02:40 +0000 (11:02 -0800)]
Update test reports archiving

Two things:
1. Turn "echo" back on after runtests.cmd, so we see in the log file
the testReports.zip compression.
2. Change the archiving of testReports.zip to not occur even if the
test run fails (this is actually the most interesting case), and don't
fail if there is nothing to archive.

5 years agoFix issue #20585 createdump explicitly uses /tmp. (#21866)
Mike McLaughlin [Tue, 8 Jan 2019 17:35:12 +0000 (09:35 -0800)]
Fix issue #20585 createdump explicitly uses /tmp. (#21866)

Changed to PAL's GetTempPathA to get the temp path.

5 years agoFixed potential memory leak (#21872)
Oded Hanson [Tue, 8 Jan 2019 17:34:25 +0000 (19:34 +0200)]
Fixed potential memory leak (#21872)

5 years agoUpdate CoreClr, CoreFx, PgoData to preview-27308-01, preview.19057.3, master-20190108...
dotnet-maestro-bot [Tue, 8 Jan 2019 14:06:58 +0000 (06:06 -0800)]
Update CoreClr, CoreFx, PgoData to preview-27308-01, preview.19057.3, master-20190108-0040, respectively (#21830)

5 years agoAttempt to fix paths with spaces again (#21837)
Viktor Hofer [Tue, 8 Jan 2019 13:13:48 +0000 (14:13 +0100)]
Attempt to fix paths with spaces again (#21837)

5 years agoFix path length 255 (#21838)
Dan Moseley [Tue, 8 Jan 2019 06:25:27 +0000 (22:25 -0800)]
Fix path length 255 (#21838)

* Fix path length 255

* Fix assert

* Dead code

5 years agoUpdate ceemain.cpp (#21869)
Will Cohen [Tue, 8 Jan 2019 06:19:28 +0000 (17:19 +1100)]
Update ceemain.cpp (#21869)

5 years agoCoreRT updates for files moved to shared partition
Jan Kotas [Tue, 8 Jan 2019 02:18:03 +0000 (18:18 -0800)]
CoreRT updates for files moved to shared partition

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoMoves ComTypes to shared partition (#21861)
Marek Safar [Tue, 8 Jan 2019 00:57:44 +0000 (01:57 +0100)]
Moves ComTypes to shared partition (#21861)

5 years agoFixing ContainCheckHWIntrinsic to ensure that scalar integer operands are the appropr...
Tanner Gooding [Tue, 8 Jan 2019 00:57:34 +0000 (16:57 -0800)]
Fixing ContainCheckHWIntrinsic to ensure that scalar integer operands are the appropriate size (#21641)

* Fixing ContainCheckHWIntrinsic to ensure that scalar integer operands are the appropriate size

* Adding a regression test for issue 21625

* Fixing IsContainableHWIntrinsicOp to use the containing node type (rather than the simd base type) for Scalar intrinsics

* Fixing the containment check for `Sse41.Insert(V128<float>, V128<float>, byte)`

* Cleaning up the isContainableHWIntrinsicOp logic in lowerxarch.cpp

* Restrict containment to genActualType(baseType)

* Formatting

* Removing some comments and simplifying the supportsContainment checks for various HWIntrinsics that take a scalar operand

* Applying formatting patch

5 years agoCheck GenerateGuidForType argument for null (#21851)
Stephen Toub [Tue, 8 Jan 2019 00:22:14 +0000 (19:22 -0500)]
Check GenerateGuidForType argument for null (#21851)

* Check GenerateGuidForType argument for null

* Also check for RuntimeType

5 years agoCollect Windows test run logs into testReports.zip file (#21813)
Bruce Forstall [Mon, 7 Jan 2019 22:14:33 +0000 (14:14 -0800)]
Collect Windows test run logs into testReports.zip file (#21813)

* Collect Windows test run logs into testReports.zip file

And upload these to Jenkins, so we can see how the tests ran.

* Archive test Reports even if the test run fails

* Need to use "call" when invoking runtest.cmd batch file

5 years agoFix CharSet on StringBuilder hidden null terminator test (#21853)
Jeremy Koritzinsky [Mon, 7 Jan 2019 22:11:12 +0000 (14:11 -0800)]
Fix CharSet on StringBuilder hidden null terminator test (#21853)

5 years agoActually fix issue #21484 reported by the customer. (#21850)
Mike McLaughlin [Mon, 7 Jan 2019 21:33:29 +0000 (13:33 -0800)]
Actually fix issue #21484 reported by the customer. (#21850)

GC heap globals like ephemeral_heap_segment and finalize_queue are
null/invalid for a server GC. Add a check to skip the workstation GC
memory enumeration if server. The server memory enumeration already
skips if workstation GC.

5 years agoJIT: infer ranges from small int type operations
Andy Ayers [Mon, 7 Jan 2019 21:15:27 +0000 (13:15 -0800)]
JIT: infer ranges from small int type operations

Have range check use the ranges for small int types if it has no better
information.

Fixes #21481

5 years agoJIT: encapsulate general checks for optimization (#21822)
Andy Ayers [Mon, 7 Jan 2019 21:12:39 +0000 (13:12 -0800)]
JIT: encapsulate general checks for optimization (#21822)

* JIT: encapsulate general checks for optimization

Add methods that answer the general question of whether or not
the jit is optimizing the code it produces.

Use this to replace composite checks for minopts and debug
codegen (the two modes where the jit is not optimizing).

* inline keyword cleanup

5 years agoRespect the instrumented code maps passed by the profiler in a rejit (#21786)
David Mason [Mon, 7 Jan 2019 20:53:52 +0000 (12:53 -0800)]
Respect the instrumented code maps passed by the profiler in a rejit (#21786)

We currently do not respect the rejit provided instrumentation maps in DebuggerJitInfo::SetBoundaries, this change updates it to use the rejit map if one exists.

5 years agoImprove CustomAttribute (#21832)
Ben Adams [Mon, 7 Jan 2019 19:53:41 +0000 (20:53 +0100)]
Improve CustomAttribute (#21832)

* Reduce local scopes in AddCustomAttributes

* CustomAttribute.cs tidy up

* Less struct copies

5 years agoRemove invalid test b21296 (#21507)
Jan Vorlicek [Mon, 7 Jan 2019 18:21:40 +0000 (19:21 +0100)]
Remove invalid test b21296 (#21507)

This test was doing in-place modification of a managed string using
unsafe code which breaks string interning.

5 years agoPublish symbol packages (#21769)
Sven Boemer [Mon, 7 Jan 2019 16:51:13 +0000 (08:51 -0800)]
Publish symbol packages (#21769)

5 years agoMoves StackTrace to shared partition (#21757)
Marek Safar [Mon, 7 Jan 2019 16:07:37 +0000 (17:07 +0100)]
Moves StackTrace to shared partition (#21757)

* Moves StackTrace to shared partition

* Remove obsolete comment

* StackFrame::GetFileName behaves like property, remove SecurityException

* Adjust CoreRT ifdefs, fix names for consistency

5 years agoFix missing project error in official build (#21767)
Sven Boemer [Mon, 7 Jan 2019 15:56:04 +0000 (07:56 -0800)]
Fix missing project error in official build (#21767)

In response to https://github.com/dotnet/arcade/pull/1567.
This uses an empty project to work around the new behavior that requires a project file even for restore operations.

5 years agoFix incorrect assignment of READYTORUN_HELPER_[Dbl|Flt][Rem/Round] (#21836)
Tomáš Rylek [Mon, 7 Jan 2019 12:32:04 +0000 (13:32 +0100)]
Fix incorrect assignment of READYTORUN_HELPER_[Dbl|Flt][Rem/Round] (#21836)

Turns out there's a long-standing typo in CoreCLR that reverses
the helper enumeration values for DBL and FLT. This doesn't seem
to be a problem in the CoreCLR repo as such because it solely
uses the legacy identifiers CORINFO_HELP_DBLREM et al. We have
however ported the incorrect helper enumeration values into R2RDump
and ILCompiler. This change immediately fixes R2RDump as it resides
in the same repo, I'll send out the ILCompiler change in
a separate PR.

5 years agoRemove CAS era security checks around resource loads (#21825)
Filip Navara [Mon, 7 Jan 2019 03:16:50 +0000 (04:16 +0100)]
Remove CAS era security checks around resource loads (#21825)

5 years agoRevert "Fix ilasm exec on paths with spaces (#21819)" (#21835)
Jan Kotas [Sun, 6 Jan 2019 19:15:43 +0000 (11:15 -0800)]
Revert "Fix ilasm exec on paths with spaces (#21819)" (#21835)

This reverts commit b188e9d354e37e512c5b95bec38f0f06efb4161e.

5 years agoDelete redundant S.R.InteropServices.PInvokeMap and S.R.InteropServices.PInvokeMarsha...
Jan Kotas [Sun, 6 Jan 2019 16:47:06 +0000 (08:47 -0800)]
Delete redundant S.R.InteropServices.PInvokeMap and S.R.InteropServices.PInvokeMarshal (#21831)

5 years agoRemove redundant casts in TypeBuilder.CreateTypeNoLock (#21824)
Ben Adams [Sun, 6 Jan 2019 04:25:02 +0000 (05:25 +0100)]
Remove redundant casts in TypeBuilder.CreateTypeNoLock (#21824)

5 years agoMaintain left.Equals(right) order for equality for compat (#21829)
Ben Adams [Sun, 6 Jan 2019 04:24:35 +0000 (05:24 +0100)]
Maintain left.Equals(right) order for equality for compat (#21829)

5 years agoUpdate BuildTools, CoreClr, CoreFx, PgoData to preview1-03603-01, preview-27305-02...
dotnet-maestro-bot [Sun, 6 Jan 2019 02:04:27 +0000 (18:04 -0800)]
Update BuildTools, CoreClr, CoreFx, PgoData to preview1-03603-01, preview-27305-02, preview.19055.1, master-20190105-0042, respectively (#21749)

5 years ago(C#7) Use pattern matching `is` rather than `as` with null check (#21828)
Ben Adams [Sun, 6 Jan 2019 01:49:58 +0000 (02:49 +0100)]
(C#7) Use pattern matching `is` rather than `as` with null check (#21828)

* Use pattern matching `is` rather than `as` with null check

5 years agoinline keyword cleanup
Andy Ayers [Sun, 6 Jan 2019 01:28:24 +0000 (17:28 -0800)]
inline keyword cleanup

5 years agoMove Native Library APIs to NativeLibrary class (#21821)
Swaroop Sridhar [Sun, 6 Jan 2019 00:40:59 +0000 (16:40 -0800)]
Move Native Library APIs to NativeLibrary class (#21821)

Move APIs that manipulate native libraries from
System.Runtime.InteropServices.Marshal class to the new
System.Runtime.InteropServices.NativeLibrary class.

In API review: #32015,
The LoadLibrary APIs were originally Approved to live in
System.Runtime.InteropServices.Marshal class.

However, recently the decision was changed such that the APIs are
in a new NativeLibrary class.

5 years agoRemove redundant unsafe contexts (#21826)
Ben Adams [Sun, 6 Jan 2019 00:34:25 +0000 (01:34 +0100)]
Remove redundant unsafe contexts (#21826)

5 years agoFix ilasm exec on paths with spaces (#21819)
Viktor Hofer [Sat, 5 Jan 2019 07:39:18 +0000 (08:39 +0100)]
Fix ilasm exec on paths with spaces (#21819)

5 years agoJIT: encapsulate general checks for optimization
Andy Ayers [Sat, 5 Jan 2019 01:18:18 +0000 (17:18 -0800)]
JIT: encapsulate general checks for optimization

Add methods that answer the general question of whether or not
the jit is optimizing the code it produces.

Use this to replace composite checks for minopts and debug
codegen (the two modes where the jit is not optimizing).

5 years agoFix misspelling (#21640)
Matt Galbraith [Fri, 4 Jan 2019 23:38:40 +0000 (15:38 -0800)]
Fix misspelling (#21640)

5 years agoRemove stack marks from GetSatelliteAssembly. (#21812)
Filip Navara [Fri, 4 Jan 2019 23:31:36 +0000 (00:31 +0100)]
Remove stack marks from GetSatelliteAssembly. (#21812)

5 years agoDelete unused fFullReset argument (#21814)
Jan Kotas [Fri, 4 Jan 2019 22:55:56 +0000 (14:55 -0800)]
Delete unused fFullReset argument (#21814)

5 years agoAvoid passing stack crawl mark unnecessarily deep in the call stack. (#21783)
Filip Navara [Fri, 4 Jan 2019 22:54:06 +0000 (23:54 +0100)]
Avoid passing stack crawl mark unnecessarily deep in the call stack. (#21783)

* Avoid passing stack crawl mark unnecessarily deep in the call stack.

* Move stack crawl from TypeName::GetTypeManaged to RuntimeTypeHandle::GetTypeByName.

5 years agoIf the debugger is stopped on a garbage collection event, resuming the threads during...
Andrew Au [Fri, 4 Jan 2019 22:15:55 +0000 (14:15 -0800)]
If the debugger is stopped on a garbage collection event, resuming the threads during detach should simply be setting the event (#21764)

5 years agoMerge pull request #21806 from BruceForstall/CheckTestEnvCall
Bruce Forstall [Fri, 4 Jan 2019 22:14:47 +0000 (14:14 -0800)]
Merge pull request #21806 from BruceForstall/CheckTestEnvCall

Check result of call to TestEnv script

5 years agoSupport faster null checks (#21765)
Ben Adams [Fri, 4 Jan 2019 19:38:22 +0000 (20:38 +0100)]
Support faster null checks (#21765)

5 years agoJIT: don't optimize struct copies for call args in debug or minopts (#21792)
Andy Ayers [Fri, 4 Jan 2019 19:05:43 +0000 (11:05 -0800)]
JIT: don't optimize struct copies for call args in debug or minopts (#21792)

The jit will opportunistically optimize away copies for some struct call
arguments, if that argument is a "last use" for the struct (and some other
conditions apply).

In cases like #21544 this leads to confusing debug experiences as inputs
to a call appear to be modified by the call.

Also we really should not be optimizing the code this way in debug or in
minopts codegen modes. So, block this optimization for debug and minopts.

Closes #21544.

5 years agoFix Windows arm32/arm64 testing (#21809)
Bruce Forstall [Fri, 4 Jan 2019 19:03:25 +0000 (11:03 -0800)]
Fix Windows arm32/arm64 testing (#21809)

* Fix Windows arm32/arm64 testing

After the conversion to runtest.py, we were not getting any
JIT or GC stress mode testing:
1. The generated test env batch file didn't have a ".bat" extension,
so Windows wouldn't execute it.
2. The Python generated temp file was locked, so couldn't be read.

Added more logging.

5 years agoSpecify value of __RuntimeId for non-portable Linux test builds in build-test.sh...
Egor Chesakov [Fri, 4 Jan 2019 18:44:00 +0000 (10:44 -0800)]
Specify value of __RuntimeId for non-portable Linux test builds in build-test.sh (#21777)

5 years agoUpdate dependencies from https://github.com/dotnet/arcade build 1060 (#21726)
dotnet-maestro[bot] [Fri, 4 Jan 2019 16:51:50 +0000 (08:51 -0800)]
Update dependencies from https://github.com/dotnet/arcade build 1060 (#21726)

This change updates the following dependencies
- Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.18630.2
- Microsoft.DotNet.Helix.Sdk - 1.0.0-beta.18630.2

5 years agoAdd StringExtensions.Concat to fix Microsoft.IO.Redist assembly
Stephen Toub [Fri, 4 Jan 2019 02:26:46 +0000 (21:26 -0500)]
Add StringExtensions.Concat to fix Microsoft.IO.Redist assembly

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoEventPipePayloadDecoder clean-up (#21716)
Pent Ploompuu [Fri, 4 Jan 2019 15:07:46 +0000 (17:07 +0200)]
EventPipePayloadDecoder clean-up (#21716)

* Remove ReadUnalignedGuid

* Make EventPipePayloadDecoder unconditionally little-endian

5 years agoRemoves AppDomain dependency from TPLETWProvider (#21709)
Marek Safar [Fri, 4 Jan 2019 15:06:00 +0000 (16:06 +0100)]
Removes AppDomain dependency from TPLETWProvider (#21709)

which always returns 1, to make code sharing easier

5 years agoSkip additional cast from common EC.Run calls (#21789)
Ben Adams [Fri, 4 Jan 2019 14:52:21 +0000 (15:52 +0100)]
Skip additional cast from common EC.Run calls (#21789)

* Skip additional cast from common EC.Run calls

* Unsafe.As

5 years agoReflection performance tweaks & cleanup (#21737)
Jan Kotas [Fri, 4 Jan 2019 09:05:49 +0000 (23:05 -1000)]
Reflection performance tweaks & cleanup (#21737)

- Delete internal "Unsafe" field getters/setters. They performance was very close (within 10%) of the regular getters/setters.
- Made a few performance tweaks in reflection to make reflection faster overall. The regular field getters/setters are faster than what the unsafe ones used to be with this change.

5 years agoUse ValueStringBuilder instead of StringBuilderCache in PathInternal.Windows.cs
Stephen Toub [Thu, 3 Jan 2019 16:34:52 +0000 (11:34 -0500)]
Use ValueStringBuilder instead of StringBuilderCache in PathInternal.Windows.cs

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoAdd test for StringBuilder null terminator implementation detail (#21800)
Jeremy Koritzinsky [Fri, 4 Jan 2019 05:35:53 +0000 (21:35 -0800)]
Add test for StringBuilder null terminator implementation detail (#21800)

* Remove some commented out code.

* Add test verifying that we put a null terminator 2-past the end of the native buffer allocated for a StringBuilder.

5 years agoMerge pull request #21803 from BruceForstall/FixTypo
Bruce Forstall [Fri, 4 Jan 2019 05:12:50 +0000 (21:12 -0800)]
Merge pull request #21803 from BruceForstall/FixTypo

Fix batch script errors running JitOptimizationSensitive tests

5 years agoCheck result of call to TestEnv script
Bruce Forstall [Fri, 4 Jan 2019 03:39:07 +0000 (19:39 -0800)]
Check result of call to TestEnv script

If you give an illegal, not executable TestEnv script, then this
will not fail silently.

5 years agoFix batch script errors running JitOptimizationSensitive tests
Bruce Forstall [Fri, 4 Jan 2019 03:11:47 +0000 (19:11 -0800)]
Fix batch script errors running JitOptimizationSensitive tests

Simple typo: REN instead of REM, leading to:

"The syntax of the command is incorrect."

5 years agoFixed the broken projects.
Jingyu [Fri, 4 Jan 2019 02:34:32 +0000 (10:34 +0800)]
Fixed the broken projects.

5 years agoUse Kernel32 instead of api-ms-win-core-* in DllImports in SafeFileHandle.cs
Egor Chesakov [Thu, 3 Jan 2019 20:13:13 +0000 (12:13 -0800)]
Use Kernel32 instead of api-ms-win-core-* in DllImports in SafeFileHandle.cs

5 years agoEliminate some bounds checks in Path (#21721)
Egor Bogatov [Fri, 4 Jan 2019 01:34:39 +0000 (04:34 +0300)]
Eliminate some bounds checks in Path (#21721)

5 years agoAdds portable version of EncodingTable (#21735)
Marek Safar [Fri, 4 Jan 2019 01:34:03 +0000 (02:34 +0100)]
Adds portable version of EncodingTable (#21735)

* Adds portable version of EncodingTable

Most of the implementation is extracted from CoreRT

* Use string comparer directly

* Remove no longer used COMNlsInfo

* Adds localization support

* Removes FeatureCoreFxGlobalization configuration

* Remove redudant encodings look up from GetEncoding

* Keep Hashtable for nameToCodePage as it does not lock on read

* Replace locked dictionary lookup with short switch

* Include comment with msbuild task link used to generate the data file

5 years agoMerge pull request #21619 from CarolEidt/FixDesktopSIMD
Carol Eidt [Fri, 4 Jan 2019 00:28:47 +0000 (16:28 -0800)]
Merge pull request #21619 from CarolEidt/FixDesktopSIMD

Fix desktop SIMD failures

5 years agoMerge pull request #21776 from fiigii/fixAs
Carol Eidt [Thu, 3 Jan 2019 22:52:01 +0000 (14:52 -0800)]
Merge pull request #21776 from fiigii/fixAs

Fix Vector128/256 As<U> intrinsic recognition and exception

5 years agoImprove performance of Path.ChangeExtension (#21766)
Stephen Toub [Thu, 3 Jan 2019 21:34:56 +0000 (16:34 -0500)]
Improve performance of Path.ChangeExtension (#21766)

In the common case where it need to replace a non-empty extension with a non-empty extension, it currently incurs a substring without the original extension prior to then concatenating with the new extension.  This PR avoids that.

(As the Path implementation is in corelib, this uses string.FastAllocateString and then formats into it with a span; if we wanted to avoid that, string.Create could also be used.)

* Add internal String.Concat overloads for spans

* Use span-based string.Concat overloads in several places

5 years agoMerge pull request #21774 from hoyosjs/juhoyosa/event_size
Juan Hoyos [Thu, 3 Jan 2019 21:14:23 +0000 (13:14 -0800)]
Merge pull request #21774 from hoyosjs/juhoyosa/event_size

Add payload size case for GC events