Skip to content
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

JIT: Give Compiler a proper constructor #107098

Merged
merged 5 commits into from
Aug 30, 2024

Conversation

jakobbotsch
Copy link
Member

@jakobbotsch jakobbotsch commented Aug 28, 2024

  • Add a proper constructor for Compiler and call it via placement new from jitNativeCode.
  • Remove compInit, fgInit, impInit, lvaInit and optInit. Move all their initialization into the constructor or, when possible, initialize the field directly with its declaration.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Aug 28, 2024
Copy link
Contributor

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

@jakobbotsch jakobbotsch marked this pull request as ready for review August 29, 2024 13:23
@jakobbotsch
Copy link
Member Author

cc @dotnet/jit-contrib PTAL @AndyAyersMS

With this change Compiler members can be initialized directly with their declaration in compiler.h when the initialization value is a simple constant. More complex initialization can be done in Compiler::Compiler directly.

No diffs, some minor TP diffs (the somewhat large MinOpts ones are in collections with almost no MinOpts contexts).

Copy link
Member

@AndyAyersMS AndyAyersMS left a comment

Choose a reason for hiding this comment

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

Will take me a while to get used to the fact that fgInit is no more.

#endif // DEBUG

#if defined(FEATURE_EH_WINDOWS_X86)
// Cache Native AOT ABI check. This must happen *after* eeInfoInitialized is initialized, above.
Copy link
Member

Choose a reason for hiding this comment

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

Maybe reword this comment? eeInfoInitialized is now initialized inline (which I assume happens "before" the constructor body runs).

Copy link
Member Author

Choose a reason for hiding this comment

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

Deleted the comment (indeed, all the inline initialization happens before the body here runs, so we shouldn't have concerns like this anymore)

@jakobbotsch jakobbotsch merged commit cf06c46 into dotnet:main Aug 30, 2024
108 checks passed
@jakobbotsch jakobbotsch deleted the Compiler-constructor branch August 30, 2024 19:25
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 17, 2024
- Add a proper constructor for `Compiler` and call it via placement new from
  `jitNativeCode`.
- Remove `compInit`, `fgInit`, `impInit`, `lvaInit` and `optInit`. Move all
  their initialization into the constructor or, when possible, initialize the
  field directly with its declaration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants