Repository navigation
Conversation
This change implements SystemV AMD64 ABI struct classification necessary for correct passing of function arguments of struct types and returning these by value on Unix AMD64.
|
There is an issue that I've introduced during the final cleanup (bad assert). I'm working on a fix. |
|
It was actually an incorrect classification for Nullable. Should be ok now. |
| { | ||
| internal class SystemVStructClassificator | ||
| { | ||
| const int CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS = 2; |
There was a problem hiding this comment.
Maybe move this const into the SYSTEMV_AMD64_CORINFO_STRUCT_REG_PASSING_DESCRIPTOR struct since it's related? I would probably move the other 3 consts there too since CorInfoTypes.cs is where we look for constants and data structures shared with the JIT.
| if (fieldClassificationType == SystemVClassificationType.SystemVClassificationTypeTypedReference || | ||
| TypeDef2SystemVClassification(typeDesc) == SystemVClassificationType.SystemVClassificationTypeTypedReference) | ||
| { | ||
| // The TypedReference is a very special type. |
There was a problem hiding this comment.
I know it's unrelated to what you're doing but... sigh, at some point we really ought to make TypedReference on CoreCLR same as TypedReference in CoreRT (the first field is ByReference<T> instead of IntPtr and everything just naturally falls out).
The CoreCLR approach with special casing leaks out everywhere.
75b4a88 to
64df289
Compare
|
I've found that there is some problem - the |
|
Never mind, there was no problem, I was just accidentally running ILC built from master without my change. With my change, the test passes. |
This change implements SystemV AMD64 ABI struct classification necessary
for correct passing of function arguments of struct types and returning
these by value on Unix AMD64.
This change is a port of the CoreCLR version with necessary changes to reflect differences in the type system interface between CoreRT and CoreCLR. I have also added caching of the classification result as JIT calls classification for the same type many times.