* Build one MonoTargetsTasks assembly for Mono.NET.Runtime.MonoTargets.Sdk pack
Instead of 3 assemblies for some tiny tasks.
Building a single assembly also ensures that everything in the pack depends on and bundles identical versions of dependent assemblies. For example on net472, a single version of System.Text.Json with a single fixed version shared by both the JsonToItemsTaskFactory task factory and the RuntimeConfigParser task.
Related to https://github.com/dotnet/runtime/issues/59619
* Update testing and wasm to use MonoTargetsTasks.dll
* Move assembly stripper to a separate assembly
Build it with nullability checking disabled.
Build the main MonoTargetsTasks assembly with nullability enabled
* Don't include msbuild assemblies in MonoTargets package
* re-enable analyzers for the MonoTargetsTasks assembly
* Include *.dll in the MonoTargetsTasks nupkg
In particular, pick up all the dependent assemblies for the net472 build
* Update various READMEs
* remove unneeded target
* Switch ILStrip to use the same Parallel.ForEach logic as MonoAOTCompiler
* Remove unneeded NoWarn warnings
* rearrange package references in MonoTargetsTask.csproj for readabilty
* More ItemGroup reformatting
* fix nits
* Use SystemThreadingTasksExtensionsVersion instead of hardcoding
Co-authored-by: Ankit Jain <[email protected]>
* Only pass perfmap argument for Linux
* Enhance CrossGen2 to emit PerfMap debug directory entry
This is used to correlate PE's with their corresponding PerfMaps. For example the header in the perfmap could be:
```
FFFFFFFF 00 026D4D21B3EE3D93843FF7A964235822
FFFFFFFE 00 1
FFFFFFFD 00 1
FFFFFFFC 00 3
FFFFFFFB 00 1
```
And the PE will have the corresponding entries in the PE as:
```
PerfMap (Type 21):
System.Private.CoreLib.ni.r2rmap, Signature = 026d4d21b3ee3d93843ff7a964235822, Version = 1
```
* Emit headers for debug directory entries from the nodes themselves.
* Add PerfMap Debug Directory Entry spec
* Extend perfmap and r2r documentation
* Add a conv conformance test.
* Fix Ecma description.
* Fix the test.
* Update docs/design/specs/Ecma-335-Augments.md
Co-authored-by: Jan Kotas <[email protected]>
* Disable VN optimizations on arm64 because of the bug.
* add a new chapter.
* fix space
* Fix format.
* exclude the test on mono
Co-authored-by: Jan Kotas <[email protected]>
* Work in progress: new Sdk that selects mono runtime components
* Add props and targets description to the components doc
* condition the _MonoRuntimeAvailableComponents by RuntimeIdentifier
* [cmake] Write a component-manifest.props file during build
If we're not building a mono aot cross compiler, generate a
component-manifest.props file in artifacts/obj/mono/<host>/ that indicates if
the host will use static or dynamic components, and a list of the available
components, and the properties for constructing their names.
* Build Microsoft.NETCore.App.Runtime.Mono.<RID>.Sdk shared framework nuget
It seems to also generate a symbols nuget. And in the nuget there's a
tools/mono-sdk-what-is-this.deps.json file from the
SharedFrameworkHostFileNameOverride property. It would be nice to exclude that
stuff.
* put the compoonent-manifest.targets into the Sdk
* delete WIP in mono/nuget/
* fixup static component names in component-manifest.targets
* delete fixed fixme
* add missing $
* fix whitespace
* [cmake] switch to configure_file instead of file(CONFIGURE)
* add missing trailing slashes in .props.in file
* Add new Sdk packs to the workload manifest
* rework component-manifest.targets to use ItemGroups; move to new SDK
* Rename shared framework to Microsoft.NETCore.App.Runtime.Mono.<RID>.Props.Sdk
And only include component-manifest.props, not the targets
* Update manifest to include the new Props.Sdk and MonoTargets.Sdk
* Move RuntimeConfigParserTask into Microsoft.NET.Runtime.MonoTargets.Sdk
Consolidate all platform-independent tasks and targets into a single Sdk
* Add iossimulator-x86 props
* update components design doc
* Fix typo
* improve docs
* Add _MonoRuntimeComponentDontLink target output
* Drop component-manifest.props into runtime pack build/ directory
Remove from the Microsoft.NETCore.App.Mono.Props.Sdk workload nuget
* remove Microsoft.NETCore.App.Mono.Props.Sdk
* Import component-manifest.props from the runtime pack
Move the MonoTargets.Sdk import to each target platform that we support
* Fix typos
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
* Apply suggestions from code review
Co-authored-by: Ankit Jain <[email protected]>
* Add JsonToItemsTaskFactory
* fix whitespace
* Do some validation earlier in _MonoComputeAvailableComponentDefinitions
* Read component-manifest.json using the JsonToItemsTaskFactory
and bundle it in Microsoft.NET.Runtime.MonoTargets.Sdk
* remove ResolvedRuntimePack import from WorkloadManifest.targets
it's too early, and we have the JsonToItemsTaskFactory now to read the manifest
* Generate component-manifest.json in CMakeLists.txt
* Fix some copy-paste nits
* Use RuntimeFlavor==mono for runtime pack build directory
instead of TargetsMobile. We want the build files (mono-components.json)
in every mono runtime pack, not just on mobile targets
* Apply suggestions from code review
Co-authored-by: Ankit Jain <[email protected]>
* rename component-manifest to RuntimeComponentManifest
* fixup nullability annotations
* fix whitespace
* fix formatting
* Misc fixes to JsonToItemsTaskFactory
* Rename MonoRuntimeComponentManifestReadTask
from MonoRuntimeComponentsReadManifestTask
* undo nullability annotation
Build doesn't like it for some reason (probably net472)
* fix incorrect task parameter name
* Remove Identity metadata from dictionary at json parsing time
Also improve nullability a bit by making the properties immutable
* Throw correct json deserializer exceptions
* Catch JsonException in an async function
We get nice error messages now like
```
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5): error : Failed to deserialize json from file 'artifacts/bin/mono/iOSSimulator.x64.Release/build/RuntimeComponentManifest.json', JSON Path: $.items._MonoRuntimeAvailableComponents[2], Line: 14, Position: 1 [component-manifest.sample.proj]
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5): error : JsonException: The JSON value could not be converted to System.Collections.Generic.Dictionary`2[System.String,System.String]. Path: $.identity | LineNumber: 0 | BytePositionInLine: 16. Path: $.items._MonoRuntimeAvailableComponents[2] | LineNumber: 14 | BytePositionInLine: 1. [component-manifest.sample.proj]
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5): error : InvalidOperationException: Cannot get the value of a token type 'Number' as a string. [component-manifest.sample.proj]
src/mono/nuget/Microsoft.NET.Runtime.MonoTargets.Sdk/Sdk/RuntimeComponentManifest.targets(8,5):
error :
[component-manifest.sample.proj]
```
* fixup comments
Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
Co-authored-by: Ankit Jain <[email protected]>
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.
Address deficiencies in current devirtualization infrastructure
- Remove the responsibility of creating a CORINFO_RESOLVED_TOKEN structure from the JIT and make it a responsibility of the VM side of the jit interface.
- This enables the component (crossgen2) which has deeper understanding of the requirements here to correctly handle scenarios that would otherwise require expressing crossgen2 specific details across the jit interface.
- Add a new set of fixups (`READYTORUN_FIXUP_Check_VirtualFunctionOverride` and `READYTORUN_FIXUP_Verify_VirtualFunctionOverride`) these are used to validate that the behavior of the runtime and crossgen2 compiler is equivalent for a virtual resolution event
- `READYTORUN_FIXUP_Check_VirtualFunctionOverride` will ensure that the virtual resolution decision is the same at crossgen2 time and runtime, and if the decision differs, any generated code affected by the decision will not be used.
- `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` will perform the same checks as `READYTORUN_FIXUP_Check_VirtualFunctionOverride`, but if it fails the check, the process will be terminated with a fail-fast. It is intended for use under the `--verify-type-and-field-layout` stress mode.
- Currently only the `READYTORUN_FIXUP_Verify_VirtualFunctionOverride` is actually generated, and it is only generated when using the `--verify-type-and-field-layout` switch to crossgen2. Future work will identify if there are scenarios where we need to generate the `READYTORUN_FIXUP_Check_VirtualFunctionOverride` flag. One area of possible concern is around covariant returns, another is around handling of type equivalence.
- In order to express the fixup signature for the VirtualFunctionOverride fixups, a new flag has been added to `ReadyToRunMethodSigFlags`. `READYTORUN_METHOD_SIG_UpdateContext` will allow the method signature to internally specify the assembly which is associated with the method token, instead of relying on the ambient context.
- R2RDump and the ReadyToRun format documentation have been updated with the details of the new fixups/flags.
- Update the rules for handling unboxing stubs
- See #51918 for details. This adds a new test, as well as proper handling for unboxing stubs to match the JIT behavior
- Also revert #52605, which avoided the problem by simply disabling devirtualization in the presence of structs
- Adjust the rules for when it is legal to devirtualize and maintain version resiliency
- The VersionsWithCode and VersionsWithType rules are unnecessarily restrictive.
- Instead Validate that the metadata is safely checkable, and rely on the canInline logic to ensure that no IL that can't be handled is inlined.
- This also involved adding a check that the chain of types from the implementation type to the declaration method table type is within the version bubble.
- And changing the `VersionsWithType` check on the implementation type, to a new `VersionsWithTypeReference` check which can be used to validate that the type can be referred to, in combination with using `VersionsWithType` on the type definition.
- By adjusting the way that the declMethod is referred to, it becomes possible to use the declMethod without checking the full method is `VersionsWithCode`, and it just needs a relationship to version matching code.
- In `resolveVirtualMethod` generate the `CORINFO_RESOLVED_TOKEN` structures for the jit
- In particular we are now able to resolve to methods where the decl method is the resolution result but is not within the version bubble itself. This can happen if we can prove that the decl method is the only method which can possibly implement a virtual.
- Add support for devirtualization reasons to crossgen2
- Port all devirtualization abort conditions to crossgen2 from runtime that were not already present
- Fix devirtualization from a canonical virtual method when the actual implementation is more exact
- Fix variant interface override scenario where there is an interface that requires implementation of the variant interface as well as the variant interface itself.
Just fixing up a couple of missing words I noticed in the intro chapter:
Missing "to" in "(more code that does not seem do much)"
Missing "a" in "This results in big productivity boost."
* 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
* Add MachO dump writer to createdump
Instead of the hacky ELF core dumps on MacOS now createdump generates true MachO dumps.
Setting the COMPlus_DbgEnableElfDumpOnMacOS environment variable is no longer needed.
Add special thread info memory region containing the OS thread ids missing from macho core dumps. This allows SOS to map the thread indexes to thread ids. The address (0x7fffffff00000000) of this special memory region is above the highest user address (0x0007FFFFFFFFF000) and below a kernel reserved address (0xffffff8000xxxxxx) which is kind of moot because dumps don't include any kernel regions. lldb seems just fine with this memory region.
The changes include ARM64 support also, but since I don't have a M1 device I can't build/test them. I'm hoping Steve can at least review them.
Add --verbose/TRACE_VERBOSE support to tone down all the macho dump generation spew.
Issue: #48664
* Fix build problem
* Update docs
* Code review feedback
Co-authored-by: Juan Sebastian Hoyos Ayala <[email protected]>
* Crossgen2 implementation of new MVID R2R section
* Runtime checks for assembly MVIDs against native images
* Basic R2RDump support for dumping the manifest assembly MVID table.
* R2R minor version increment; format spec update
Thanks
Tomas
- 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
Did a second search of master in the repo since all the M2M changes went
in and found some remaining places that weren't included in the
previous change.
- 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).