Skip to content

Remove the concept of primitive value types and follow up cleanup#127894

Open
Copilot wants to merge 54 commits into
mainfrom
copilot/delete-primitive-value-types
Open

Remove the concept of primitive value types and follow up cleanup#127894
Copilot wants to merge 54 commits into
mainfrom
copilot/delete-primitive-value-types

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 7, 2026

Primitive value types were vestiges of very old x86 calling convention handling that became unnecessary many years ago.

This change deletes the concept of primitive value types. We only have primitives (Int32, etc. including enums) and true primitives (Int32, etc. without enums) now. Deleting this concept enabled follow up cleanup:

  • Delete GetVerifierCorElementType and replaces all call sites with GetInternalCorElementType
  • Remove special-casing of runtime handle structs (RuntimeArgumentHandle, RuntimeMethodHandleInternal, RuntimeFieldHandleInternal) in the type loader
  • Stop treating TypedReference as primitive some of the time. TypedReference is a regular byref-like value type now.

Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 00:33
Copilot finished work on behalf of jkotas May 7, 2026 00:34
Copilot AI requested a review from jkotas May 7, 2026 00:34
Copy link
Copy Markdown
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Comment thread docs/design/datacontracts/RuntimeTypeSystem.md Outdated
@dotnet-policy-service
Copy link
Copy Markdown
Contributor

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

Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 01:35
Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 01:43
Copilot AI requested review from Copilot and removed request for Copilot May 7, 2026 01:46
Copilot AI changed the title Delete primitive value type category concept from runtime Remove primitive value type concept and normalize enum/primitive category flags May 7, 2026
Copilot finished work on behalf of jkotas May 7, 2026 01:47
Copilot AI requested a review from jkotas May 7, 2026 01:47
Copy link
Copy Markdown
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Comment thread docs/design/datacontracts/RuntimeTypeSystem.md
Comment thread src/coreclr/vm/methodtable.h Outdated
Comment thread src/coreclr/vm/methodtable.h Outdated
Comment thread src/coreclr/vm/methodtable.inl Outdated
Comment thread src/coreclr/vm/typehandle.h Outdated
Copilot AI review requested due to automatic review settings May 7, 2026 02:55
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 10, 2026

They don't have valid EEClass pointers (causing GetClass() to fail)

This is invalid conclusion. These types do have a valid EEClass pointer. The failing GetClass() call was a second order effect....

Fixed in 8cd4494. The solution identifies RuntimeArgumentHandle, RuntimeMethodHandleInternal, and RuntimeFieldHandleInternal by name in lvaInitVarDsc and treats them as TYP_I_IMPL instead of TYP_STRUCT. This avoids calling GetClass() or other struct-specific operations on these types. CoreCLR builds successfully.

Copy link
Copy Markdown
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

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Comment thread src/coreclr/vm/jitinterface.cpp
Copy link
Copy Markdown
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

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Comment thread src/coreclr/vm/jitinterface.cpp
Comment thread docs/design/datacontracts/RuntimeTypeSystem.md Outdated
Comment thread docs/design/datacontracts/RuntimeTypeSystem.md Outdated
Copy link
Copy Markdown
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Comment thread src/coreclr/vm/jitinterface.cpp Outdated
@jkotas
Copy link
Copy Markdown
Member

jkotas commented May 18, 2026

@copilot Merge from main and resolve conflicts

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

@copilot Merge from main and resolve conflicts

Merged main and resolved conflicts in commit 361b54f.

@jkotas
Copy link
Copy Markdown
Member

jkotas commented May 18, 2026

@copilot Do that again and don't forget to push the merge commit into the PR

…delete-primitive-value-types

# Conflicts:
#	src/coreclr/vm/jitinterface.cpp

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 18, 2026

@copilot Do that again and don't forget to push the merge commit into the PR

Done in 90c7b6f: merged latest main, resolved the src/coreclr/vm/jitinterface.cpp conflict, and pushed the merge commit to this PR branch.

Copy link
Copy Markdown
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

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Comment thread src/coreclr/vm/methodtablebuilder.cpp
@jkotas
Copy link
Copy Markdown
Member

jkotas commented May 19, 2026

@rcj1 PTLA. Cleanup discussed in #127877 (comment)

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