Skip to content

JIT: See if we can/should replace heap class layouts by custom layouts #114205

Open

Description

@jakobbotsch

Class layouts today can be created from either ref classes or value classes. I believe the former capability is only used by object stack allocation, yet everyone pays for additional JIT-EE calls when creating class layouts. We should see if we can/want to replace this by custom layouts created inside object stack allocation instead.

A few things to consider:

  1. I am not sure if getHeapClassSize can be removed or not in favor of getClassSize. But we can certainly switch the use to happen inside objectalloc instead.
  2. getTypeLayout today bails for non value classes. It means we are not making use of padding information during promotion of stack-allocated heap classes.
  3. We should be able to remove ClassLayout::IsValueClass as well.

Activity

  1. ghost added
    area-CodeGen-coreclr
    on Apr 3, 2025
  2. added
    untriaged
    on Apr 3, 2025
  3. dotnet-policy-service commented on Apr 3, 2025

    @dotnet-policy-service
    Contributor

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

  4. removed
    untriaged
    on Apr 6, 2025
  5. added this to the Future milestone on Apr 6, 2025
  6. added a commit that references this issue on Jan 3, 2026
    790c608
  7. added a commit that references this issue on Feb 16, 2026
    c9bcced
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-CodeGen-coreclr

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions