Uh oh!
There was an error while loading. Please reload this page.
[clr-interp] Improve the performance of interpreter calls - #120067
Conversation
- Instead of setting the target in the CallStubHeader at each invocation, store the target in the CallStubHeader immediately. - Avoid invoking the prestub unnecessarily. Instead, detect that we've already run the prestub to completion at least once before poisoning the m_interpreterCode field on MethodDesc. This may be enough to make some of our tests which are currently timing out pass.
Tagging subscribers to this area: @mangod9 |
davidwrighton
commented
Sep 24, 2025
/azp run runtime-interpreter |
|
Azure Pipelines successfully started running 1 pipeline(s). |
… were not quite ready to execute.
…_InterpreterMethodCallPerf
davidwrighton
commented
Sep 25, 2025
/azp run runtime-interpreter |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes interpreter call performance by reducing redundant work and avoiding unnecessary prestub invocations. The changes focus on storing call targets in CallStubHeader immediately rather than setting them at each invocation, and implementing a poisoning mechanism to prevent repeated failed attempts to get interpreter code.
- Store call targets in CallStubHeader at creation time to avoid repeated target setting
- Add poisoning mechanism to prevent redundant prestub calls for methods that cannot be interpreted
- Optimize call paths by detecting when prestub has already completed successfully
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/coreclr/vm/wasm/helpers.cpp | Updates InvokeManagedMethod to handle NULL target by getting multi-callable address |
| src/coreclr/vm/method.hpp | Adds interpreter code poisoning mechanism with new methods and constants |
| src/coreclr/vm/interpexec.cpp | Major optimization changes including target storage in CallStubHeader and poisoning logic |
| src/coreclr/vm/callstubgenerator.h | Adds GetTarget() method to CallStubHeader for retrieving stored targets |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This may be enough to make some of our tests which are currently timing out pass.