-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono] Initial metadata update support (#20629)
First part of support for metadata updates. Contributes to dotnet/runtime#44806 The feature is off by default. To enable, build with `/p:MonoMetadataUpdate=true` (e.g. `./build.sh --os browser /p:MonoMetadataUpdate=true`). There are samples in `src/mono/netcore/sample/mbr` (see the README - the samples aren't completely standalone and need some external tooling to build) for console (only tested on Mac and Linux) and wasm. There's a demo at https://lambdageek.dev/dl0/ * Initial metadata-update prototype Co-Authored-By: Bernhard Urban-Forster <lewurm@gmail.com> * Add metadata-update.{c,h} to CMakeLists.txt * Add icall to corelib * Add console and browser metadata update samples Both samples depend on the roslynildiff tool which should be specified with a RoslynILDiffFullPath property in the .csproj files for the projects. * Add README for mbr samples * [build] Add initial runtime support for MonoMetadataUpdate property In the runtime defines cmake ENABLE_METADATA_UPDATE option and sets a preprocessor flag. In System.Private.CoreLib, defines FEATURE_METADATA_UPDATE and uses it to throw a NotSupportedException from LoadMetadataUpdate * [runtime] ifdef out metadata updates if not enabled Also move execution engine initialization into the main update function and use a MonoError to signal failures (such as if interp inlining is not turned off) instead of asserting at startup. * [wasm] set log mask to metadata-update * [mbr] Add InjectUpdate fn to sample * [metadata-update] don't merge heaps * Don't make entrypoint public yet * Add LoadMetadataUpdate to linker descriptor * [wasm] add default Makefile variable value * fix mono/mono CI don't try to run enc tests yet since they depend on roslynildiff * remove mono/mono/tests/enc Will add as runtime tests in a future PR * [metadata-update] Add per-thread exposed generation A thread has to voluntarily roll up to the latest published generation in order to see updates. - Roll up to the latest published generation when attaching a thread - The updater thread sees the allocated unpublished generation * [mbr] Fixup console sample Use a single changing testfile * [metadata-update] delete unused method * [mbr] Use 2 threads in console sample * [metadata-update] Respect exposed generation in MethdDef RVA lookups * [interp] Expose latest metadata update before transforming methods * [mbr] Update samples after rebase Use the WasmApp.targets * [metadata-update] Don't fail after the first unsupported edit Log all the unsupported edits, then cancel the update * [metadata_update] Keep track of logical table sizes for deltas Keep track of inserted/modified rows for each table in each delta. This will help to use a simpler algorithm to locate effective table rows by keeping track of the logical number of rows in the appended tables * [metadata-update] Use a GList for MonoImage:delta_image We're going to need to walk backwards from the latest published delta * [metadata-update] add effective table lookup debug output * Address review feedback * [interp] Save top interp frame at MINT_SAFEPOINT to ThreadContext Give metadata updates a peek at the interp frames since the LMF so that it can copy the InterpMethods that are currently executing This only works with hybrid and full coop suspend. Preemptive suspend will need another mechanism. * [mbr] Extend console sample Add a busy thread to demonstrate that interp frames since the last managed frame are visible to the metadata update mechanism and the active method bodies are copied before being invalidated. * [interp] Check mono_polling_required at safepoint Co-authored-by: Bernhard Urban-Forster <lewurm@gmail.com> Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
- Loading branch information
1 parent
efc3b8a
commit 58f650c
Showing
24 changed files
with
1,589 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.