[clr-interp] Enable rejit in the interpreter#122626
[clr-interp] Enable rejit in the interpreter#122626davidwrighton merged 3 commits intodotnet:mainfrom
Conversation
- Rely on resetting the interpreter code pointer to trigger the existing rejit/prestub logic to fill in any gaps we have.
There was a problem hiding this comment.
Pull request overview
This pull request enables ReJIT support in the interpreter by adding calls to clear the interpreter code pointer at strategic points in the code versioning and entry point management flow. The changes ensure that when code versions are updated or reset, the interpreter state is properly cleared, allowing the existing rejit/prestub logic to rebuild the interpreter state as needed.
- Adds
ClearInterpreterCodePointer()calls inResetCodeEntryPoint()andResetCodeEntryPointForEnC()to clear interpreter state during entry point resets - Adds
ClearInterpreterCodePointer()inPublishNativeCodeVersion()when setting new native code versions to ensure interpreter state is synchronized with code versioning
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/coreclr/vm/method.cpp | Adds interpreter code pointer clearing in two entry point reset methods to support rejit scenarios |
| src/coreclr/vm/codeversion.cpp | Clears interpreter code pointer when publishing new native code versions to ensure proper rejit behavior |
|
Is this resetting of the code pointer for a method the same mechanism that is used also for EnC functionality when debugging. I suspect precodes might also need flushing, but this might already be integrated with the rest of the runtime ? |
|
@BrzVlad This may be enough to make |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This fixes the rejit test