Граф коммитов

7834 Коммитов

Автор SHA1 Сообщение Дата
Pent Ploompuu 915bb34f67 Optimize number formatting (dotnet/coreclr#19551)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-21 10:59:12 -07:00
Ben Adams 285ffeaf9e Mark more structs as readonly (dotnet/coreclr#19557)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-21 10:59:12 -07:00
Ben Adams 0c2f36bf04 Make DateTimeOffset a readonly struct (dotnet/coreclr#19552)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-21 09:53:43 -07:00
Michal Strehovský 13fec5bd33 Note that KnownGood tests are only known good on Windows (#6237)
Fixes #6236.
2018-08-18 13:42:16 -07:00
Tomáš Rylek e3051b745e
Implementation of reverse type reference lookup (#6167)
* Implementation of reverse type reference lookup

Based on JanK's suggestion, I have implemented the basic logic
for reverse type reference lookup. I have demonstrated basic
functionality of this feature by adding two delegate tests involving
Action and Func<char, char>.

I also had to slightly refactor type signature emitter - my
initial implementation was heavily dependent on parsing an existing
metadata signature but in the resolution process we can hit synthetic
types that don't have such a metadata representation, most notably
for generics.

For this reason I believe we need custom recursive descent into the
type tree and this change includes the initial implementations. For
now I'm keeping the generic signature decoder as it's still used by
method signatures but my current thinking is that it will also become
unneeded at some point and we'll be better of with a custom
implementation matching our exact needs.

Thanks

Tomas

* Addressing part of PR feedback

I have refactored SignatureBuilder to use a big switch over the
TypeDesc.Category. This overall simplified things. I fixed several
signatures to stop emitting type signatures when only looking up
references as signature emission may be a relatively costly process.

I tried to add some provisions to increase robustness of the
reference resolution but for now I'm keeping the reference enumeration
as just hooking up resolveToken is not sufficient to provide a
sufficiently complete mapping from types to tokens.

Thanks

Tomas

* Incomplete changes for shared generic support

* Fix bug in X64 emitter

The MOV(register, register) instruction was implemented incorrectly.
The method GetRexPrefix assumes that the register specified as
parameter is the target, however we were using the other opcode
where the register is the source. I have fixed this inconsistency
and I added code comments to the individual REX values to improve
clarity.

Thanks

Tomas

* Improved support for interface dispatch and unboxing stubs

Based on debugging calls to Dispose on classes and valuetypes and
thanks to help from JanK I finally managed to make calls to dispose
work on both. The change mostly involves propagation of the
new unboxingStub flag, switching over to general MethodEntry
fixups that allow encoding the value of the flag and general
infrastructural plumbing in the R2RCG node factory.

Thanks

Tomas

* Some additional minor fixes for interface dispatch

I removed an apparently incorrect check I had put in CorInfoImpl
previously. I fixed a trivial typo in the DelayLoadHelperThunk.
With these changes I'm again passing all the previous tests
plus the new Dispose on class / struct tests demonstrating
initial vestiges of unboxing stub support. Generic enumeration
still doesn't work for some reason, I'll investigate that next.

Thanks

Tomas

* Removal of reverse lookup in favor of eager lookup

Based on Michal's suggestion I have replaced the reverse lookup
in ReadyToRunCodegenNodeFactory with eager lookup called from
CorInfoImpl.resolveToken. The current implementation seems to be
the minimum enough to compile the 22 trivial unit tests.

Thanks

Tomas

* Initial support for constrained type virtual method calls

Thanks to JanK's help I was finally able to put together
initial support for constrained method calls finally fixing
the call to List<string>.Enumerator.Dispose().

Thanks

Tomas

* Add unit tests for features unblocked by my previous commits

This mostly covers my recent contributions in the field of
unboxing stubs, constrained method calls and token lookup
improvements.

Thanks

Tomas

* Fix rebase conflict

* Addressing [most of] Michal's PR feedback

I have trivially applied the mechanical feedback (fixing the typo
lea -> mov in the X64Emitter comment, applying the good suggestion
to simplify register references by using the X64 namespace and
unifying the VALUETYPE / NULLABLE case in signature encoding.

For the remaining feedback, I'm trying to provide my rationale for
further discussion:

1) Why do we need the || READYTORUN part in CorInfoImpl around line
3100? To let us pass around call site names to interface dispatch
cells - as interface dispatch cells are per call site even though
they might reference the same interface method, we need some way
to distinguish their symbols as we validate symbol uniqueness to
maintain output consistency.

If you're fine with the concept and you're just suggesting there's
an easier way to encode this by means of preprocessor directives,
I don't see that, please enlighten me.

2) Stashing token information in CorInfoImpl - I think the big
problem is signature building where in general we need to dig
arbitrarily deep into composite signatures.

Based on how good your suggestion for using resolveToken seems
to be working, I'm starting to think that it might be easiest to
drop the token propagation from CorInfoImpl and just always
synthesize the tokens based on the pre-recorded information; it
might unify parts of the previously forked NodeFactory bits too.

Once we start mucking with multiple assemblies within a versioning
bubble, I think we have several possible ways to go. As I mentioned
in a comment to the previous Simon's PR, I believe that the
R2RCGNF class has already gotten too big and would merit splitting
into multipler parts.

One of these should be exactly this "token manager" and perhaps
separating it from the node factory into a class of its own might
address some of your concerns; I however still believe that in
general, CoreCLR signatures support reference module override
so that we should be able to use arbitrary token sources across
the entire versioning bubble for the purpose of referencing externals.

Thanks

Tomas

* Move token management logic into a separate class ModuleTokenResolver

In this mostly mechanical change I tried to address part of Michal's
PR feedback by moving the token resolution logic away from the
ReadyToRunCodegenNodeFactory into a separate class. While the change
is mostly mechanical, I believe it nicely demonstrates
the relationship between the two classes and possible future steps
regarding migration of the logic from one to the other. For now
the resolver naturally hangs off the factory, that can easily change
by it becoming a part of the CorInfoImpl.ReadyToRun class.

Thanks

Tomas

* Further propagation of ModuleTokenResolver

This change removes direct references to ReadyToRunCodegenNodeFactory
from those signatures that only needed it for token resolution.

Thanks

Tomas

* Remove unnecessary | READYTORUN in CorInfoImpl

Based on Michal's suggestion I'm removing the | READYTORUN clause
in the conditional directive producing call site name for
interface dispatch cells. I have double-checked that SUPPORT_JIT
is not defined in the project so that the condition is true.

Thanks

Tomas
2018-08-18 12:35:31 +02:00
Simon Nattress 81759cac12
Support readytorun mode for CoreCLR tests (#6232)
* Support readytorun mode for CoreCLR tests

Currently 226 / 1829 tests pass (12.4%) from the KnownGood subset.

* CR Feedback

Break out the two large command lines into a variable so echo and command run use the exact same command line. This prevents the classical problem where we forget to keep the echo in sync with the actually run command line.

Make comparisons case insensitive.
2018-08-17 11:12:14 -07:00
Anipik c6c84366ac non shared changes 2018-08-17 11:07:18 -07:00
Anirudh Agnihotry e1cac05d6c Moved registry.cs to shared (dotnet/coreclr#19471)
* moved registry to shared

* using corefx version

* set value added

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-17 11:07:18 -07:00
Michal Strehovský 3812dad503
Merge pull request #6234 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-17 14:20:29 +02:00
Michal Strehovsky ac8eede30f Revert change to TypeLoaderEnvironment.LdTokenResult
The change to return an empty array instead of null broke a method handle test. Seems like generic arguments being null is a contract. Restoring the old logic and adding handling of null to the place that promted the change (https://github.com/dotnet/corert/pull/6182#discussion_r207886898).

[tfs-changeset: 1711212]
2018-08-17 04:53:58 -07:00
Michal Strehovský 9bccc04347
Merge pull request #6233 from dotnet/nmirror
Merge nmirror to master
2018-08-17 10:13:04 +02:00
Jan Kotas 6f37d09450
Merge pull request #6230 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-16 14:34:11 -07:00
Pent Ploompuu be4d490756 Optimize NumberBufferToDecimal (dotnet/coreclr#19072)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-16 14:33:59 -07:00
Amy b876a58164
Multi-module compilation (simple case) (#6160)
* Compile single input file specified in the compile option to single output file instead of multiple output files

* Parallelize multi-module with msbuild

* Fix missing binaries error

* Move BuildReadyToRunMultiModule to BuildIntegration folder

* Avoid using additional option moduleFilePaths

* Get multi-module to work without moduleFilePaths

* Fix error by not creating FullVTable

* Don't add EETypes to LibraryRootProvider for ReadyToRun

* Use ecmaTypes from compilationModule instead of eeTypeNode so AvailableTypes table has entries, get correct file extensions

* Disable ReadyToRunMultiModule test for JIT

* Compute AvailableTypes hash for types with namespaces

* Fix merge errors

* Use correct hashcode algorithm, add test for nested type

* Uncomment CheckCanGenerateMethod, remove IlcMultiModule property, remove todos

* Rename ReadyToRunMultiModule
2018-08-16 14:12:24 -07:00
Michal Strehovsky 99deea997a Fix issue around relocs to ShadowConcreteMethods
Generating relocs to a shadow concrete method should work the same as a reloc to the canonical body it represents. This is why the ShadowConcreteMethod implements ISymbolNode (indirectly, through IMethodNode). It works that way in the CoreRT object emitter, but it got broken when the UTC emitter stopped looking at mangled names and started assigning IDs to symbols instead. We hit a similar problem in EETypeNode and "NodeForLinkage" was born at that time.

This change:
1. Rolls back CS 1710918 that is trying to sidestep the problem by introducing complexity at the place where we need a canonical node (we need to decide whether we need one for linkage purposes, or for dependency analysis purposes, with a subtle runtime failure mode if we pick the wrong one).
2. Makes NodeForLinkage a property of the symbol reference instead of property of the defining object node so that we can use this on nodes that don't have object data associated with them.
3. Implements NodeForLinkage on ShadowConcreteMethodNode

[tfs-changeset: 1711076]
2018-08-16 13:30:40 -07:00
Jeremy Kuhne 95d4083d6a Make file handle checks accurate on Windows (dotnet/coreclr#19508)
* Make handle checks accurate on Windows

We can actually check the async state of a handle on Windows, so check directly when we have the API available.

Also allow all filetypes through when explicitly using extended syntax `\\?\` .

* Fix nits

* Don't throw in the handle constructor overloads

* Whoops

* Removing the close handle entirely. No adverse effects from closing a bad handle- or leaving it open for that matter.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-16 10:11:03 -07:00
Michal Strehovský db83da8e87
Merge pull request #6228 from dotnet/master
Merge master to nmirror
2018-08-16 13:42:26 +02:00
elyoh 33cafebe07 Update JapaneseLunisolarCalendar.cs (dotnet/coreclr#19504)
Corrects an issue with the conversion table for Gregorian to Japanese lunisolar dates.
See: #19450.

Issue: data discrepancy in year 1962.
Table entry for 1962 has incorrect days per month for months 6 and 7.

Notes
The DaysPerMonth flag uses the binary literal for ease of readability.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-15 20:12:51 -07:00
Simon Nattress 7d5373e564
Improve R2R test harness reliability (#6223)
If for some reason (ie a test harness bug or user error) no assembly load events are fired, the harness will see the absence of jitted methods as a sign that all code ran R2R perfectly. Add a smell test that checks we at least saw one test module loaded.

Fix up tabs and some unused variables.
2018-08-15 18:11:29 -07:00
Jan Kotas 3653776c0f
Merge pull request #6225 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-15 16:48:38 -07:00
Fadi Hanna 7c4bfd5475 The name/semantic of the CanonicalEntrypoint method on the NodeFactory is a bit misleading, and were incorrectly used in a couple of places. I made a small refactoring to distinguish between the scenario where we need a IMethodNode for the purpose of dependency analysis (either a MethodEntrypointNode or a ShadowConcreteMethodNode), and the scenario where we really need a callable address of a canonical entry point.
(Fixes a test in the Recoil category, which had a nullptr value for a ConstrainedMethodUse generic dictionary slot. The call to CanonicalEntrypoint was returning a ShadowConcreteMethod node, which was not really valid for that purpose. In fact, i'm not really sure why this test compiled successfully in the first place instead of hitting a linking error).

[tfs-changeset: 1710918]
2018-08-15 16:26:32 -07:00
Marco Rossignoli 1271b47cc5 Add TypeConverter fallback to DefaultValueAttribute (dotnet/coreclr#19354)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-14 20:35:08 -07:00
Simon Nattress 3d56b11db6
Build header tables using metadata manager (#6222)
* Build header tables using metadata manager

* Enable MetadataManager to track use of types / methods

* Introduce `AvailableType` which replaces the CoreRT EETypeNode.
Ready-to-run doesn't emit types directly into the image but records
their use and fills a table of available types used for type resolution
between ready-to-run modules by the runtime.

* Add dependency tracking in a few existing places where references to
types are being made. In library compilation mode, the non-private types
will be rooted so they always end up in the available types table.

* Use a single NodeCache for method entrypoints instead of a separate
dictionary for ready-to-run entrypoints. To smooth over the API
differences between the base `NodeFactory` and
`ReadyToRunCodegenNodeFactory`, allow a custom GetOrAdd method that
takes a creator callback.

* Switch over `RuntimeFunctionsTable`, `TypesTable`,
`MethodEntryPointTable` to use metadata manager for the list of types /
methods to emit entries for.
2018-08-14 12:44:10 -07:00
Amy ee5bc9f6ff Add referenced assemblies to ReadyToRun.TestHarness testModules, use System.CommandLine (#6206)
* Add System.Commandline package, fix concurrency error causing test to display as failed

* Add referenced assemblies to testModules, use System.CommandLine
2018-08-14 12:32:34 -07:00
Toni Solarin-Sodara c214863ad3 Preliminary Interpreter Support (#6182) 2018-08-14 18:50:42 +02:00
sergey ignatov d55ebfd33d Fixed reverse ordering of unwind insts in the object file (#6220) 2018-08-13 12:27:37 -07:00
Robert Miles 9b17c1edb9 Add environment variables support for Unix (#6216) 2018-08-13 12:27:10 -07:00
Robin Sue 32226df5b1 Remove unused local from List<T>.RemoveRange (dotnet/corefx#31727)
`int i` appears to be unused so i removed it.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-12 21:44:25 -07:00
Anipik 96b858b366 non shared changes and feedback addressed 2018-08-12 17:03:36 -07:00
Anirudh Agnihotry 6a860c570f moved to shared (dotnet/coreclr#19419)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-12 17:03:36 -07:00
Michal Strehovský 18d9aeaad0
Merge pull request #6215 from dotnet/nmirror
Merge nmirror to master
2018-08-12 19:42:29 +02:00
Michal Strehovský 279fb86846
Fix CoreRT build break 2018-08-12 19:03:54 +02:00
Michal Strehovský cdefa52b12
Merge pull request #6214 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-11 17:56:14 +02:00
Michal Strehovsky c69ea0f95e Add an option to disable generation of reflection invoke thunks
Touches a lot of files, but most of this is just plumbing.

In the absence of invoke thunks, reflection will use the calling convention converter. Reflection invoke will get about 7x slower, but will still work. Saves about 1.5-2% in terms of size on disk. The default is still to use the thunks, since we tweak everything towards fast defaults.

Implemented for both Project N and Project X. On the X side, I decided to go with a "policy" class instead of bools. This will let us cleanly do further optimization in the future, such as selectively generating thunks only for specific methods.

[tfs-changeset: 1710656]
2018-08-11 08:46:04 -07:00
Michal Strehovský b55fbd3fde
Merge pull request #6213 from dotnet/master
Merge master to nmirror
2018-08-11 16:26:36 +02:00
Anipik 0fd0ca2891 Non shared changes 2018-08-11 00:29:57 -07:00
Anirudh Agnihotry 64573a6e44 Moved SpinLock.cs to shared (dotnet/coreclr#19391)
* m removed from names, spaces after \\ and braces added

* Moved to shared

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-11 00:29:57 -07:00
Ben Adams 8500ebcc3a Don't early terminate on null for 64bit NR HashCode (dotnet/coreclr#19331)
* Don't early terminate on null for 64bit NR HashCode

* Improved GetNonRandomizedHashCode

* Update message on GetNonRandomizedHashCode

* Consume null terminator rather than special case odd lengths

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-10 23:26:18 -07:00
Jeremy Kuhne 38a69d03d3 Create Microsoft.IO.Redist (dotnet/corefx#31679)
* Create Microsoft.Internal.IO

Includes all of Path, Directory, *Info, etc. from System.IO with targets of NetFX 4.6.1 and NetCore 2.1.

* Tweaks / minor fixes

* Remove netstandard build.

* Add package

Update to build for 4.7.2 only

* Rename folder to prepare for project rename

* Change the name to Microsoft.IO.Redist

* Namespace tweaks

* Use open key, tweak references

* More tweaks on feedback

Also grab latest build tools for 4.7.x RIDs

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-10 18:39:02 -07:00
Anipik 106c321007 Moved to shared 2018-08-10 17:48:06 -07:00
Anirudh Agnihotry 40af11f5d5 Moved to shared (dotnet/coreclr#19399)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-10 17:48:06 -07:00
sergey ignatov ea29505533 [armel tizen] Fixed unwinding support for ARM is not fully implemented #5874 (#6197) 2018-08-09 17:43:12 -07:00
Jan Kotas 6048b4d2e6
Merge pull request #6200 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-09 17:38:01 -07:00
dotnet-bot 38f5ba0886 Add size-optimization switch passing from ilc to NUTC to CoreRT in PureNative mode
[tfs-changeset: 1710061]
2018-08-09 15:06:37 -07:00
Jan Kotas 49308757c8
Update CoreFX dependencies (#6195)
* Update CoreFX dependencies

* Exclude WinRT interop
2018-08-09 11:18:41 -07:00
Jan Kotas 9469038b03
Merge pull request #6196 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-09 09:04:04 -07:00
Tomas Rylek 1b63b12bf1 Trivial fix for typo in arm64 assembly (xzr -> wzr)
[tfs-changeset: 1709921]
2018-08-09 08:45:04 -07:00
Jan Kotas 23201e12de
Merge pull request #6193 from dotnet/nmirror
Merge nmirror to master
2018-08-09 07:52:19 -07:00
Michal Strehovský aa421b97d0
Merge pull request #6194 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-09 14:27:30 +02:00
Michal Strehovsky e7fa8d3f52 Add support for reflection invoking ref return methods
This is a port of dotnet/coreclr#17732. Fixes bug 603305.

Per popular demand from people who would like to serialize ref returning properties or use them in data binding, adding support for this in MethodInfo.Invoke. The choice was to make these dereference the result and return it like that. For the corner case of returning a ref to a null, a `NullReferenceException` will be thrown (this behavior has a very unfortunate side effect of slowing down the general Invoke path because we can't throw this exception from a place where we would end up wrapping this in a TargetInvocationException).

I also made tweaks to byref parameters path to fix byref pointer parameters, but this is horribly broken on the CLR so I didn't bother to test it here. Should work.

Also includes a slight size on disk optimization that merges common tails of the static/instance paths of the invoker thunk.

Testing of the calling convention converter portion was done by disabling invoke thunks generation in NUTC and running UnitTests. I also ran it with GCStresss (RH_GCStressThrottleMode=1, RH_GCStress_Mode=1). Let me know if there's more testing needed. This has a huge test matrix for being such a corner case thing.

[tfs-changeset: 1709919]
2018-08-09 05:17:29 -07:00