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

7834 Коммитов

Автор SHA1 Сообщение Дата
Jan Kotas 5bed31924a Use --as-needed command line switch with the Unix linker (#6192)
Removes unused native symbol references from the native binary

Fixes #6191
2018-08-09 11:06:07 +02:00
Anipik 677a6ed3cd Non shared changes 2018-08-08 21:05:03 -07:00
Anirudh Agnihotry 7902bed42a Move methodbody and exceptionHandlingClause to shared (#19364)
* Changing names and making runtime files

* Movel methodbody and exceptionHandlingClause to shared

* Fixing build error

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-08 21:05:03 -07:00
Jan Kotas 3f40d3c63b
Merge pull request #6189 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-08 14:50:42 -07:00
Fadi Hanna d3edd098d9 Fix for a GC hole bug with exception rethrowing code (Bug 659148).
The issue is that the RhpRethrow stubs do not initialize the values of m_kind for the ExInfo objects they allocate on stack. Depending on the kind of garbage that gets assigned to m_kind, the stack iterator either takes the code path of reporting the gcroots of the RhpRethrow callsite, or takes the code path with the RemapHardwareFaultToGCSafePoint (if m_kind ends up getting a HW exception flag).

The piece of code that initializes the m_kind field of the ExInfo object on rethrows is in ExceptionHandling.cs, and there’s a window of opportunity where GC collection can happen before m_kind gets initialized correctly.

The bug needs the following conditions to occur:
    1) Garbage value in ExInfo.m_kind before initialization causes the stack iterator to take one code path, then after initialization take the other code path.
    2) GC collection happens in the middle, before m_kind gets properly initialized
    3) Gc roots reported in each of the 2 different code paths are different
    4) The GC collection in step #2 causes a relocation of a reference object of interest.

The fix is to just initialize the field to something deterministic that makes sense (zero in that case). This would cause the stack iterator to use the gcroots reporting of the RhpRethrow callsite, until the field is initialized to a more meaningful value (ex: in case of a rethrow of a HW exception) where we would apply the correct algorithm to determine a more correct gcroots reporting point to use based on where execution is headed (ex: use the gcroots reporting point of a finally block if the rethrow is for a HW exception, and in a catch block)

[tfs-changeset: 1709684]
2018-08-08 14:00:20 -07:00
Anirudh Agnihotry e76ee238ad
ReNaming and rearranging the variables to reduce the diff (#6188)
* rearranging properties and reducing diff

* ecplicit files added
2018-08-07 17:02:31 -07:00
Morgan Brown 914360af01
Optimize WASM arguments and returns (#6181)
Use LLVM arguments and returns where possible (no GC references) instead of passing them on the shadow stack. The argument optimization saves 3% optimized (5% compressed). The return change adds about 0.5% to the uncompressed file, but saves about 6% compressed. They both save size in debug. This also greatly simplifies debugging and reading code. Also includes a fix to the class constructor runner where it was calling cctors with the wrong signature and some test fixes.
2018-08-07 01:21:02 -07:00
Jeremy Kuhne bdc6bfbef1 Improve StreamWriter format perf (dotnet/coreclr#19235)
* Improve StreamWriter format perf

Override the format overloads for TextWriter and skip the extra string allocation for the formatted string by using StringBuilder directly, copying straight to the output buffer.

Improves performance roughtly 10% and cuts allocations by 10x and up (formatting a string into a string goes to *zero* allocations).

* Fix copy/paste slipup- test added to CoreFX PR

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-06 22:36:26 -07:00
Simon Nattress 48b9284812
Merge pull request #6185 from nattress/merge_master_2
FI master -> r2r
2018-08-06 13:52:22 -07:00
Simon Nattress 1126eba279 Merge remote-tracking branch 'dotnet/master' into merge_master_2 2018-08-06 12:02:47 -07:00
Morgan Brown c684a80db1
Add WebAssembly to CI (#5845)
* Adds WebAssembly to CI
2018-08-05 20:46:49 -07:00
Morgan Brown 84abd2b56c
Fix calling sealed virtual methods now that sealed vtables are always enabled. (#6180) 2018-08-05 17:39:48 -07:00
Anipik a01ce99723 Removing file from src 2018-08-03 13:58:35 -07:00
Anirudh Agnihotry 319a9f15eb Moved LocalVariableInfo to shared (dotnet/coreclr#19184)
* File Modified

* Moved to shared

* Introducing RuntimeLocalVariableInfo

* Build Corefx change

* sealed added

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-03 13:58:35 -07:00
Jan Kotas 35b2fa87a9 Delete file moved to shared partition 2018-08-02 22:15:48 -07:00
Anirudh Agnihotry 7548a44940 Moved NativeCallable Attribute to shared (dotnet/coreclr#19258)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-02 22:15:48 -07:00
Tanner Gooding 938a3f7430
Merge pull request #6174 from dotnet-maestro-bot/mirror-merge-9775978
Mirror changes from dotnet/coreclr
2018-08-02 15:26:31 -07:00
Tanner Gooding 27e61c91f1 Make `Vector64<T>`, `Vector128<T>`, and `Vector256<T>` readonly
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-02 20:58:02 +00:00
Simon Nattress 26e5a77bfb
Ready To Run Test Support (#6156)
Restore CoreCLR and CoreRun

* To test the ready-to-run binaries produced by ILCompiler, restore Microsoft.NetCore.App, which contains the CoreCLR runtime plus the set of framework assemblies defined by netcoreapp2.1 which should be enough to run most tests.
* Also restore CoreRun.exe, the host used to execute test binaries.

ReadyToRun ETW Test Harness

* Add a test harness to validate ready-to-run binaries properly execute the ready-to-run native code instead of silently falling back to Jit.
* To validate this, The Microsoft.Diagnostics.Tracing (EventTrace) package is used to enable CLR ETW events during test execution. The ModuleLoad event is intercepted to find the module IDs of assemblies relevant to test (recall, all CLR ETW events are machine-wide across all CoreCLR / CLR runtimes currently running). The MethodLoadVerbose events are intercepted and their module ID is matched with those filtered in the ModuleLoad event. This allows us to focus solely on the test binaries and not the dependent framework.
* An optional whitelist file can be provided, whose format is a text file with one method name per line. The output of test failures can be pasted into a whitelist file to create a baseline.

 Ready-to-run test system integration

* Add a new code generator type to runtest.cmd supporting readytorun mode.
* Ready-to-run tests need to know the location of the CoreCLR runtime (they're executed with CoreRun) as well as the ETW test harness test project.
* Add a ready-to-run specific set of tests (from Tomas' private bringup branch) which will only run in ready-to-run mode. This is controlled by the presence of a file named "readytorun" in the test source folder. This works the same way as the web assembly tests, where we opt in until the compiler support is mature enough to run all tests in this mode.
* The ready-to-run tests will run as part of the larger suite when runtest.cmd is invoked. To run just ready-to-run tests, use runtest.cmd /mode readytorun.
2018-08-02 12:50:35 -07:00
Michal Strehovský eaf1f5a80c
Update RyuJIT (#6170) 2018-08-02 17:36:26 +02:00
Michal Strehovský e1da6605d8
Improve repro project config (#6172)
* `S.R.CompilerServices.Unsafe` is often useful in repro code
* We treat warnings as errors in all of CoreRT, but warnings about unused fields or unused assignments often happen and are not helpful in repro project.
2018-08-02 17:36:13 +02:00
Michal Strehovský bd767d46a1
Merge pull request #6171 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-02 16:07:11 +02:00
Michal Strehovsky 684bb89d4a Allow illegal custom modifiers on generic constraints
Roslyn decided to do a breaking change to the ECMA-335 file format by generating an illegal custom modifier for the `unmanaged` constraint. The purpose of the modifier is to poison such types for old versions of the C# compiler (the modifier otherwise isn't necessary for the feature to work). This also poisons a lot of the .NET ecosystem too (breaking everything ranging from Mono to the C++/CLI compiler).

We need to update our stack to support this and unblock our customers.

[tfs-changeset: 1709243]
2018-08-02 06:57:58 -07:00
Simon Nattress 7adab8e040
Merge pull request #6169 from nattress/merge_master
FI master -> r2r
2018-08-01 18:58:53 -07:00
Simon Nattress f7a722e08e Fix build issues after FI
Mostly this is propagating Fadi's recent refactoring of node sorting (dbf3d4d256), with a conflict I missed in Program.cs
2018-08-01 17:34:59 -07:00
Simon Nattress e58672ee5c Merge remote-tracking branch 'dotnet/master' into r2r 2018-08-01 16:41:04 -07:00
Brian Robbins 191e5c2ef0 Provide a desktop-only implementation of RuntimeThread.CurrentOSThreadId for Microsoft.Diagnostics.Tracing.EventSource.Redist.
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-01 15:42:47 -07:00
Blealtan 62843a047f WASM: Multidimensional array instantiation fix (#6096)
* Handle multidimensional array instantiation (#5421)

newobj instruction on multidimensional array is now processed with
ArrayHelpers.NewObjArray. Enabled instantiating multidimensional arrays.

* Add testing for multidimensional array instantiation.

Only nullity and lengths are checked due to get & set not working on
multidimensional arrays.
2018-08-01 14:19:42 -07:00
Tomáš Rylek 5bb6dda2fb
Partial delegate support (#6162)
* Partial delegate support

I have refactored imports, runtime functions and method entrypoints
for lazy entry registration in accordance with Michal's suggestion.
The change also implements the new delegate ctor helper siganture
encoding. For now I have ignored the runtime lookup part with
a TODO comment.

Thanks

Tomas

* Minor cleanup - moving method marking logic to MethodWithGCInfo

* Addressing PR feedback

1) Per Michal's suggestion, I have created a new property
OffsetOfDelegateFirstTarget with separate definitions in CII.RyuJit
vs. CII.ReadyToRun. Please note this is somewhat different than
TargetABI because TargetABI is a plain constant whereas the offset
is a function of the target pointer size.

2) I have implemented the IEquatable interface on all three helper
structs used for dictionary indexation in R2RCGNF.

3) Per Simon's suggestion I have moved the non-reloc dependency
in DelegateCtorSignature to the new override
ComputeNonRelocationBasedDependencies. I have used the same technique
in MethodWithGCInfo where it substantially simplifed the code.

Thanks

Tomas
2018-08-01 22:43:20 +02:00
Michal Strehovský 476627a87b
Merge pull request #6166 from dotnet/master
Merge master to nmirror
2018-08-01 21:48:20 +02:00
Brian Robbins baf3dabd49 Expose OSThreadId and TimeStamp on EventWrittenEventArgs (#19002)
* Add EventWrittenEventArgs public properties OSThreadId and TimeStamp and plumb through OSThreadId.

* Plumb ActivityId and RelatedActivityId to EventListener.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-08-01 12:30:37 -07:00
Michal Strehovský 697c70b994
Merge pull request #6164 from dotnet/nmirror
Merge nmirror to master
2018-08-01 15:13:42 +02:00
Michal Strehovský 9d2773ed9e
Merge pull request #6163 from dotnet-bot/from-tfs
Merge changes from TFS
2018-08-01 13:41:37 +02:00
Michal Strehovsky 2ba9846485 Implement API review feedback for the removable feature feature
The API review board didn't approve this to be a public API due to lack of usage data for now, but did provide guidelines to make this approvable in the future.

This is doing two things:
* Rename the attribute
* By default, removed methods are going to throw, with an opt out (that might not be officially available). This is pretty easy to implement for Project N, because DR is intertwined with S.P.CoreLib and we can just define the exception there. It will likely block the adoption of this by IL Linker (or any other tool that is not hardwirded to work against a specific runtime).

[tfs-changeset: 1709140]
2018-08-01 04:32:48 -07:00
Jan Kotas 624c08c152 Fix build break 2018-07-31 18:38:54 -07:00
Tanner Gooding 2419ada0cc Expose the x86 HWIntrinsics via a set of class hierarchies matching the underlying ISA hierarchies
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-07-31 18:38:54 -07:00
Brian Robbins a57befcc80 Implement RuntimeThread.CurrentOSThreadId. (#6161) 2018-07-31 15:07:18 -07:00
Michal Strehovský ebb3632553
Merge pull request #6158 from dotnet/master
Merge master to nmirror
2018-07-31 18:04:02 +02:00
Michal Strehovský 7310d4bcf3
Merge pull request #6157 from dotnet-bot/from-tfs
Merge changes from TFS
2018-07-31 12:27:43 +02:00
Jan Kotas b7ea3897c6 Change type of EnumLocaleData to struct (dotnet/coreclr#19193)
Saves allocation and makes the code smaller. It had to be class before we had ref locals.

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-07-30 12:32:04 -07:00
Dávid Kaya 65b42e1a53 Added version increment for TrimExcess and EnsureCapacity (#19096)
* Added version increment for TrimExcess and EnsureCapacity

* Added old unit test to exclusion list

* Excluded missing unit tests

Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-07-30 12:32:04 -07:00
Ahson Khan 8bda4d7a16 Add comment explaining the return value of ToUpper/ToLower (#19176)
Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
2018-07-30 12:32:04 -07:00
Fadi Hanna c914d51254 Entries in the export table were not correctly sorted based on ordinals, but were emitted based on the ISortableNode sorting logic. This doesn't work with targeted patching
[tfs-changeset: 1709015]
2018-07-30 12:15:55 -07:00
Michal Strehovský f0f4b39198
Make sure metadata nodes don't show up in the graph (#6152)
RD.XML root provider was adding ModuleMetadataNodes into the dependency graph even though we were not doing metadata analysis (analysis already happened during the scanning phase). This was crashing the code I added yesterday with an invalid cast because metadata nodes don't expect to be in the graph if we're not analyzing (nobody is going to look at them). The crash only happens one has RD.XML so we didn't catch it in the CI.
2018-07-30 18:46:52 +02:00
Tomáš Rylek 9b9758b0eb
Last batch of changes related to CoreRT R2R bring-up (#6151)
* Complete set of my remaining changes resolved against latest

This is the remainder of my R2R changes rebased against the
CorInfoImpl refactorings. I'll try to further rebase the change
against my last pending PR (preparatory R2R changes) once I get
the approval to merge it in.

Thanks

Tomas

* Remove the "GetOrCreate" prefixes per Michal's feedback

* New ReadyToRunCompilationModuleGroup

* Move ReadyToRunMultiFileCompilationModuleGroup to ILCompiler.ReadyToRun project

* Make readytorun compilation module group independent from multi-file

* Fix merge errors

* Remove changes to MultiFileCompilationModuleGroup that were causing errors

* Move ReadyToRunSingleAssemblyCompilationModuleGroup out of multifile block

* Rebasing to latest master R2R branch + rebase fixes

* Addressed Michal's PR feedback, reversal of unwanted files

Now we have a R2R-specific field layout algorithm, we can revert
the changes to the general versions (CompilerMFLA and CompilerTSC).

I have addressed specific Michal's feedback by removing a superfluous
'using' statement.

I have reverted the use of repro/Program.cs as our temporary testbed.

Thanks

Tomas

* Revert all changes to MultiFileCompilationModuleGroup

* Initial support for multi-module compilation

This change basically introduces a new helper struct ModuleToken
encapsulating the combination of an EcmaModule context module
and a token relative to that module. This combo allows for full
token resolution in all cases. Most of the change basically
mechanically replaces mdToken with the new ModuleToken type.

In R2RCGCompilation, we construct CorInfoImpl instances lazily
per EcmaModule; this allows for back-propagation of module info
to R2RCGNF.

* Additional cleanup of my previous multi-module change

I found one more place that needed cleanup to support multi-module
cleanly - construction of SignatureContext. This needs to be done
in ModuleToken rather than in R2RCGNF.

Thanks

Tomas

* Mechanical cleanup - removal of unnecessary 'using' clauses

Thanks to the ModuleToken encapsulation we can remove the
Internal.JitInterface inclusion from many files. I've gone over
all the files using the VS "remove unnecessary usings" refactoring
and in many cases I managed to substantially reduce the using
set.

Thanks

Tomas

* Modify DelayLoadHelperThunk to derive from AssemblyStubNode

At this point the refactoring is somewhat hybrid as the
X64.InstructionEncoder doesn't support all the instructions
and addressing modes I need. Let me know if you want me
to add the currently hardcoded instructions as helpers to
the encoder.

Thanks

Tomas

* Additional cleanup of the DelayLoadHelperThunk assembly stub

Per Michal's feedback I added the PUSH instructions to X64Emitter
and I modified EmitCode to use EmitJMP. I have also split the
implementations per architecture.

Thanks

Tomas
2018-07-30 15:10:48 +02:00
Michal Strehovský 5dbb1ef984
Add support for sealed vtables in CppCodegen (#6148)
This cleans up the codebase by removing a bunch of workarounds. This was pretty easy after 045a28051c gave us the option to emit different data structures for places that don't support relative pointers and be able to switch dynamically at runtime.
2018-07-30 08:33:20 +02:00
Michal Strehovský ba8cd5822b
Add an option to only generate metadata for complete types (#6149)
When the option is set, metadata generation at the type level becomes all or nothing - either the entire type gets metadata, or none of it gets it. This makes a certain class of missing metadata issues easier to troubleshoot.
2018-07-30 08:32:59 +02:00
Michal Strehovský 10190f1ff7
Update CoreCLR.issues.targets (#6146) 2018-07-28 15:10:26 +02:00
Michal Strehovský a591f88202
Merge pull request #6143 from dotnet/nmirror
Merge nmirror to master
2018-07-28 15:05:13 +02:00
Jan Kotas 9935cdb738
Merge pull request #6141 from dotnet-bot/from-tfs
Merge changes from TFS
2018-07-26 22:50:35 -07:00