Repository navigation
Use TypeFlags enum instead of CorElementType in EEType - #8004
Conversation
Fixes dotnet#478. It doesn't fully reap the benefits yet (we can e.g. delete the IsInterface and IsValueType bits). I'm going to work on those later. This is already too big and too scary.
|
Marking NO MERGE because I want to self review this at least one more time. @jkotas could you have a look as well? The point is to free up bits in EEType so that we can start doing things with it. I'm e.g. thinking about adding a pointer to "writable data" similar to what CoreCLR has so that we can make |
| } | ||
|
|
||
| internal RuntimeImports.RhCorElementType CorElementType | ||
| internal CorElementType CorElementType |
There was a problem hiding this comment.
Is this used on any hot paths? This change makes this quite a bit slower.
There was a problem hiding this comment.
It's used mostly in shared code around enums and arrays. They mostly just care about primitive types, so we could make this faster if we forgo correctness for the other values. We were already not reporting ARRAY/SZARRAY/STRING that Array.cs tests for to make an optimization anyway.
Then it's used in the widening code that I didn't want to touch because it's another scary change (offsetting into arrays). That should be a separately reviewed thing, ideally. We can add it as a commit in this pull request later, but I don't want it to distract from the main change here.
After dotnet#8004, some information in EEType was duplicated. This frees up two bits in the main flags, and makes a couple checks easier. I'm keeping the ParameterizedTypeShape concept because it makes casting Sz/Md arrays easier.
After #8004, some information in EEType was duplicated. This frees up two bits in the main flags, and makes a couple checks easier. I'm keeping the ParameterizedTypeShape concept because it makes casting Sz/Md arrays easier.
Fixes #478.
It doesn't fully reap the benefits yet (we can e.g. delete the IsInterface and IsValueType bits). I'm going to work on those later. This is already too big and too scary.