platform/upstream/coreclr.git
5 years agoFix SegmentInitialize for OS_PAGE_SIZE > 4k (#20280)
Jan Vorlicek [Mon, 8 Oct 2018 13:49:40 +0000 (15:49 +0200)]
Fix SegmentInitialize for OS_PAGE_SIZE > 4k (#20280)

The function was incorrectly rounding the dwCommit down instead of up
to OS_PAGE_SIZE. It accidentally works for OSes where page size is 4096
bytes, because the dwCommit is 4096. But for ARM64 Linux distros where
the page size is 64kB, this was committing zero bytes and so the runtime
initialization was crashing a bit later when it tried to access the
memory it was supposed to be commited.

This problem was introduced in #17769.

5 years agoRemove mention of rotor from comments (#20297)
Austin Wise [Mon, 8 Oct 2018 03:16:45 +0000 (20:16 -0700)]
Remove mention of rotor from comments (#20297)

* Remove old reference to Rotor in documentation.

All remaining references relate to rotor's role in CoreCLR history.

* Remove rotor comment from enummem.cpp.

I can find no evidence that the presence of g_pStressLog is conditional
on FEATURE_PAL being defined.

* Remove old todo, DbgDllMain looks for thread detach.

* Update nativepipeline.h comment refernce to rotor.

All unix-like systems except android have FEATURE_DBGIPC_TRANSPORT_DI
defined, hence "most unix-like platforms".

* Update some comments to not refer to Rotor.

* Remove some more references to Rotor from comments.

* Remove old comment.

Though maybe this macro should be removed and everywhere use the & operator.
It appears there are only two places that use this macro.

5 years agoRemove some dead remoting and context static things (#20277)
Austin Wise [Mon, 8 Oct 2018 01:58:10 +0000 (18:58 -0700)]
Remove some dead remoting and context static things (#20277)

* Remove IsRemotingIntercepted methods that always return false.

* Remove GetOptionalMembersAllocationSize parameters that are always false.

* Remove references to context static.

Remove references in comments and methodnames.

* Remove RemotingVtsInfo.

5 years agoUpdate buildtools to v3 (#20286)
Viktor Hofer [Sun, 7 Oct 2018 19:21:09 +0000 (21:21 +0200)]
Update buildtools to v3 (#20286)

5 years agoTypos (dotnet/corefx#32625)
John Doe [Fri, 5 Oct 2018 00:25:37 +0000 (17:25 -0700)]
Typos (dotnet/corefx#32625)

* Obejct -> Object

* Oberserver -> Observer

* objetcs -> objects

* observeable -> observable

* obsolated -> obsoleted

* occour -> occur

* occurance -> occurrence

* occures -> occurs

* occuring -> occurring

* occurrance -> occurrence

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
5 years agoJIT: make sure to use normalized type when retyping box temp (#20285)
Andy Ayers [Sat, 6 Oct 2018 18:05:24 +0000 (11:05 -0700)]
JIT: make sure to use normalized type when retyping box temp (#20285)

Take advantage of the fact that `lvaSetStruct` figures out the right
type to use in the IR.

Fixes first part of #20260.

5 years agoMove BinaryPrimitives into coreclr shared source (#20288)
Levi Broderick [Sat, 6 Oct 2018 14:58:51 +0000 (07:58 -0700)]
Move BinaryPrimitives into coreclr shared source (#20288)

5 years agoAdd BSTR xplat PInvoke testcase (#20231)
Luqun Lou [Sat, 6 Oct 2018 02:07:48 +0000 (19:07 -0700)]
Add BSTR xplat PInvoke testcase (#20231)

5 years agoImprove performance of span-based ToUpper and related APIs (#20275)
Levi Broderick [Sat, 6 Oct 2018 02:04:58 +0000 (19:04 -0700)]
Improve performance of span-based ToUpper and related APIs (#20275)

5 years agoUpdate the dllmap design doc (6)
annaaniol [Fri, 7 Sep 2018 17:02:21 +0000 (10:02 -0700)]
Update the dllmap design doc (6)

5 years agoUpdate the dllmap design doc (5)
annaaniol [Fri, 7 Sep 2018 00:41:51 +0000 (17:41 -0700)]
Update the dllmap design doc (5)

5 years agoUpdate the dllmap design doc (4)
annaaniol [Thu, 23 Aug 2018 15:52:34 +0000 (08:52 -0700)]
Update the dllmap design doc (4)

5 years agoUpdate the dllmap design doc (3)
annaaniol [Mon, 13 Aug 2018 20:58:06 +0000 (13:58 -0700)]
Update the dllmap design doc (3)

5 years agoUpdate the dllmap design doc (2)
annaaniol [Sat, 11 Aug 2018 00:32:38 +0000 (17:32 -0700)]
Update the dllmap design doc (2)

5 years agoUpdate the dllmap design doc
annaaniol [Fri, 10 Aug 2018 01:24:02 +0000 (18:24 -0700)]
Update the dllmap design doc

5 years agoAdd a dllmap design document
annaaniol [Thu, 9 Aug 2018 01:41:12 +0000 (18:41 -0700)]
Add a dllmap design document

5 years agoRefactoring of struct promotion code for the future fix. (#20216)
Sergey Andreenko [Sat, 6 Oct 2018 00:07:41 +0000 (17:07 -0700)]
Refactoring of struct promotion code for the future fix. (#20216)

Create StructPromotionHelper.

* Add the check for promoted fields with changed type.

`CanPromoteStructType` can fake a field type if the field type is "structs of a single field of scalar types aligned at their natural boundary.". Add a check in debug that when we morph struct field access we have an expected type in the field handle.

5 years agoEnable Config-File Based Control of EventPipe (#20238)
Brian Robbins [Fri, 5 Oct 2018 23:44:15 +0000 (16:44 -0700)]
Enable Config-File Based Control of EventPipe (#20238)

5 years agoReport instantiation argument in non-virtual interface calls (#20257)
Michal Strehovský [Fri, 5 Oct 2018 10:51:06 +0000 (12:51 +0200)]
Report instantiation argument in non-virtual interface calls (#20257)

The existing code would incorrectly inhibit codegen from generating instantiation argument in non-virtual calls to default interface methods (i.e. those that can happen with the `base` syntax in C#).

Fixes #16775.

5 years agoTypos (#20271)
John Doe [Fri, 5 Oct 2018 01:56:04 +0000 (18:56 -0700)]
Typos (#20271)

* oportunistically -> opportunistically

* oppportunity -> opportunity

* Oppporunity -> Opportunity

* optinal -> optional

* optimisitic -> optimistic

* optionaly -> optionally

* origianl -> original

* orignally -> originally

* otheriwse -> otherwise

* otherrwise -> otherwise

5 years agoRemove context statics stuff (#20256)
Jan Vorlicek [Fri, 5 Oct 2018 01:08:51 +0000 (03:08 +0200)]
Remove context statics stuff (#20256)

* Remove context statics stuff part 1

This change removes all context statics stuff from the runtime since
context statics are not supported and this code was obsolete.

* Remove context statics stuff from the debugger code

5 years agoSynchronize access to static variable call_count (#20259)
Jonathan Marler [Fri, 5 Oct 2018 01:08:22 +0000 (19:08 -0600)]
Synchronize access to static variable call_count (#20259)

call_count is a static variable that is being read/modified and written to without any synchronization. Fortunately, a critical section is already available that can be leveraged to synchronize access to it.

5 years agoAdd printing of LoaderAllocator to MethodTable in SOS (#20255)
Jan Vorlicek [Fri, 5 Oct 2018 00:11:35 +0000 (02:11 +0200)]
Add printing of LoaderAllocator to MethodTable in SOS (#20255)

This change adds printing of LoaderAllocator to MethodTable dump in SOS
for collectible types.

5 years agoR2RDump fixes for dumping method instance entrypoint table (#20243)
Tomáš Rylek [Thu, 4 Oct 2018 19:29:24 +0000 (21:29 +0200)]
R2RDump fixes for dumping method instance entrypoint table (#20243)

R2RDump fixes for dumping method instance entrypoint table

While investigating Michal's unit test demonstrating a bug in the
CPAOT compiler I found out that R2RDump is broken in multiple
aspects w.r.t. instantiated methods. Parsing of the method
signatures in the instance entrypoint table was just broken
and the R2RMethod was duplicating parts of the signature decoding
and name formatting process.

I created a new flag "normalize" that requests normalization of various R2R
tables in the dump aimed at improving diff quality. I have also
noticed and fixed somewhat weird formatting of method signatures.
As a slight cleanup I have lumped the various dump flags into
a helper class DumpOptions. Last but not least I have renamed "Canon"
to "__Canon".

Thanks

Tomas

5 years agoMerge pull request #20252 from steveharter/FixIsAssignableFrom
Steve Harter [Thu, 4 Oct 2018 15:26:11 +0000 (10:26 -0500)]
Merge pull request #20252 from steveharter/FixIsAssignableFrom

Fix compat issue with Type.IsAssignableFrom

5 years agoEnable thread statics for collectible classes (#19944)
Jan Vorlicek [Thu, 4 Oct 2018 08:26:06 +0000 (10:26 +0200)]
Enable thread statics for collectible classes (#19944)

* Enable thread statics for collectible classes

This change removes checks that were preventing usage of thread statics
in collectible classes and also implements all the necessary changes.
The handles that hold arrays with thread statics are allocated from
LoaderAllocator for collectible classes instead of using the global
strong handle like in the case of non-collectible classes.
The change very much mimics what is done for regular statics.

This change also adds ability to reuse freed handles to the
LoaderAllocator handle table. Freed handle indexes are stored into a
stack and when a new handle allocation is requested, the indices from
this stack are used first.
Due to the code path from which the FreeTLM that in turn frees the
handles is called, I had to modify the critical section flags and also
refactor the handle allocation so that the actual managed array
representing the handle table is allocated out of the critical section.
When I was touching the code, I have also moved the code that was
dealing with handles that are not stored in the LoaderAllocator handle
tables out of the critical section, since there is no point in having it
inside of it.

5 years agoRemove AppDomain unload (#20250)
Jan Vorlicek [Thu, 4 Oct 2018 08:18:23 +0000 (10:18 +0200)]
Remove AppDomain unload (#20250)

* Remove AppDomain unload

This change removes all code in AppDomain that's related to AppDomain
unloading which is obsolete in CoreCLR. It also removes all calls to the
removed methods.
In few places, I have made the change simpler by taking into account the
fact that there is always just one AppDomain.

5 years agoMerge pull request #20235 from BruceForstall/Disable19361
Bruce Forstall [Thu, 4 Oct 2018 03:16:28 +0000 (20:16 -0700)]
Merge pull request #20235 from BruceForstall/Disable19361

Disable GitHub_19361 for Linux arm64

5 years agoUpdate CoreClr, CoreFx, CoreSetup, IbcData, PgoData to preview1-27003-01, preview1...
dotnet-maestro-bot [Thu, 4 Oct 2018 02:38:12 +0000 (19:38 -0700)]
Update CoreClr, CoreFx, CoreSetup, IbcData, PgoData to preview1-27003-01, preview1-27003-02, preview1-27003-01, master-20181003-0045, master-20181003-0040, respectively (master) (#20241)

* Update CoreClr, CoreFx, CoreSetup, IbcData, PgoData to preview1-27003-01, preview1-27003-02, preview1-27003-01, master-20181003-0045, master-20181003-0040, respectively

* Disabled outdated tests

5 years agoFix compat issue with Type.IsAssignableFrom
Steve Harter [Wed, 3 Oct 2018 22:52:31 +0000 (17:52 -0500)]
Fix compat issue with Type.IsAssignableFrom

5 years agoMerge pull request #20173 from fiigii/retest
Carol Eidt [Wed, 3 Oct 2018 21:18:47 +0000 (14:18 -0700)]
Merge pull request #20173 from fiigii/retest

Optimize some SSE2 intrinsic importation and re-enable tests

5 years agoreport the entire generation table in EnumWksGlobalMemoryRegions and EnumSvrGlobalMem...
David Mason [Wed, 3 Oct 2018 19:52:32 +0000 (12:52 -0700)]
report the entire generation table in EnumWksGlobalMemoryRegions and EnumSvrGlobalMemoryRegions (#20233)

5 years agoSupport building cross-architecture components on armel (#20190)
Egor Chesakov [Wed, 3 Oct 2018 17:21:23 +0000 (10:21 -0700)]
Support building cross-architecture components on armel (#20190)

5 years agoMarshal blittable structs via memcpy even if nested within non-blittable struct ...
Jeremy Koritzinsky [Wed, 3 Oct 2018 16:32:34 +0000 (09:32 -0700)]
Marshal blittable structs via memcpy even if nested within non-blittable struct (#20194)

* Add regression test for dotnet/coreclr#18521.

* Add custom marshaler for fixed buffers that acts as a scalar memory copy of the length of the fixed buffer.

* Remove regression test. Moving it to a unit test in corefx.

* Move attribute class name into classnames.h

* Remove unreachable code left over from debugging.

* Marshal fixed buffers by reusing the field marshaler of the single field to pretend that there are multiple fields consecutively in the structure.

* Remove now-dead code paths.

* Use initializers in FieldMarshaler_NestedValueClass constructor where appropriate.

* Clean up IsFixedBuffer implementation.

* Remove unused GC_PROTECTs.

* Specifically check that the attribute exists, not just that there wasn't an error.

* Fix missing else statement.

* Add asserts so we don't corrupt the heap.

* Add unit test for masked bug (incorrect native size of structure calculated).

* Don't use new behavior on non-blittable fixed buffers.

* Revert "Add unit test for masked bug (incorrect native size of structure calculated)."

This reverts commit 496eef5906638c3c2696ede0d922a5e707447b4e.

* Use memcpy instead of field emulation.

* Remove unused forward-declared class.

* Clean up code. Refactor one GetMethodTable call I missed.

* Remove now-unneeded custom attribute includes. More diff cleanup.

* Remove unneeded FixedBufferAttribute define.

5 years agoAdd MethodImplOptions.AggressiveOptimization and use it for tiering (#20009)
Koundinya Veluri [Wed, 3 Oct 2018 15:52:40 +0000 (08:52 -0700)]
Add MethodImplOptions.AggressiveOptimization and use it for tiering (#20009)

Add MethodImplOptions.AggressiveOptimization and use it for tiering

Part of fix for https://github.com/dotnet/corefx/issues/32235
Workaround for https://github.com/dotnet/coreclr/issues/19751
- Added and set CORJIT_FLAG_AGGRESSIVE_OPT to indicate that a method is flagged with AggressiveOptimization
- For a method flagged with AggressiveOptimization, tiering uses a foreground tier 1 JIT on first call to the method, skipping the tier 0 JIT and call counting
- When tiering is disabled, a method flagged with AggressiveOptimization does not use r2r-pregenerated code
- R2r crossgen does not generate code for a method flagged with AggressiveOptimization

5 years agoPDF link wasn't working (#20242)
Paresh [Wed, 3 Oct 2018 09:49:27 +0000 (15:19 +0530)]
PDF link wasn't working (#20242)

Correct pdf link

5 years agoFix X86 disassembly and a bug regarding ExportedTypes in R2RDump (#20230)
Tomáš Rylek [Wed, 3 Oct 2018 00:04:51 +0000 (02:04 +0200)]
Fix X86 disassembly and a bug regarding ExportedTypes in R2RDump (#20230)

1) X86 CoreDisTools disassembler has a bug in decoding absolute
indirections, interpreting them as RIP-relative offsets. I have
reused the logic that's already in place for patching X64
RIP-relative addresses to take care of this additional case.

2) the CoreDisTools disassembly apparently only produces newline
(0A) characters that don't work well in Notepad and other viewers;
I have forcibly replaced them with the platform newline separator.

3) I hit a bug in available type decoding - the logic wasn't
properly checking whether the type is exported or not.

Thanks

Tomas

5 years agoMerge pull request #20237 from BruceForstall/MakeInnerloopArm64DefaultTriggered
Bruce Forstall [Tue, 2 Oct 2018 23:50:08 +0000 (16:50 -0700)]
Merge pull request #20237 from BruceForstall/MakeInnerloopArm64DefaultTriggered

Change the innerloop arm64 Linux jobs to be default triggered

5 years agoChange the innerloop arm64 Linux jobs to be default triggered
Bruce Forstall [Tue, 2 Oct 2018 22:05:54 +0000 (15:05 -0700)]
Change the innerloop arm64 Linux jobs to be default triggered

The two innerloop jobs had been push triggered, to see how the
jobs behave in the system. They have been pretty stable, so
change to make them default triggered.

5 years agoDisable GitHub_19361 for Linux arm64
Bruce Forstall [Tue, 2 Oct 2018 21:36:46 +0000 (14:36 -0700)]
Disable GitHub_19361 for Linux arm64

Tracking: #20232

5 years agoAdd Bionic to sources.list for cross (#20202)
Raul Hidalgo Caballero [Tue, 2 Oct 2018 21:25:18 +0000 (23:25 +0200)]
Add Bionic to sources.list for cross (#20202)

5 years agoMerge pull request #20203 from AndyAyersMS/FixGtIndexAddrTest
Andy Ayers [Tue, 2 Oct 2018 20:01:30 +0000 (13:01 -0700)]
Merge pull request #20203 from AndyAyersMS/FixGtIndexAddrTest

Fix test for GT_INDEX_ADDR to forcibly compile with minopts

5 years agoMerge pull request #20193 from fiigii/addbc
Carol Eidt [Tue, 2 Oct 2018 16:35:39 +0000 (09:35 -0700)]
Merge pull request #20193 from fiigii/addbc

Add pointer overloads for Avx2.BroadcastScalarToVector256

5 years agoStop updating gtRsvdRegs before LSRA (#20136)
mikedn [Tue, 2 Oct 2018 02:54:06 +0000 (05:54 +0300)]
Stop updating gtRsvdRegs before LSRA (#20136)

5 years agoMerge pull request #20201 from jkotas/update-lst
Bruce Forstall [Mon, 1 Oct 2018 21:41:37 +0000 (14:41 -0700)]
Merge pull request #20201 from jkotas/update-lst

Delete removed tests from Tests.lst

5 years agoFix test for GT_INDEX_ADDR to forcibly compile with minopts
Andy Ayers [Mon, 1 Oct 2018 18:53:21 +0000 (11:53 -0700)]
Fix test for GT_INDEX_ADDR to forcibly compile with minopts

Update test introduced in #20047 so that the key method `ReadBytes` is compiled
with minopts by default.

5 years agoAdd back ExeFile directory for non-Windows (#20192)
Luqun Lou [Mon, 1 Oct 2018 16:47:14 +0000 (09:47 -0700)]
Add back ExeFile directory for non-Windows (#20192)

5 years agoDelete removed tests from Tests.lst
Jan Kotas [Sun, 30 Sep 2018 15:24:01 +0000 (08:24 -0700)]
Delete removed tests from Tests.lst

5 years agoImprove Guid parsing performance (#20183)
Stephen Toub [Sat, 29 Sep 2018 23:12:48 +0000 (19:12 -0400)]
Improve Guid parsing performance (#20183)

* Improve Guid parsing performance

Significantly improves the performance of parsing all Guid number styles, primarily by avoiding using the StringToInt core helper that was used previously to parse each of the consistuent components, as well as avoiding some unnecessary searches of the strings in order to determine which format is employed.

I kept strong compatibility with the existing implementation, down to what exceptions are thrown when (even when they’re a bit strange).  However, there are a few cases where the error messages in those exceptions differ from what they previously were, due to ambiguities, and IMO it not being worth making the implementation slower to try to maintain the exact same choice.  For example, the string “{0xdddddddd, 0xdddd 0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}}” isn’t parsable, because it’s missing a comma between the second and third components, and with whitespace removed the parser will try to parse “0xdddd0xdddd” and fail to do so.  Previously that would result in an error message “Additional non-parsable characters are at the end of the string”, and now it’ll result in an error message “Guid string should only contain hexadecimal characters.”  Similarly, “(-ddddddd-dddd-dddd-dddd-dddddddddddd)” would previously fail with “Unrecognized Guid format”, and now it’ll also fail with “Guid string should only contain hexadecimal characters.”

* Undo int->uint / short->ushort field changes

* Address PR feedback

5 years agoSimplify SafeBuffer.Initialize implementation (#20198)
Jan Kotas [Sat, 29 Sep 2018 13:37:45 +0000 (06:37 -0700)]
Simplify SafeBuffer.Initialize implementation (#20198)

5 years agoUnify argument verification for Marshal.GetHINSTANCE off-Windows (#20130)
Jeremy Koritzinsky [Sat, 29 Sep 2018 06:37:34 +0000 (23:37 -0700)]
Unify argument verification for Marshal.GetHINSTANCE off-Windows (#20130)

5 years agoDelete redundant framework API tests (#20187)
Jan Kotas [Sat, 29 Sep 2018 06:33:00 +0000 (23:33 -0700)]
Delete redundant framework API tests (#20187)

Contributes to #12782

5 years agoMake `structType` optional in jitEEInterface method `getFieldType`. (#20191)
Sergey Andreenko [Sat, 29 Sep 2018 01:57:29 +0000 (18:57 -0700)]
Make `structType` optional in jitEEInterface method `getFieldType`. (#20191)

* Make `structType` optional in `getFieldType`.

The declaration in corinfo.h says: "if 'structType' == 0, then don't bother the structure info". However, `getFieldTypeInternal ` did not check this case.

* Do not bother the structure info when we do not need it from `getFieldType`.

5 years agoAvoid allocation in Task.Yield() awaiter (#20186)
Stephen Toub [Sat, 29 Sep 2018 00:05:29 +0000 (20:05 -0400)]
Avoid allocation in Task.Yield() awaiter (#20186)

Now that IAsyncStateMachineBox is an IThreadPoolWorkItem, we can queue it directly in Task.Yield's awaiter.  This makes `await Task.Yield();` allocation-free when the default scheduler is used.

5 years agoAdd pointer overloads for Avx2.BroadcastScalarToVector256
Fei Peng [Fri, 28 Sep 2018 22:59:44 +0000 (15:59 -0700)]
Add pointer overloads for Avx2.BroadcastScalarToVector256

5 years agoSpecify configuration to runtest.sh to make runtest.py use the correct build_type...
Egor Chesakov [Fri, 28 Sep 2018 22:30:26 +0000 (15:30 -0700)]
Specify configuration to runtest.sh to make runtest.py use the correct build_type value (#20188)

5 years agoMerge pull request #20152 from DrewScoggins/UpdateIBCDeps
Drew Scoggins [Fri, 28 Sep 2018 22:17:32 +0000 (15:17 -0700)]
Merge pull request #20152 from DrewScoggins/UpdateIBCDeps

Update ibc deps

5 years agoEnable delegate marshalling for collectible types (#20158)
Jan Vorlicek [Fri, 28 Sep 2018 20:09:24 +0000 (22:09 +0200)]
Enable delegate marshalling for collectible types (#20158)

* Enable delegate marshalling for collectible types

This change is trivial - it just removes checks preventing the delegate
marshalling for collectible types. The unmanaged to managed thunks are
allocated from a global LoaderAllocator and they are released when the
corresponding managed delegates are collected. So for unloadability, we
don't need to change this behavior in any way.

* Disable CoreFX tests outdated by the change

5 years agoUpdating NumberToStringFormat to not print the sign if there are no digits being...
Tanner Gooding [Fri, 28 Sep 2018 18:02:55 +0000 (11:02 -0700)]
Updating NumberToStringFormat to not print the sign if there are no digits being returned (#20109)

5 years agoEnable BSTR Marshaling Support for x-plat PInvoke (#19766)
Luqun Lou [Fri, 28 Sep 2018 17:15:12 +0000 (10:15 -0700)]
Enable BSTR Marshaling Support for x-plat PInvoke (#19766)

5 years agoUpdate CoreClr, CoreFx to preview1-26928-03, preview1-26928-03, respectively (#20180)
dotnet-maestro-bot [Fri, 28 Sep 2018 15:48:15 +0000 (08:48 -0700)]
Update CoreClr, CoreFx to preview1-26928-03, preview1-26928-03, respectively (#20180)

5 years agoAdded transcript of ARMEnabled. (#20181)
Alexander Soldatov [Fri, 28 Sep 2018 15:16:29 +0000 (18:16 +0300)]
Added transcript of ARMEnabled. (#20181)

5 years agoUpdate CoreClr, CoreFx, CoreSetup to preview1-26928-01, preview1-26928-01, preview1...
dotnet-maestro-bot [Fri, 28 Sep 2018 11:25:33 +0000 (04:25 -0700)]
Update CoreClr, CoreFx, CoreSetup to preview1-26928-01, preview1-26928-01, preview1-26928-01, respectively (#20175)

5 years agoAvoid AwaitTaskContinuation allocation in some awaits (#20159)
Stephen Toub [Fri, 28 Sep 2018 00:13:27 +0000 (20:13 -0400)]
Avoid AwaitTaskContinuation allocation in some awaits (#20159)

In .NET Core 2.1, I added a bunch of optimizations to async methods that are based on reusing the async state machine object itself for other purposes in order to avoid related allocations.  One of those optimizations was using the boxed state machine itself as the continuation object that could be queued onto a Task, and in the common case where the continuation could be executed synchronously, there would then not be any further allocations.  However, if the continuation needed to be run asynchronously (e.g. because the Task required it via RunContinuationsAsynchronously), the code would allocate a new work item object and queue that to the thread pool to execute.  This then also forced the state machine object to lazily allocate the Action delegate for its MoveNext method. This PR extends the system slightly to also cover that asynchronous execution case, by making the state machine box itself being queueable to the thread pool.  In doing so, it avoids that AwaitTaskContinuation allocation and also avoids forcing the delegate into existence. (As is the case for other optimizations, this one is only employed when ETW logging isn't enabled; if it is enabled, we need to flow more information, and enabling that would penalize the non-logging case.)

5 years agoOptimize SSE2 intrinsic importation
Fei Peng [Thu, 27 Sep 2018 23:54:46 +0000 (16:54 -0700)]
Optimize SSE2 intrinsic importation

5 years agoRe-enable hardware intrinsic tests
Fei Peng [Thu, 27 Sep 2018 23:54:10 +0000 (16:54 -0700)]
Re-enable hardware intrinsic tests

5 years agoUpdate CoreClr, CoreFx, CoreSetup, PgoData to preview1-26927-03, preview1-26927-03...
dotnet-maestro-bot [Thu, 27 Sep 2018 20:09:51 +0000 (13:09 -0700)]
Update CoreClr, CoreFx, CoreSetup, PgoData to preview1-26927-03, preview1-26927-03, preview1-26927-01, master-20180926-0038, respectively (#20153)

5 years agoFix CancellationTokenRegistration.Dispose racing with cancellation (#20145)
Stephen Toub [Thu, 27 Sep 2018 18:58:18 +0000 (14:58 -0400)]
Fix CancellationTokenRegistration.Dispose racing with cancellation (#20145)

CancellationTokenRegistration.Dispose is guaranteed to only return when the associated callback has already finished running or has been successfully removed such that it'll never run.  This is to ensure that code following Dispose can be guaranteed that the callback isn't currently running and won't after that point, as if it did, it could potentially depend on mutable shared state or itself mutate shared state in a non-thread-safe manner.

However, significant optimizations introduced in .NET Core 2.1 impacted a specific case of this guarantee.  It still behaves correctly if cancellation hasn't already been requested, if cancellation has already processed the associated callback, and even if cancellation is currently executing the associated callback.  However, if cancellation is currently processing other callbacks and hasn't yet gotten around to processing the associated one, Dispose() may incorrectly return immediately, such that the callback may still end up getting invoked after Dispose() returns, which can violate assumptions of consuming code in very impactful ways.

This commit modifies how the callbacks are removed from the registration list in order to fix the issue.  Previously, all of the callbacks were swapped out at once, which then left the list empty, which is what caused subsequent disposals to think the callback had already been processed or unregistered.  With this change, we instead just remove each registration as it's being processed, such that a concurrent disposal can still successfully find the registration in the callback list if it's not yet been processed.

This change does have a small perf impact, but only on the case where cancellation is actually invoked, which is the less common case; most usage of CTS doesn't actually result in cancellation, and optimization is focused on registration and unregistration perf.  Rather than taking and releasing the lock once when cancellation is requested, we now take and release the lock per callback when cancellation is requested.

5 years agoEnable Ubuntu arm Cross Release crossgen_comparison scenario by default (#20160)
Egor Chesakov [Thu, 27 Sep 2018 18:28:17 +0000 (11:28 -0700)]
Enable Ubuntu arm Cross Release crossgen_comparison scenario by default (#20160)

5 years agoMerge pull request #19960 from echesakovMSFT/UseCrossBitnessLinuxCrossGenByDefault
Egor Chesakov [Thu, 27 Sep 2018 16:01:39 +0000 (09:01 -0700)]
Merge pull request #19960 from echesakovMSFT/UseCrossBitnessLinuxCrossGenByDefault

Use Hostx64/arm crossgen to crossgen System.Private.CoreLib on Linux

5 years agoReplace Crst* with CrstStatic for IBCLogger (#20148)
Michelle McDaniel [Thu, 27 Sep 2018 14:28:36 +0000 (07:28 -0700)]
Replace Crst* with CrstStatic for IBCLogger (#20148)

5 years agoMaestro dependency update without buildtools (#20143)
Viktor Hofer [Thu, 27 Sep 2018 04:43:48 +0000 (06:43 +0200)]
Maestro dependency update without buildtools (#20143)

* Update BuildTools, CoreClr, CoreFx, CoreSetup, PgoData to preview1-03224-03, preview1-26925-05, preview1-26925-06, preview1-26925-01, master-20180925-0031, respectively

* Enable RestoreOutputPath override

* Disable System.Security.Cryptography.Pkcs.Tests

To help unblock corefx, etc. update.

* Revert buildtools changes

* Disable buildtools auto updates

5 years agoEnable Ubuntu arm crossgen_comparison Checked in each PR (#20139)
Egor Chesakov [Thu, 27 Sep 2018 02:52:44 +0000 (19:52 -0700)]
Enable Ubuntu arm crossgen_comparison Checked in each PR (#20139)

* Run Ubuntu arm crossgen_comparison (Checked | Release) daily
* Enable Ubuntu arm Checked crossgen_comparison by default

5 years agoCross-bitness in VTable Calls (#20137)
Egor Chesakov [Thu, 27 Sep 2018 02:47:18 +0000 (19:47 -0700)]
Cross-bitness in VTable Calls (#20137)

* Use TARGET_POINTER_SIZE in CEEInfo::getMethodVTableOffset in src/vm/jitinterface.cpp
* Use SIZEOF__MethodTable_ in src/vm/methodtable.h

5 years agoDo not treat a custom layout as overlapping when trying to inline a struct method...
Sergey Andreenko [Wed, 26 Sep 2018 23:48:13 +0000 (16:48 -0700)]
Do not treat a custom layout as overlapping when trying to inline a struct method. (#20141)

* Do not treat custom layout as overlapping when trying to inline struct method.

That hack was added 4 years ago with independent struct promotion for parameters.
I was not able to find any related issues.

This change produces asm diffs because it allows us to inline more (lvaCanPromoteStructVar is a multiplier for
inlineIsProfitable parameter).
For System.Private.CoreLib we have total bytes of diff: 294 (0.01% of base).
For example, we started to inline methods from 'System.Threading.Tasks.ValueTask' that has '[StructLayout(LayoutKind.Auto)]'.

* Always sort fields in lcCanPromoteStructType.

It will be optimized away in the future commits.

* Delete the argument that is no longer used.

* Fix variable name according to jit-coding-conventions.

Rename 'StructPromotionInfo' to 'structPromotionInfo'.

5 years agoRemove deleted HW intrinsic tests from exclusion lists for Windows arm, arm64 targets...
Jacek Blaszczynski [Wed, 26 Sep 2018 23:47:14 +0000 (01:47 +0200)]
Remove deleted HW intrinsic tests from exclusion lists for Windows arm, arm64 targets (#20151)

Fixes #20149

5 years agoMerge pull request #20098 from dotnetrt/fix-win-unix-format
Bruce Forstall [Wed, 26 Sep 2018 23:09:10 +0000 (16:09 -0700)]
Merge pull request #20098 from dotnetrt/fix-win-unix-format

[CI] Fix failures in Windows/Linux CI Formatting jobs by force killing all dotnet processess

5 years agoUpdate BuildInfoPaths for PGO and IBC packages
Drew Scoggins [Wed, 26 Sep 2018 22:44:33 +0000 (15:44 -0700)]
Update BuildInfoPaths for PGO and IBC packages

5 years agoMerge pull request #20132 from jkoritzinsky/fixes/coreclr/7829
Jeremy Koritzinsky [Wed, 26 Sep 2018 22:38:24 +0000 (15:38 -0700)]
Merge pull request #20132 from jkoritzinsky/fixes/coreclr/7829

Fix possible overflow in SafeBuffer.Initialize.

5 years agoUpdate dependencies.props to fix typo
Drew Scoggins [Wed, 26 Sep 2018 20:34:21 +0000 (13:34 -0700)]
Update dependencies.props to fix typo

In the XmlUpdateStep item for the IBC data had a typo and was called
Data not IbcData. This was causing Maestro to not update the
IbcCurrentRef automatically.

5 years agoMerge pull request #19939 from mikedn/visit-cmpxchg
Bruce Forstall [Wed, 26 Sep 2018 18:17:16 +0000 (11:17 -0700)]
Merge pull request #19939 from mikedn/visit-cmpxchg

Fix incorrect CMPXCHG visiting order

5 years agoRemove duplicated test
Jeremy Koritzinsky [Wed, 26 Sep 2018 17:57:18 +0000 (10:57 -0700)]
Remove duplicated test

5 years agoAdd outdated test to CoreFX.issues.json
Jeremy Koritzinsky [Wed, 26 Sep 2018 17:39:43 +0000 (10:39 -0700)]
Add outdated test to CoreFX.issues.json

5 years agoPR Feedback and exclude regression test on 64-bit processes.
Jeremy Koritzinsky [Wed, 26 Sep 2018 17:31:58 +0000 (10:31 -0700)]
PR Feedback and exclude regression test on 64-bit processes.

5 years agoUse platformdefines through lib instead of cpp (#19948)
Luqun Lou [Wed, 26 Sep 2018 16:32:26 +0000 (09:32 -0700)]
Use platformdefines through lib instead of cpp (#19948)

* Use platformdefines through lib instead of cpp

* add a dummy export function

* Remove dummy export

* Compile as Static Library

* revert platformdefines.cpp file

* remove DLL_EXPORT

5 years agoDelete dead .NET Framework activation code (#20134)
Jan Kotas [Wed, 26 Sep 2018 06:07:00 +0000 (23:07 -0700)]
Delete dead .NET Framework activation code (#20134)

5 years agoAdd regression test.
Jeremy Koritzinsky [Tue, 25 Sep 2018 23:58:20 +0000 (16:58 -0700)]
Add regression test.

5 years agoSimpler implementation from PR feedback.
Jeremy Koritzinsky [Tue, 25 Sep 2018 23:45:04 +0000 (16:45 -0700)]
Simpler implementation from PR feedback.

5 years agoPorting fix on Desktop for VirtualUnlock perf issue on WKS GC when we reset mem ...
Sung Yoon Whang [Tue, 25 Sep 2018 23:18:14 +0000 (16:18 -0700)]
Porting fix on Desktop for VirtualUnlock perf issue on WKS GC when we reset mem (#20115)

5 years agoFix possible overflow in SafeBuffer.Initialize.
Jeremy Koritzinsky [Tue, 25 Sep 2018 21:54:26 +0000 (14:54 -0700)]
Fix possible overflow in SafeBuffer.Initialize.

Since a 0-length buffer is technically possible (though not very usable), have sizeOfEachElement==0 -> ByteLength == 0.

5 years agoMerge pull request #19979 from echesakovMSFT/CrossGenComparisonSymbolFiles
Egor Chesakov [Tue, 25 Sep 2018 18:51:42 +0000 (11:51 -0700)]
Merge pull request #19979 from echesakovMSFT/CrossGenComparisonSymbolFiles

CrossGen comparison - compare debugging files

5 years agoAdd header files to ildasm, ilasm vcxproj (#20052)
Jacek Blaszczynski [Tue, 25 Sep 2018 17:11:26 +0000 (19:11 +0200)]
Add header files to ildasm, ilasm vcxproj (#20052)

5 years agoMerge pull request #20107 from dotnet/dev/unix_test_workflow
Bruce Forstall [Tue, 25 Sep 2018 16:55:29 +0000 (09:55 -0700)]
Merge pull request #20107 from dotnet/dev/unix_test_workflow

Improve Linux arm32/arm64 corefx test runs

5 years agoswitch to netcoreapp2.0 (#20120)
Sergey Andreenko [Tue, 25 Sep 2018 16:38:42 +0000 (09:38 -0700)]
switch to netcoreapp2.0 (#20120)

Allows to get rid of warning " CSC : warning CS1685: The predefined type 'MarshalByRefObject' is defined in multiple assemblies in the global alias;".

5 years agoAdd headers to cordb{di, ee_dac, ee_wks}.vcxproj files to improve developer experienc...
Jacek Blaszczynski [Tue, 25 Sep 2018 14:20:05 +0000 (16:20 +0200)]
Add headers to cordb{di, ee_dac, ee_wks}.vcxproj files to improve developer experience (#20049)

5 years agoFix hijacking for ARM/ARM64/x86 on Unix (#20042)
Jan Vorlicek [Mon, 24 Sep 2018 23:51:44 +0000 (01:51 +0200)]
Fix hijacking for ARM/ARM64/x86 on Unix (#20042)

* Fix hijacking for ARM/ARM64/x86 on Unix

We were not checking the case when we have interrupted a thread inside
of a function epilog for other architectures than amd64. When such an
interruption happens, GS cookie check in a stack walking has failed,
since we are unable to decode GS cookie location when the IP is in
epilog.
This fix implements IsIPInEpilog for all architectures and makes the
check unconditional.

5 years agoDon't check for libintl.h on Darwin (OSX) (#20094)
Davis Goodin [Mon, 24 Sep 2018 23:48:05 +0000 (18:48 -0500)]
Don't check for libintl.h on Darwin (OSX) (#20094)

5 years agoclean code that counts promoted implict byref argument occurrences. (#20113)
Sergey Andreenko [Mon, 24 Sep 2018 23:03:36 +0000 (16:03 -0700)]
clean code that counts promoted implict byref argument occurrences. (#20113)

* clean code that counts promoted implict byref argument occurrences.

Move 3 copies of that code into one in `PreOrderVisit`. Run this check after we have made morph for fields and structs.

5 years agoSimplify OSVERSIONINFOEX interop (#20111)
Jan Kotas [Mon, 24 Sep 2018 21:19:05 +0000 (14:19 -0700)]
Simplify OSVERSIONINFOEX interop (#20111)

5 years agoRemove unnecessary parenthesis (dotnet/corefx#32419)
谭九鼎 [Sun, 23 Sep 2018 18:52:46 +0000 (02:52 +0800)]
Remove unnecessary parenthesis (dotnet/corefx#32419)

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>