Skip to content

Revert "Create a single copy of stub templates" #115665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 17, 2025

Conversation

thaystg
Copy link
Member

@thaystg thaystg commented May 16, 2025

Reverts #114462

This broke attach to an app on Mac M1.

Copy link
Contributor

@Copilot 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 pull request reverts changes introduced in #114462 that caused issues with attaching to an app on Mac M1. The changes restore previous type definitions and configuration for stub template handling and loader heap initialization.

  • Revert changes replacing uint8_t/size_t with BYTE/SIZE_T in GenerateCodePage function signatures.
  • Remove newly introduced extern variables and template-related changes.
  • Update loader allocator and heap initialization to use the original code page generator parameters.

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/coreclr/vm/precode.h Reverts type updates in GenerateCodePage function signature
src/coreclr/vm/precode.cpp Aligns function definitions and removes extraneous template logic
src/coreclr/vm/loaderallocator.cpp Updates calls to use the original code page generator function pointer
src/coreclr/vm/callcounting.* Consistent type updates to GenerateCodePage across call counting logic
src/coreclr/utilcode/interleavedloaderheap.cpp Reverts template and configuration usage in loader heap allocation
src/coreclr/inc/loaderheap.h Adjusts the constructor parameters to revert back to the previous API
Other files Revert changes to double mapping and template functions for minipal
Comments suppressed due to low confidence (3)

src/coreclr/inc/loaderheap.h:496

  • The UnlockedInterleavedLoaderHeap constructor now requires a codePageGenerator function pointer and granularity. Make sure that every caller of this constructor has been updated to supply these parameters and that the new API is consistently used.
void (*m_codePageGenerator)(BYTE* pageBase, BYTE* pageBaseRX, SIZE_T size);

src/coreclr/vm/precode.h:228

  • The reversion changes the parameter types from uint8_t* and size_t to BYTE* and SIZE_T. Please verify that all corresponding call sites and interface definitions consistently use these types to avoid any type mismatch issues.
static void GenerateCodePage(BYTE* pageBase, BYTE* pageBaseRX, SIZE_T size);

src/coreclr/vm/loaderallocator.cpp:1211

  • The updated call now passes the GenerateCodePage function pointer and CodeSize to the InterleavedLoaderHeap constructor. Confirm that this change aligns with the updated constructor signature in loaderheap.h for consistent behavior.
StubPrecode::GenerateCodePage,

Copy link
Contributor

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

@hoyosjs hoyosjs enabled auto-merge (squash) May 17, 2025 01:01
@hoyosjs hoyosjs merged commit f7fc178 into main May 17, 2025
96 checks passed
@hoyosjs hoyosjs deleted the revert-114462-thunks_from_image branch May 19, 2025 16:25
davidwrighton added a commit to davidwrighton/runtime that referenced this pull request May 19, 2025
davidwrighton added a commit that referenced this pull request May 20, 2025
* Reapply "Create a single copy of stub templates (#114462)" (#115665)

This reverts commit f7fc178.

* Disable feature on Apple platforms for now

Co-authored-by: Tom McDonald <tommcdon@microsoft.com>
SimaTian pushed a commit that referenced this pull request May 27, 2025
* Reapply "Create a single copy of stub templates (#114462)" (#115665)

This reverts commit f7fc178.

* Disable feature on Apple platforms for now

Co-authored-by: Tom McDonald <tommcdon@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants