Repository navigation
Conversation
…e helpers Object stack allocation skipped all array allocations in ReadyToRun code because CORINFO_HELP_READYTORUN_NEWARR_1 has no type argument for the stack allocation expansion. ReadyToRun code that allocates through the explicit-type newarr helpers (for example on WebAssembly, where crossgen2 does not use the compact ReadyToRun helpers) passes the type handle as an argument, so it can use the same path as JIT-compiled code. Only classify the explicit-type newarr helpers as array candidates and drop the blanket ReadyToRun bail-out. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8c63b295-3bbc-4eae-ac3b-012e284ba542
|
Azure Pipelines: Successfully started running 5 pipeline(s). 11 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
|
The Checked locally under the Helix environment for this lane (checked browser-wasm runtime, node 23, the Helix payload):
Note This comment was drafted with GitHub Copilot. |
|
If you don't mind, let's wait for @AndyAyersMS on this one, perhaps there was a reason R2R was not supported here. |
Sounds good, nothing here is blocking and Andy's full fix is a superset. |
Object stack allocation skips every R2R array allocation because
CORINFO_HELP_READYTORUN_NEWARR_1carries no type argument. On WebAssembly, crossgen2 allocates arrays with the explicit-type helpers (CORINFO_HELP_NEWARR_1_DIRECT(type, length)) as JIT-compiled code does, so those can take the normal path. This removes the blanket R2R bail-out (and the now-unusedm_isR2R);READYTORUN_NEWARR_1stays excluded, so native R2R codegen is unchanged.On wasm composite R2R, a non-escaping
new int[4]×1e7 goes from 194 ms to 27 ms, and the 9 array cases inObjectStackAllocationTestsnow pass. This is the explicit-type subset of #116651, without its dependency on #116808.SuperPMI: diffs
Missing SuperPMI contexts and test exclusions
A few R2R contexts replay with missing data (43 of 286,981 on linux-x64 libraries.crossgen2): shared-generic (
__Canon) array allocations now query the array layout before being rejected. Crossgen of 9 framework assemblies with matched base/diff JITs produced zero stack-allocated arrays either way.No test exclusion can be lifted:
ObjectStackAllocationTestsis stillCrossGenTest=falsebecause native R2R usesREADYTORUN_NEWARR_1(#109314), browser CoreCLR runtime tests run on the interpreter (#131321), and out-of-process tests don't run on WASI.Note
This PR description was drafted with GitHub Copilot.