Skip to content

Delete extra layers #116405

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

Merged
merged 3 commits into from
Jun 9, 2025
Merged

Delete extra layers #116405

merged 3 commits into from
Jun 9, 2025

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Jun 7, 2025

  • Delegate extra layer of metadata APIs
  • Delegate extra layer of coreclr directory caching

@Copilot Copilot AI review requested due to automatic review settings June 7, 2025 21:28
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes several extra metadata API layers and redundant shim files to simplify coreclr’s internal caching and assembly metadata access.

  • Removed redundant metadata export and shimload headers and functions.
  • Replaced multiple metadata API wrappers with direct calls to coreclr methods.
  • Cleaned up ancillary code in debugger, binder, and metadata components.

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/vm/assembly.cpp Removed unneeded metadataexports include.
src/coreclr/vm/appdomain.hpp Removed extra IsBaseLibrary/IsBaseLibrarySatellite functions.
src/coreclr/vm/appdomain.cpp Simplified system directory retrieval and base library path setup.
src/coreclr/md/compiler/regmeta.cpp Consolidated metadata reopening functions and fixed a typo.
src/coreclr/inc/* Removed shimload and metadataexports headers.
src/coreclr/debug/* Removed references to removed metadata API layers.
src/coreclr/binder/utils.cpp Added forward declaration for RuntimeFileNotFound.
src/coreclr/ilasm/* and src/coreclr/dlls/mscoree/* Removed unused includes for removed metadata layers.
Comments suppressed due to low confidence (2)

src/coreclr/vm/appdomain.cpp:884

  • The removal of the conditional block that appends the trailing directory separator may lead to incorrect path concatenation if GetClrModuleDirectory does not guarantee a trailing separator. Please confirm that GetClrModuleDirectory always returns a canonicalized directory with a trailing separator.
m_BaseLibrary.Append(g_pwBaseLibrary);

src/coreclr/debug/di/module.cpp:1040

  • The updated call to MDReOpenMetaDataWithMemory replaces ReOpenMetaDataWithMemoryEx; please verify that this new API fully replicates the old behavior, especially in terms of flags and error handling.
hr = MDReOpenMetaDataWithMemory(m_pIMImport, pLocalMetaDataPtr, dwMetaDataSize, ofTakeOwnership );

Copy link
Contributor

Tagging subscribers to this area: @mangod9
See info in area-owners.md if you want to be subscribed.

PRECONDITION(CheckPointer(ppv));
} CONTRACTL_END;

return GetMDInternalInterface(pData, cbData, flags, riid, ppv);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exact same thing was exposed under two different names. None of this is exported in CoreCLR, so it is fine to delete the extra layer.

Delegate extra layer of coreclr directory caching
@@ -140,7 +140,6 @@ LEAF_END RhpGcPoll, _TEXT

NESTED_ENTRY RhpGcPollRare, _TEXT
PUSH_COOP_PINVOKE_FRAME rcx
END_PROLOGUE
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing unrelated build warning (END_PROLOGUE is called by PUSH_COOP_PINVOKE_FRAME, so this one is redundant)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two more like these:

PUSH_COOP_PINVOKE_FRAME rcx
END_PROLOGUE

PUSH_COOP_PINVOKE_FRAME rcx
END_PROLOGUE

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those should obviously be fixed too even if it makes no codegen difference (END_PROLOGUE is no-op on non-Windows).

@jkotas jkotas merged commit c8403e6 into dotnet:main Jun 9, 2025
113 checks passed
@jkotas jkotas deleted the extra-md branch June 9, 2025 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants