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

Shrink hello world by 3.2% #84463

Merged
merged 2 commits into from Apr 7, 2023
Merged

Conversation

MichalStrehovsky
Copy link
Member

  • Get rid of the MethodTable for double/float
  • Get rid of any Array<T> methods

Cc @dotnet/ilc-contrib

* Get rid of the MethodTable for double/float
* Get rid of any `Array<T>` methods
@ghost
Copy link

ghost commented Apr 7, 2023

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

Issue Details
  • Get rid of the MethodTable for double/float
  • Get rid of any Array<T> methods

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@@ -43,15 +43,15 @@ static class NativeFormatEnumInfo
var handle = field.DefaultValue;
unsortedBoxedValues[i] = handle.HandleType switch
{
HandleType.ConstantSByteValue => (byte)handle.ToConstantSByteValueHandle(reader).GetConstantSByteValue(reader).Value,
HandleType.ConstantSByteValue => (object)(byte)handle.ToConstantSByteValueHandle(reader).GetConstantSByteValue(reader).Value,
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a fun headscratcher.

Copy link
Member

Choose a reason for hiding this comment

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

What was going on here?

Copy link
Member

Choose a reason for hiding this comment

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

type inference not cooperating

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, things got widened to uint64 and then boxed as uint64. We need to box instead of widening.

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

Nice!

@MichalStrehovsky MichalStrehovsky merged commit f18c88d into dotnet:main Apr 7, 2023
108 checks passed
@MichalStrehovsky MichalStrehovsky deleted the smaller branch April 7, 2023 06:04
@dotnet dotnet locked as resolved and limited conversation to collaborators May 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants