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

Merge nmirror to master - #1629

Merged
jkotas merged 18 commits into
masterfrom
nmirror
Aug 9, 2016
Merged

jkotas merged 18 commits into
masterfrom
nmirror

Conversation

@jkotas

@jkotas jkotas commented Aug 9, 2016

Copy link
Copy Markdown
Member

No description provided.

cshung and others added 16 commits August 5, 2016 14:09
…g could cause an AV while static constructors are running. This issue was exposed in ProjNDev2 branch. David, thank you for suggesting a fix!

[tfs-changeset: 1621304]
This change removes the ifdef which delayed an improvement in AggregateException made in CoreRT. The corresponding AppCompat changes which were required to avoid regressions has already been checked in.

[tfs-changeset: 1621387]
* "using Internal.Runtime.Augments" is unnecessary
* Update comment to make it not type loader specific
* Add a TODO to rename the helpers. I don't want to do it now to avoid unnecessary integration pains in the Dev2 branch, but the current name did lead to a bug in the past.

[tfs-changeset: 1621398]
[tfs-changeset: 1621448]
1. Rename McgMarshal.ThrowFailed to McgMarshal.ThrowOnExternalCallFailed to indicate the failure is coming from external component
2. Rename McgInterop to __Interop to indicate that this is internal implementation detail in compiler and avoids the question "what the hell is McgInterop". I'm open to other name suggestions as well.
3. We represent IFoo * in the code using IFoo__Impl.Vtbl** which is unnecessarily complicated (try answering this question: what is IFoo__Impl.Vtbl***?). Change to use void*. This also avoids a external dependency to Vtbl type so that we can actually remove Vtbl type
4. Shorten type name argument mangling by replacing common names with common short prefixes - otherwise it can be too verbose. This is unfortunately breaking change in terms of shared library, but should be fine since we are releasing a new one. I'm also thinking about using a hash/GUID encoding but we also need to avoid conflicts in a stable manner so I need to think about this a bit more.
5. use index instead of verbose Proc_Type1_Type2_Type3 (which can get very long) in our shared stub names. The names are internal only so no need to be stable.
6. Remove unnecessary "Class" name from various Mcg codegen artifacts such as StubClass/RCWAdapterClass/etc. Instead, i'll just be Stubs, RCWAdapter, etc

As a bonus, this reduce interop C# codegen by 5.3% and interop IL by 6.7% in twitter. Local performance runs are rather noisy but it does show a marginal improvement on C# compilation time.

[tfs-changeset: 1621516]
This issue is actually two independent bugs in order to get the test running. The first issue was the Mcg crash at compile time in Analyzer.cs. The if conditional was permitting a broader range of types than the unspecialization logic was prepared to handle. In this case it was the type was an array of a generic type, but other problematic types are theoretically possible. I fixed the issue by creating UnspecializedStructural, which should handle any type spec that could be meaningfully unspecialized, which is to say anything except a formal generic parameter.

The second issue is that the reflection code wasn't able to find the enum info for a generic enum. The previous code was looking up the instantiated type and no metadata was encoded for that instantiation. The new code does the lookup on the generic definition of the enum which we do have. We are assuming that the generic parameters in an enum have no meaningful impact, but if that was ever proven false then we'd need to encode metadata for each instantiation or do some more complicated runtime calculation.

[tfs-changeset: 1621542]
jkotas added 2 commits August 9, 2016 14:54
[tfs-changeset: 1621707]
@jkotas
jkotas merged commit 65a3c7e into master Aug 9, 2016
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.

7 participants