-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Only root infrastructure and dependencies for IDynamicInterfaceCastable when IDIC is implemented #116660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only root infrastructure and dependencies for IDynamicInterfaceCastable when IDIC is implemented #116660
Conversation
Remove weak symbol handling
…DIC is used at all.
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/Compilation.cs
Outdated
Show resolved
Hide resolved
...lr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/IDynamicInterfaceCastableSupport.cs
Outdated
Show resolved
Hide resolved
...aries/System.Private.CoreLib/src/System/Runtime/InteropServices/IDynamicInterfaceCastable.cs
Outdated
Show resolved
Hide resolved
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
Outdated
Show resolved
Hide resolved
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/ConstructedEETypeNode.cs
Outdated
Show resolved
Hide resolved
src/coreclr/nativeaot/Runtime.Base/src/System/Runtime/TypeCast.cs
Outdated
Show resolved
Hide resolved
|
I've adjusted the With the current changes, we have 1.7kB from |
|
I've added a commit to explicitly substitute away the entry-point to the logic that I couldn't get trimmed away so we can get most of the size savings now. |
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
Outdated
Show resolved
Hide resolved
…es based on scanning results
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ILScanner.cs
Outdated
Show resolved
Hide resolved
|
(Sorry for the slow reaction time, missed this PR went out of Draft) |
Implement a mechanism to conditionally root
[RuntimeExport]methods based on the type corresponding to their feature being used. Use this mechanism to only rootIDynamicInterfaceCastablelogic when someone implementsIDynamicInterfaceCastableand provide "default" implementations that should never be called in the bootstrapper when IDIC is unused.Additionally, enhance the
ScannedDevirtualizationManagerto make two observations that we can optimize around:IDynamicInterfaceCastablehas any implementors[DynamicInterfaceCastableImplementation]type is rooted butIDynamicInterfaceCastableis not, the interfaces implemented by the attributed type still can have a known set of implementors.Finally, adjust the "what type handle to use for casting" logic to only root a
MaximallyConstructableTypesymbol when the target type is notIDynamicInterfaceCastableand whenIDynamicInterfaceCastableis implemented in the compilation (based onDevirtualizationManager).