Skip to content
This repository was archived by the owner on Nov 13, 2026. It is now read-only.

Merge nmirror to master - #1452

Merged
MichalStrehovsky merged 17 commits into
masterfrom
nmirror
Jun 30, 2016
Merged

MichalStrehovsky merged 17 commits into
masterfrom
nmirror

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

No description provided.

Yi Zhang and others added 17 commits June 24, 2016 19:27
1. Remove unnecessary CCwVTable = GetFuncAddr(GetVtable { return 0; }) code - and simply leave the field uninitialized (StaticInitData transform seem to choke on IntPtr.Zero)
2. Move all GetVTable functions inside __Impl class for better organization/locality
3. Remove unnecessary index constants that defines vtbl offsets - it doesn't buy us anything (other than looking nice) and we should simply emit the constant instead.
4. Move our vtable index calculation into type importing code - it is the most natural place to calculate the vtable index and we record the index in the FuncDecl
5. More refactoring to move hard coded names into Names.cs and adjusted some of the names that we have
6. Making more stuff internal/private - this should speed up shared PIA consumption if we were to go that route again
7. remove the unnecessaarily word vtable field name - change it from pfnFunc_IFoo to pfnFunc_. it seems pretty silly to pay for the full name of the interface just to avoid duplication from the 3 possible base interface names.

Some initial non-scientific testing shows that this gives 6.8% reduction on C# size and 10% reduction on interop untransformed IL size, and 94K native size (under CHK, so take with a lot of salts :) ) savings, on twitter:

C#: before: 19,639,921 after:18,307,693 = -6.78%
IL: before: 4,834,304 after: 4,349,952 = -10.02%
native: before: 27,060,224 after: 26,966,016 = -94K

[tfs-changeset: 1614730]
ThrowHelpers is a recently added type which has specific contract with the .NET Native toolchain - based on standard guidance for similar cases I'm making it public together with its methods to ensure its proper visibility.

[tfs-changeset: 1615017]
…ontract with the .NET Native toolchain. Based on review feedback I have also added a short comment emphasizing this fact, both to the MathHelpers and to ThrowHelpers where I made a similar modification yesterday.

[tfs-changeset: 1615063]
…erning MathHelpers I mentioned parallel addition of an explanatory comment to ThrowHelpers (where I made a similar change yesterday) based on review feedback, however I made a mistake so that the ThrowHelpers change didn't really get checked in, this change fixes that.

[tfs-changeset: 1615065]
…uld finally fix the explanatory comment for MathHelpers.cs as it turns out I originally checked it in without it because I inadvertently made the comment changes in a different enlistment. Apologies about the confusion.

[tfs-changeset: 1615094]
EEType is now a binary contract with a shared EEType.cs reader implementation.

The various EEType probing runtime exports have been superseded by the common EEType.cs -> remove the usage of the exports and delete them.

I will do RhGetCorElementType and RhGetEETypeClassification in a separate changeset because those introduce enum types that have widespread usage and should be deleted in favor of the common ones. This change is big enough as is.

Testing: standard precheckin + NUTC 1k test suite (to test pntestcl)

[tfs-changeset: 1615277]
EEType is now a binary contract with a shared EEType.cs reader implementation.

The various EEType probing runtime exports have been superseded by the common EEType.cs -> remove the usage of the exports and delete them.

I will do RhGetCorElementType and RhGetEETypeClassification in a separate changeset because those introduce enum types that have widespread usage and should be deleted in favor of the common ones. This change is big enough as is.

Testing: standard precheckin + NUTC 1k test suite (to test pntestcl)

[tfs-changeset: 1615277]
This API hasn't been referenced in a long time, and the API on the runtime side has been deleted since February.

[tfs-changeset: 1615284]
Testing: Precheckin, DynamicGenerics

[tfs-changeset: 1615386]
Testing: Precheckin, DynamicGenerics

[tfs-changeset: 1615386]
Instead of trying to compute an enumeration, I'm switching everything to use the IsXX accessors. There's no perf advantage in computing an enum value anymore since all IsXX accessors on EETypePtr are fully inlineable with no runtime calls.

Notable thing is that I'm not introducing a replacement of the "Regular" classification. It was weird and lead to a bug around handling generic enums that I'm fixing. Instead, I'm introducing IsDefType that should do what IsDefType does in the CoreRT type system - return true if this is a struct, class, or interface (non-generic, generic definition, or instantiatied - any of them).

[tfs-changeset: 1615478]
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.

4 participants