Skip to content

[wasm][coreclr] Add RhpNewFast allocators#120896

Merged
radekdoulik merged 7 commits intodotnet:mainfrom
radekdoulik:clr-interp-wasm-new-fast-allocators
Oct 22, 2025
Merged

[wasm][coreclr] Add RhpNewFast allocators#120896
radekdoulik merged 7 commits intodotnet:mainfrom
radekdoulik:clr-interp-wasm-new-fast-allocators

Conversation

@radekdoulik
Copy link
Member

No description provided.

@radekdoulik radekdoulik added this to the Future milestone Oct 20, 2025
@radekdoulik radekdoulik added the arch-wasm WebAssembly architecture label Oct 20, 2025
Copilot AI review requested due to automatic review settings October 20, 2025 09:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements three previously stubbed-out fast allocation functions (RhpNewFast, RhpNewFastAlign8, and RhpNewFastMisalign) in the portable CoreCLR runtime. These functions provide optimized object allocation paths by attempting to allocate directly from the thread's allocation context before falling back to slower allocation methods.

Key Changes:

  • Replaced PORTABILITY_ASSERT stubs with full implementations for all three allocator functions
  • Added thread-local allocation context management with fast-path allocation logic
  • Implemented alignment handling for 8-byte aligned and misaligned allocations using dummy objects

@dotnet-policy-service
Copy link
Contributor

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

@jkotas
Copy link
Member

jkotas commented Oct 20, 2025

I have noticed that a few of the existing helpers in this file have unnecessary return null; after RhExceptionHandling_FailedAllocation. Could you please delete it while you are on it?

radekdoulik and others added 2 commits October 21, 2025 20:29
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
@jkotas
Copy link
Member

jkotas commented Oct 21, 2025

I have noticed that a few of the existing helpers in this file have unnecessary return null; after RhExceptionHandling_FailedAllocation. Could you please delete it while you are on it?

Could you please fix this too?

@radekdoulik
Copy link
Member Author

Hope I didn't forget anything else.

@radekdoulik
Copy link
Member Author

Ah, I did, I wanted to ifdef the align8/misalign

@radekdoulik radekdoulik merged commit 4d74c69 into dotnet:main Oct 22, 2025
96 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasm WebAssembly architecture area-VM-coreclr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants