-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Change metadata handle split to 7-bit handle type #111222
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
Changes from all commits
e37a058
7e477fe
eb1867c
b98071f
827d086
46d1bf5
6137602
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -347,7 +347,8 @@ private unsafe void PopulateRvaToTokenMap(TypeManagerHandle handle, byte* pMap, | |
if ((command & StackTraceDataCommand.UpdateOwningType) != 0) | ||
{ | ||
currentOwningType = Handle.FromIntToken((int)NativePrimitiveDecoder.ReadUInt32(ref pCurrent)); | ||
Debug.Assert(currentOwningType.HandleType is HandleType.TypeDefinition or HandleType.TypeReference or HandleType.TypeSpecification); | ||
Debug.Assert((command & StackTraceDataCommand.IsStackTraceHidden) != 0 || | ||
currentOwningType.HandleType is HandleType.TypeDefinition or HandleType.TypeReference or HandleType.TypeSpecification); | ||
Comment on lines
+350
to
+351
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This one is non-obvious: if TypeDef/TypeSpec/TypeRef handles have their highest bit set, we'd compare them as negative numbers when sorting and StackTraceHidden records (that don't bother filing out owning type) will sort after them. We don't currently see UpdateOwningType command for those since they sort before everything else and owning type == 0 is the initial assumption in the code above (and also in the emitter). |
||
} | ||
|
||
if ((command & StackTraceDataCommand.UpdateName) != 0) | ||
|
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.
Should we have
25
defined as a constant somewhere so that it is not hardcoded in so many places?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.
I can do it if you insist but it doesn't seem like a great use of time (especially given we'd need to also do the same for 25/7/1FFFFFF/7F and we'd need to include this from like 5 csproj files). It's unlikely we're going to change this ever again. The existing numbers survived for longer than my tenure on the .NET team.
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.
I do not have a strong opinion