Skip to content
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

[mono] Componentize hot reload #52866

Merged
merged 17 commits into from
Jun 12, 2021
Merged

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented May 17, 2021

Move all hot reload code to the hot_reload component.

There are some functional changes:

  • The metadata update data (delta_image, method_table_update fields) moved form MonoImage to BaselineInfo and DeltaInfo structs in the component. So the locking is different now.
  • The metadata_update_init EE callback was unused, so it's been removed.
  • The metadata_update_published runtime callback is always defined, and its work is guarded by a runtime check of the has_updates flag.
  • The managed GetApplyUpdateCapabilities method now calls an icall to find out from the hot reload component if the runtime was started in a way that supports hot reload and returns capabilities appropriately.

There are also some changes to the console sample:

  • use the hot reload BuildTool instead of the hotreload-delta-gen CLI tool to make deltas
  • make it run on osx-arm64 by adhoc codesigning the published binary (other console samples likely need this, too)

@ghost
Copy link

ghost commented May 17, 2021

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

Issue Details

Move all hot reload code to the hot_reload component.

Should be no functional change. Although I did take the opportunity to remove one of the EE callbacks that turned out to be unnecessary.

Author: lambdageek
Assignees: -
Labels:

area-VM-meta-mono

Milestone: -

@lambdageek lambdageek marked this pull request as ready for review June 8, 2021 15:13
@lambdageek lambdageek changed the title [draft][mono] Componentize hot reload [mono] Componentize hot reload Jun 8, 2021
@lambdageek lambdageek force-pushed the componentize-hot-reload branch 2 times, most recently from 8a2147c to 4b1dd43 Compare June 8, 2021 19:28
@lambdageek lambdageek mentioned this pull request Jun 10, 2021
17 tasks
Copy link
Member

@lateralusX lateralusX left a comment

Choose a reason for hiding this comment

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

Looked primarily on the component implementation, not that deeply into the bulk of moved code. Couple of smaller things, otherwise, LGTM.

src/mono/mono/component/hot_reload.h Outdated Show resolved Hide resolved
src/mono/mono/metadata/metadata-internals.h Outdated Show resolved Hide resolved
src/mono/mono/metadata/metadata-update.c Show resolved Hide resolved
lambdageek and others added 10 commits June 11, 2021 16:26
For the fast path data, we will leave a struct in the runtime with the values
and pass its address to the component to fill in.
Use separate baseline and delta structs for tracking updates
Move the delta_image and method_table_update data into BaselineInfo
and DeltaInfo.  Keep a single `MonoImage:has_updates` flag to switch
over to the slow path through the component.
Also setup the BaselineInfo and DeltaInfo earlier before the first
string heap lookup
if the hot reload component is stubbed out, return empty capabilities.

This is a step toward removing FEATURE_METADATA_UPDATE and
ENABLE_METADATA_UPDATE defines and solely using component
infrastrucutre for controlling behavior
… var isn't set.

Match CoreCLR behavior.  Also makes our testsuite actually run the
tests (we check for capabilities before running setting
DOTNET_MODIFIABLE_ASSEMBLIES using the remote executor)
@lambdageek lambdageek merged commit 23336b8 into dotnet:main Jun 12, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jul 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants