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

Merge nmirror to master#3700

Merged
MichalStrehovsky merged 16 commits intodotnet:masterfrom
jkotas:nmirror-merge
May 25, 2017
Merged

Merge nmirror to master#3700
MichalStrehovsky merged 16 commits intodotnet:masterfrom
jkotas:nmirror-merge

Conversation

@jkotas
Copy link
Member

@jkotas jkotas commented May 25, 2017

No description provided.

atsushikan and others added 16 commits May 22, 2017 10:52
This api was approved here:

  https://github.com/dotnet/corefx/issues/5884

and is a necessary step to fixing the System.Dynamic.Runtime.Tests
failure:

  https://github.com/dotnet/corefx/issues/19895

which is caused by Microsoft.CSharp trying to do the impossible
and emulate this api without GetMetadataToken() support.

This emulates the behavior of the CoreCLR version
(which simply compares MetadataTokens and Modules.)

The CoreCLR version of this is currently a PR

  dotnet/coreclr#11774


-- Copied from CoreCLR commit text---

This results in the following behavior for these
corner cases. With the possible exception of #3,
I think they are tolerable enough to accept and codify:


1. "other" implemented by an entirely different Reflection
   provider than "this".

   Behavior:
     returns false without invoking any methods on the
     "other" Member.

   To change it to throw an ArgumentException would
   mean extra cast checks against the 6 possible
   Runtime types (or having said RuntimeTypes implement
   a sentinel interface.)

   Given that HasSameMetadataDefinitionAs() is a
   "looser cousin of Equals()" and "Equals()"
   doesn't throw for objects from a different universe,
   this seems reasonable.


2. Arrays, ByRefs, Pointers and Types from GetTypeFromCLSID()

   Behavior:
     Arrays, ByRefs, Pointers all return token 0x0600000
     and so they'll return "true" wrt to each other (provided
     both types are implemented by the same provider.)

     CLSID types all return the typedef of __ComObject
     so they'll return "true" wrt to each other.

     The constructor exposed by CLSID types all return
     the typedef of some constructor on __ComObject so
     they'll return "true" wrt to each other.

   I do not think these are interesting cases that merit
   special handling. These types will never appear
   in an enumeration of the members of a type. (The
   fact that Reflection surfaces them in objects
   that are assignable to MemberInfo is a structural
   flaw in Reflection's object model.)

3. Synthesized constructors and methods on array types.

   Behavior:
     These methods all return 0x06000000 as a token
     so the constructors will all compare true wrt
     each other, and likewise with the methods.

   This is a bit crummy though it's not clear
   what the "right" policy should look like.
   I could be persuaded to throw NotSupported
   for these, to leave the possibility open
   for a better story later. On the other hand,
   I wouldn't demand it either.
Checking in on behalf of PeterSol to fix the rolling build:

As Ati noticed, my fix for issue 433565 causes a regression because if the actual type is not a DefType, the cast to DefType obviously fails.

I believe that in this case the type can also not be a nullable type, so one possible way to fix this is to test for the case where the type is not a DefType, and treat it the same way as FixupSignatureKind.TypeHandle if it is not.

[tfs-changeset: 1659248]
…tionaries.

     The naming and exporting of method generic dictionaries are differnt from method entries. They have their own oridinals in the TOC files. Actually, method that has generic dictionaries are implemented by shared code, so its entry should not be in the TOC files. This change seperates the handling of method generic dictionaries from method entries and ensure they get a unique and consistent name between the compilation of shared library and an app.

     This change also moves the UTC symbol attribute abstraction (such as isInModule, isDirectReference, isExport ...) upwards to the JIT interface so that we no longer use a method handle for every method-related query or type handle for every type-related query. Also, in this way UTC does not need to know how to handle differnt types of symbols specifically. It will generally call SetPNSymbolAttributes with type system returned attributes on almost all symbols

[tfs-changeset: 1659289]
The prior commit added some runtime assertions for
conditions that we were taking new dependencies on.

This commits replaces those assertions with more
specific type declarations so all this can be enforced
at compile-time.
Make Marshal.PtrToStringAnsi() and StringToCoTaskMemAnsi()
and StringToHGlobalAnsi() work the same way CoreCLR/Desktop
does.
CR: SergeyK

Use normal (non-thread pool) threads to execute long-running tasks — as we do in CoreCLR.  Using thread pool threads caused starvation if other thread pool threads were busy working.  For instance, the
     ItemThreadSafetyTests.TestGetItemThreadSafety test in QA\ToF\tests\FX\Conformance\System.Collections.NonGeneric\4.0.0.0\Hashtable\HashtableTests.csproj creates 7 long-running tasks and would hang on a computer with only 4 logical cores.

[tfs-changeset: 1659419]
Sets things up for System.Runtime.Extensions.Tests bringup
on ILC.

Creates platform-specific EnvironmentAugments files.

Move GetEnvironmentVariable() over to EnvironmentAugments
(not used within CoreLib.)

Get of rid of emasculated UWP version and make it
use regular Windows version.
This is to support NetStandard APIs that are useful for CoreFX test bringup and general compat.

[tfs-changeset: 1659572]
Make Module.Name work off metadata.
@jkotas jkotas mentioned this pull request May 25, 2017
@MichalStrehovsky MichalStrehovsky merged commit 05b6578 into dotnet:master May 25, 2017
@jkotas jkotas deleted the nmirror-merge branch May 25, 2017 05:21
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.

6 participants