-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Use BinaryPrimitives for ObjectDataBuilder
primitive emit logic
#102394
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Only for .NET because of NS2.0 projects use it too: Microsoft.NET.HostModel and ILVerification
…aBuilder * Add ArrayBuilder.AsSpan overload to make this possible
dotnet-policy-service
bot
added
the
community-contribution
Indicates that the PR has been added by a community member
label
May 17, 2024
jkotas
reviewed
May 17, 2024
src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs
Outdated
Show resolved
Hide resolved
PaulusParssinen
commented
May 17, 2024
src/coreclr/tools/Common/Compiler/DependencyAnalysis/ObjectDataBuilder.cs
Outdated
Show resolved
Hide resolved
Benchmark (Repo)
|
jkotas
reviewed
May 18, 2024
src/coreclr/tools/Common/System/Collections/Generic/ArrayBuilder.cs
Outdated
Show resolved
Hide resolved
* This follows ValueStringBuilder and other buffer builder types.
* Removes the null-checks * ToArray() already would have return empty array. And this isn't used in TypeLoader as far as I know.
This reverts commit 5b48ae2. * Forgot that all places use default(ArrayBuilder<T>) to initialize, zeroizing the fields
jkotas
approved these changes
May 18, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
rhuijben
reviewed
May 18, 2024
Ruihan-Yin
pushed a commit
to Ruihan-Yin/runtime
that referenced
this pull request
May 30, 2024
…tnet#102394) * Add ArrayBuilder.Append(ROS<T>) - Only for .NET because of NS2.0 projects use it too: Microsoft.NET.HostModel and ILVerification * Use BinaryPrimitives to emit integer primitives in ObjectDataBuilder * Use BinaryPrimitives to emit reserved integer primitives in ObjectDataBuilder * Add ArrayBuilder.AsSpan overload to make this possible * Mark some ArrayBuilder members as readonly * Ask ArrayBuilder for a buffer instead of stackalloc + append * Follow ValueStringBuilder's AppendSpan implementation * Don't inline ArrayBuilder resize * This follows ValueStringBuilder and other buffer builder types.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-crossgen2-coreclr
community-contribution
Indicates that the PR has been added by a community member
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To allow more efficient use of the shared
ArrayBuilder<T>
, I added someSpan<T>
overloads under#if NET
preprocessor.These new
ArrayBuilder<T>
overloads will allow future improvements in other projects that utilize it.