-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a u16 instead of an i64 for enum tags
Now that we support stack allocated types, the fields of enum types aren't necessarily all one word in size any more. This in turn means that using an i64 might be wasteful due to the excess padding. To reduce the size of enums somewhat, we now use a 16 bits integer for the tag instead of a 64 bits integer. This change also revealed an issue with struct returns/arguments on the AMD64 ABI, as for types such as `{ i16, i64 }` the ABI actually seems to demand `{ i64, i16 }`. Since this requires re-ordering the struct fields and remapping all access sites accordingly, which is a pain, we take the same approach as Rust which in turn matches what the ARM ABI wants: for structs between 8 and 16 bytes, we just treat them as `{ i64, i64 }` types. This is valid size/alignment wise because for a `{ i16, i64 }` the alignment of both members is 8 bytes. This fixes #785. Changelog: performance
- Loading branch information
1 parent
40b3293
commit 87e6689
Showing
7 changed files
with
95 additions
and
106 deletions.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.