Commit Graph
66 Commits
Author SHA1 Message Date
Andrew Au 0ac7a35873 Update Unloadability documentation (#59383) 2021-09-21 11:33:23 -07:00
Jakob Botsch Nielsen e363f9acfa Remove unnecessary Prev field in portable tailcall helpers (#54894)
GC only ever needs to look at the top dispatcher frame as other
dispatchers cannot have live arg buffers, so it is not necessary to keep
these linked together. We can save a bit of stack this way.

Also update design document that was a bit outdated.
2021-07-01 13:30:56 +02:00
Steve MacLean 19b5bd1b58 Add Cross DAC documentation (#54498)
* Add Cross DAC documentation
2021-06-21 15:10:16 -04:00
Vitek KarasandElinor Fung 911640b3a8 Add better description of what to pass to hostfxr_initialize_for_dotnet_command_line (#53678)
Co-authored-by: Elinor Fung <[email protected]>
2021-06-04 03:08:16 -07:00
Lakshan FernandoandVitek Karas 127be4b389 Native host warnings fix (#52109)
* Native host warnings fix

Native host warnings fix

* Feedback

* Update docs/design/features/IJW-activation.md

Co-authored-by: Vitek Karas <[email protected]>

* Update src/coreclr/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml

Co-authored-by: Vitek Karas <[email protected]>

* Update src/coreclr/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml

Co-authored-by: Vitek Karas <[email protected]>

* Update docs/workflow/trimming/feature-switches.md

Co-authored-by: Vitek Karas <[email protected]>

* fixing the native host feature settings

* feedback on error code

* fb

* FB

* merge conflict

Co-authored-by: Vitek Karas <[email protected]>
2021-05-15 13:26:10 -07:00
e39196ffc9 Fixed Broken Links in Documentation (#50653)
Co-authored-by: Youssef Victor <[email protected]>
Co-authored-by: Marek Safar <[email protected]>
2021-05-10 10:09:08 +02:00
Tanner Gooding 17506ca9c7 Updating Vector<T> to support nint and nuint (#50832)
* Refactoring GenTreeJitIntrinsic to expose SimdSize and SimdBaseType via methods

* Updating the JIT to pass through the CORINFO_TYPE for hardware intrinsics

* Adding support for Vector<nint> and Vector<nuint> to managed code

* Updating the vector tests to cover nint and nuint

* Recognize Vector<nint> and Vector<nuint> in the JIT

* Updating Vector64/128/256<T> NotSupportedTest metadata to include type name

* Updating the Vector64/128/256<T> tests to have NotSupported validation for nint/nuint

* Splitting ThrowHelper.ThrowForUnsupportedVectorBaseType into separate functions for Numerics vs Intrinsics

* Updating Utf16Utility.Validation to directly use Vector<nuint>

* Don't use the auxiliary type to hold a SIMD type, since it can be trivially pulled from the operand instead

* Split the mono handling for ThrowForUnsupportedVectorBaseType into ThrowForUnsupportedNumericsVectorBaseType and ThrowForUnsupportedIntrinsicsVectorBaseType

* Add basic handling for MONO_TYPE_I and MONO_TYPE_U to simd-intrinsics.c

* Ensure simd-intrinsics.c in Mono handles `MONO_TYPE_I` and `MONO_TYPE_U` on relevant code paths

* Ensure we don't assert when encountering synthesized Vector128<nint> handles

* Applying formatting patch

* Fix the handling for Crc32 and Crc32C on ARM64

* Updating Mono mini-amd64 to handle MONO_TYPE_I and MONO_TYPE_U for SIMD operations

* Handle OP_XCOMPARE.CMP_GE_UN for MONO_TYPE_U

* Handle MONO_TYPE_I and MONO_TYPE_U for Vector types in mini-llvm
2021-04-19 17:55:09 -07:00
David Wrighton eebf52c641 Move default interfaces spec to common ecma335 addenda location (#49914) 2021-03-19 16:19:58 -07:00
Dong-Heon Jung 0779a4fd49 Minor fix in dotnet-pgo.md (#49527) 2021-03-12 14:38:03 -08:00
lindexi cb620ffe09 Fix link in covariant-return-methods.md (#49356) 2021-03-09 06:47:00 -05:00
David Wrighton 8a4d712069 Dotnet pgo phase2 (#49087)
- Add merge command as designed earlier
  - Add new typesystem variant that works based exclusively on the typerefs in existing mibc files and can operate without references to implementation binaries
  - Re-use ibc reader/merger from crossgen2 codebase
- Increase usability of the tool
  - Set default verbosity to normal
  - Normal verbosity prints a relatively limited amount of output
2021-03-04 18:08:48 -08:00
Viktor Hofer 3553284bea Rename mention to master branch to main (#48824) 2021-03-01 10:09:31 +01:00
David Wrighton 8065f95970 Revamp dotnet-pgo arguments (#48680)
- Add a document describing the behavior and how it is expected to be used.
- Rework the existing command line handling to implement the proposed create-mibc command. (the merge command is still entirely TBD).
2021-02-25 13:35:32 -08:00
Adeel Mujahid 5d04c9e9e8 Move corehost under src/native (#48071)
* Move corehost under src/native

* Move content out of cli/ directory

* Update configurations post-move

* Update docs
2021-02-13 08:33:56 -08:00
Youssef VictorandDan Moseley 5d5c3e7a58 Enable markdownlint rule (MD009) (#40887)
* Create markdownlint.yml

* Create markdownlint-problem-matcher.json

* Create .markdownlint.json

* Update .markdownlint.json

* fix violations

* fixes

* Remove "push" section

As advised by @viktorhofer so it's quite clear it only runs in CI.

Co-authored-by: Dan Moseley <[email protected]>
2021-02-08 10:43:40 -08:00
Youssef Victor 7b24471722 Fix broken link (#47041) 2021-01-15 13:03:18 +01:00
Weihan Li c142f16285 fix typo (#46423) 2020-12-28 01:32:42 -08:00
Jan Kotas 10381a2cdc Find&Replace coreclr/src -> coreclr (#45761) 2020-12-08 10:40:17 -08:00
Andrew Au f7530ff152 Fixes paths (#45392) 2020-12-02 17:59:50 -08:00
Igor Velikorossov 0a16644ba8 Update host-tracing.md (#45389) 2020-11-30 14:12:13 -08:00
fdf1494334 Add feature switch for disabling startup hooks (#44050)
* Introduce feature switch for startup hook

* Add test

* Update md

* Update src/coreclr/src/System.Private.CoreLib/src/System/StartupHookProvider.cs

Co-authored-by: Jan Kotas <[email protected]>

* Add UnreferencedCode attribute

* Apply suggestions from code review

Co-authored-by: Vitek Karas <[email protected]>

* Update message

* Update baseline

Co-authored-by: Jan Kotas <[email protected]>
Co-authored-by: Vitek Karas <[email protected]>
2020-11-13 13:04:25 -08:00
谭九鼎 379003e0c1 docs: fix MSBuild property InvariantGlobalization (#44572) 2020-11-11 18:20:25 -08:00
Andy Ayers 158b632dbc First draft of Dynamic Pgo proposal (#43371)
First draft of Dynamic Pgo proposal.
2020-10-19 16:04:54 -07:00
Kevin Jones f2bfa7b622 Update cross-platform-cryptography.md for CFB mode. 2020-10-01 07:58:25 -07:00
eli-finandEli Finkel 9f48dcd2cd Add 32/8 bit values of exit codes (#41566)
This will make searching for the exit code a little easier

Co-authored-by: Eli Finkel <[email protected]>
2020-08-31 02:02:16 -07:00
Youssef VictorandJan Kotas d14b50ae21 Fix trailing whitespaces (#40891)
* Trim trailing whitespaces

* Match raw with rendered

* Delete extra asterisks and |

* Update ELT Hooks - tail calls.md

Co-authored-by: Jan Kotas <[email protected]>
2020-08-19 17:29:01 -07:00
Alexander KöplingerandSteve Pfister c6eac1f2d5 Cleanup old corefx/coreclr GitHub issue links (#40286)
Replace them with the current URL after the redirect.

Similar to https://github.com/dotnet/runtime/pull/2063.

Co-authored-by: Steve Pfister <[email protected]>
2020-08-13 23:13:51 +02:00
Stephen Toub 117c9d6e85 Fix a few more license headers (#38973)
* Fix a few more license headers

I missed a few directories outside of src.

* Update Directory.Build.props
2020-07-09 11:32:01 -04:00
xtqqczze c8b310665e Markdown: remove unused definitions (#38618)
* Update glossary.md

Remove unused markdown definitions introduced in https://github.com/dotnet/corefx/pull/38103

* Update source-generator-pinvokes.md

Remove unused markdown definitions introduced in https://github.com/dotnet/runtime/pull/33742
2020-06-30 11:36:34 -04:00
David Wrighton 579d8831e1 Huge page support for composite images loaded on Linux (#37673)
Add support for loading composite R2R images utilizing huge pages on Linux

Support is broken into 3 major portions

- Changes to the compiler to add a switch which can compile the composite image with higher than normal alignment
- Changes to the runtime to make some slight tweaks to PE file loading on Linux to support these images correctly
- Documentation on how to tie these various features together to achieve large page loading on Linux
2020-06-12 14:00:01 -07:00
Sean Hall 3b5a51a297 Enable calling get_runtime_delegate from app context (#37473)
* Add ability for hostfxr_get_runtime_delegate to block on invalid delegate types.

This is required so that the runtime isn't loaded if the request has no chance of succeeding.

Fix spelling of initialization_options_t.

Add context_contract_version_set flag to initialization_options_t.

This allows hostpolicy to know whether it can rely on the version field of corehost_context_contract to be valid.
Also always initialize corehost_context_contract to {}.

* Allow app-based context to call hostfxr_get_runtime_delegate.

Currently, it may only request the load_assembly_and_get_function_pointer delegate.

Fix discrepancy in design doc.

Add error code HostApiUnsupportedScenario for blocks that might be removed. This gives the native host better information on why the request failed.

Add tests for running a component from an app context.
2020-06-09 04:48:19 -07:00
Vitek KarasandElinor Fung 70cbb2305b Proposal for allowing "get delegate" functionality on application host context (#36990)
Describe the long-term vision for the hosting components in terms of ability exposed through APIs.

Removes the limitation of `hostfxr_get_runtime_delegate` to make it work on app host context as well.

Defines a new runtime delegate which operates on default load context only.

Some cleanup of the document.

Co-authored-by: Elinor Fung <[email protected]>
2020-06-05 00:13:48 -07:00
fa141526c0 [WIP] Covariant Returns Feature (#35308)
* Covariant Returns Feature: Allowing return types on MethodImpl to be derived types of the return type on the MethodDecl.

Feature limitations:
  - Only supports MethodImpls and MethodDecls on classes (no interfaces/valuetypes).
  - MethodImpl and MethodDecl cannot be on the same type.
  - Interface/valuetypes not supported as covariant return types.

Changes are mostly a boolean flag being passed around to allow for covariant type checking in method signatures.
Generics are handled by correctly keeping track of the substitution chain while traversing the base type hierarchy for type comparison.

All method signature comparisons uses metadata for checking, without loading any type (with some exceptions).

Validation for the `ValidateMethodImplRemainsInEffectAttribute` is performed at the very last step of `CLASS_LOAD_EXACTPARENTS`.

Includes unit tests to cover positive/negative scenarios:
  - Non-generics
  - Generics, with various levels of complexities on generic instantiations and substitutions
  - GVMs
  - Delegates
  - Tests for validation of the existance/absence of the ValidateMethodImplRemainsInEffectAttribute
  - Interface and valuetype scenarios (negative scenarios)

* Adding the missing .ctor methods to the various types

* Perform covariant return signature matching only after an exact match fails

* Add test coverage for implicit override with less derived return type

* Change ValidateMethodImplRemainsInEffect attribute to apply to methods

* Moving covariant return type checking to the final stage of type loading, and use CanCastTo instead of signature-based checking, to be allow for type compatibility based on ECMA I.8.7.1.

* Rename attribute and reference it from System.Runtime instead of S.P.C

* Add test coverage for interface cases.

* Handling for struct cases, and adding test coverage for it.

* Small test fixes

* Fix consistency issue with the way the RequireMethodImplToRemainInEffectAttribute is declared

* Support covariant returns and slot unifications in crossgen2

These changes fix the behavior of the devirtualization algorithm to not incorrectly devirtualize covariant return methods that have the slot unification attribute

* Add unit test coverage for delegates

* Fix handling of covariant and contravariant generic interfaces

Also add tests for those.

* Added test cases to interfaces unit test

Based on PR feedback, I've added test cases to verify the load level
asserts change.

* Fix Nullable handling and add more tests

The attempt to overload method with int32 return value by a method with
Nullable<int32> was asserting in CanCastTo. This change fixes it by
pre-checking this case before calling into CanCastTo.
I've also slightly refactored the
ValidateMethodsWithCovariantReturnTypes by extracting the
compatible-with stuff into IsCompatibleWith method.

Added tests to test various compatible-with differences from the
originally used CanCastTo

- Change the CompatibleWithTest to call virtual methods on test
classes instead of just instantiating the classes.
- Update crossgen2 similar to the runtime to have IsCompatibleWith
method doing the same pre-filtering before calling CanCastTo.

* Rename the attribute to PreserveBaseOverridesAttribute

* Disable covariant returns tests on Mono for now

The mono doesn't implement the feature yet

Co-authored-by: Fadi Hanna <[email protected]>
Co-authored-by: Jan Vorlicek <[email protected]>
2020-06-01 20:24:04 +02:00
Jeremy Koritzinsky f62e93416a Remove built-in WinRT support from the runtime (#36715) 2020-05-29 17:37:12 -07:00
Jakob Botsch NielsenandEugene Rozenfeld e1ffadd652 Implement portable tailcall helpers (#341)
* Implement portable tailcall helpers

This implements tailcall-via-help support for all platforms supported by
the runtime. In this new mechanism the JIT asks the runtime for help
whenever it realizes it will need a helper to perform a tailcall, i.e.
when it sees an explicit tail. prefixed call that it cannot make into a
fast jump-based tailcall.

The runtime created two important IL stubs to help the JIT in performing
the necessary tailcalls. One IL stub is used to store the args for the
tailcall, while the other is used to dispatch the actual tailcall
itself. The JIT will then transform the call from

return tail. F(a1, ..., an);

to

IL_STUB_StoreTailCallArgs(a1, ..., an);
T result;
IL_STUB_DispatchTailCalls(..., &result);
return result;

The dispatcher is written in such a way that it is able to dispatch
multiple tailcalls in a row when tailcalled functions also perform
tailcalls. To do this, the JIT helps the dispatcher detect if the
caller's caller is also a dispatcher. When this is the case the
dispatcher returns to let the previous dispatcher perform the tailcall
with the currently stored args. This allows the frame to unwind and
ensures that sequences of tailcalls do not grow the stack more than by a
constant factor.

Due to this unwinding the args cannot be stored on the stack and are
instead stored in TLS. The GC is made specially of this buffer as the
args can be anything, including interior pointers.

The control-flow when performing the new tailcalls is nonstandard, so
this also changes the debugger to support proper stepping into/over/out
of tailcalled functions when they go through the new dispatcher.

x86's tailcalling mechanism does not change.

This commit also includes the following changes:

* Update design doc for helper-based tailcalls

* Change lowering of GT_LABEL on arm.

Generate movw/movt instead of adr on arm. adr on arm allows offsets
up to 4k, which may not be enough. In particular,
IL_STUB_CallTailCallTarget uses GT_LABEL before argument setup code
and it can be more than 4k.

* Add COMPlus_FastTailCalls environment variable.

COMPlus_FastTailCalls controls whether fast tail calls are allowed.
If COMPlus_FastTailCalls is 0, fast tail calls are not allowed even for
tail-prefixed calls. Only helper-based calls are allowed. This is useful
for testing helper-based calls.

Co-authored-by: Eugene Rozenfeld <[email protected]>
2020-04-27 17:06:15 -07:00
Jan Vorlicek 714692c322 Update unloadability doc based on recent changes
The management of the handle that native runtime keeps to
AssemblyLoadContext has changed to fix a race recently, so I am updating
the doc according to the change.
2020-04-24 14:56:29 +02:00
Aaron Robinson 852080ede1 Initial proposal for P/Invokes via Source Generators (#33742)
* Initial proposal for P/Invokes via Source Generators.
2020-03-31 12:19:00 -07:00
Jan Kotas cbeeb27c6b Delete tiered-compilation-guide.md (#34242)
This contains outdated information about tiered compilation preview
2020-03-28 14:07:36 -04:00
Jan Kotas 479067315a .NET Core to .NET branding changes (#33694)
Contributes to #33680
2020-03-28 07:00:19 -07:00
Vitek Karas e177402102 Merge pull request #33602 from vitek-karas/AppHostVersionAlways
Include apphost_version parameter in download URLs for both GUI and CLI apps
2020-03-17 05:41:55 -07:00
Andy Ayers c6f540ba4f Implement simple version of On Stack Replacement (OSR) (#32969)
Add support to runtime and jit to allow switching from unoptimized to
optimized code for a method while the method has active stack frames.

Details in the included document.
2020-03-16 17:29:55 -07:00
vitek-karas bab2839a73 Update the docs with the change 2020-03-16 12:44:45 -07:00
Jan Kotas b56c4d97a1 Update links to the design repo (#33606) 2020-03-15 15:55:32 +00:00
Vitek KarasandElinor Fung ff55fdb671 Apply suggestions from code review
Co-Authored-By: Elinor Fung <[email protected]>
2020-03-14 14:55:29 -07:00
vitek-karas fb99750016 Add a document describing usage of URLs in the hosting layer 2020-03-13 15:28:57 -07:00
Bruce Forstall a21da8f6d9 Move JIT documentation to new docs/design/coreclr/jit directory (#33321)
Reduce clutter in the shared directory, and make it easier to find
all the JIT-related documentation.
2020-03-10 08:53:57 -07:00
Koundinya Veluri d27a377201 Improve call counting mechanism
- Commit 1
  - Reverts commit f954c6bb80, which reverted PR https://github.com/dotnet/runtime/pull/1457 due to issues
- Commit 2
  - Fixes crashes and assertion failures seen by the original change, fixes https://github.com/dotnet/runtime/issues/29934
  - The crashes were caused by commit https://github.com/dotnet/runtime/pull/1457/commits/6aa3c7083735895c2e687a77e3636080edb366c3 in the original PR
  - Call counting infos cannot be deleted when the corresponding call counting stubs may still run, because:
    - The remaining call count decremented by the stub is in the call counting info
    - The only way to get a code version / method desc from a stub is to go through the call counting info
  - Got one repro of the assertion failure in https://github.com/dotnet/runtime/issues/22786 and it is most likely caused by the same issue, following heap corruption from modifying a deleted call counting info where the memory is reused for a `NativeCodeVersionNode`, messing up the method desc pointer
  - Fixed with a partial revert of the above commit. Added back the `Complete` stage and then call counting infos are deleted only after it's ensured that call counting stubs won't be used (shortly before deleting them).
- Commit 3
  - Public static functions of `CallCountingManager` that may be called through the debugger may occur before static initialization, added a check for null as suggested in https://github.com/dotnet/runtime/pull/29892
2020-03-02 11:21:44 -08:00
Dan Moseley 8497763bbf Fix another 58 URL's (#33003) 2020-02-28 18:54:32 -08:00
vitek-karas ae0ecdf2ba Fix step numbers 2020-02-14 12:30:05 -08:00
Vitek KarasandElinor Fung a2902f7e17 Apply suggestions from code review
Co-Authored-By: Elinor Fung <[email protected]>
2020-02-14 12:29:18 -08:00