Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Improve metadata perf and refactor ilasm/ildasm metadata usage #25144

Merged

Conversation

davidwrighton
Copy link
Member

This change currently conflates 2 change

  1. Removing function pointer indirections around various enumerator calls into metadata
  2. Stop depending on coreclr shared library from ildasm/ilasm. Instead those binaries now are statically linked against all of the metadata logic

@@ -8,7 +8,6 @@ add_definitions(-D__ILASM__)
add_definitions(-DFEATURE_CORECLR)

include_directories(.)
include_directories(../ildasm/unixcoreclrloader)
Copy link
Member

Choose a reason for hiding this comment

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

Delete everything in unixcoreclrloader directory?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I need to do that before checkin, as well as change the IMDInternalImport guid, so nobody gets burned with invalid vtable dispatches on this change if they do something like use a dbi with a non-compatible dac. This is still WIP, as while I managed to get the Windows build to be workable, the Linux/Mac build is broken.

@@ -308,32 +307,17 @@ extern CQuickBytes * g_szBuf_JUMPPT;
extern CQuickBytes * g_szBuf_UnquotedProperName;
extern CQuickBytes * g_szBuf_ProperName;

#ifdef FEATURE_PAL
CoreCLRLoader *g_loader;
#endif
MetaDataGetDispenserFunc metaDataGetDispenser;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: These vars are not needed anymore. Can just call directly.

@davidwrighton davidwrighton changed the title Improve metadata perf and refactor ilasm/ildasm metadata usage [WIP] Improve metadata perf and refactor ilasm/ildasm metadata usage Jun 13, 2019
)
else()
list(APPEND ILASM_LINK_LIBRARIES
${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
Copy link
Member

Choose a reason for hiding this comment

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

This ${START_WHOLE_ARCHIVE} should not be needed. Only the coreclr needs this as it exports symbols, some of which are from PAL.

)
else()
list(APPEND ILDASM_LINK_LIBRARIES
${START_WHOLE_ARCHIVE} # force all PAL objects to be included so all exports are available
Copy link
Member

Choose a reason for hiding this comment

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

Dtto here

- Move enumerator functions to be directly implemented instead of relying on COM/vtable dispatch
- Delete unused functions
- Replace TypeDef enumeration logic to be the same as the general case

Build metadata into ildasm and ilasm instead of referencing coreclr
- SHA1Hash class moved to utilcode
- careful detachment of bindings between metadata and runtime
  - Able to reuse wks build of metadata logic for ilasm/ildasm
- Remove unnecessary function pointer indirection
- Update guid of IMDInternalImport as the api has changed
@davidwrighton davidwrighton changed the title [WIP] Improve metadata perf and refactor ilasm/ildasm metadata usage Improve metadata perf and refactor ilasm/ildasm metadata usage Jul 25, 2019
@davidwrighton davidwrighton marked this pull request as ready for review July 25, 2019 23:45
// %%Function: MetaDataGetDispenser
// This function gets the Dispenser interface given the CLSID and REFIID.
// ---------------------------------------------------------------------------
STDAPI DLLEXPORT MetaDataGetDispenser( // Return HRESULT
Copy link
Member Author

Choose a reason for hiding this comment

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

comment alignment

Copy link

@briansull briansull left a comment

Choose a reason for hiding this comment

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

We reviewed this together.

Looks Good

@davidwrighton davidwrighton merged commit ef7767a into dotnet:master Jul 29, 2019
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
…t/coreclr#25144)

* Optimize enumeration in IMDInternal
- Move enumerator functions to be directly implemented instead of relying on COM/vtable dispatch
- Delete unused functions
- Replace TypeDef enumeration logic to be the same as the general case
- Update guid of IMDInternalImport as the api has changed

Build metadata into ildasm and ilasm instead of referencing coreclr
- SHA1Hash class moved to utilcode
- careful detachment of bindings between metadata and runtime
  - Able to reuse wks build of metadata logic for ilasm/ildasm


Commit migrated from dotnet/coreclr@ef7767a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants