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

Merge nmirror to master - #1722

Merged
jkotas merged 25 commits into
masterfrom
nmirror
Aug 25, 2016
Merged

jkotas merged 25 commits into
masterfrom
nmirror

Conversation

@jkotas

@jkotas jkotas commented Aug 24, 2016

Copy link
Copy Markdown
Member

No description provided.

jkotas and others added 25 commits August 23, 2016 06:26
This was a helper function meant to ease
the transition over to unified Type/TypeInfo's.
Now it's purpose has been served.
Get rid CastToType() helper in Reflection.Core
SG tool is not able to deal with duplicate SerializationException definition in CoreLib. Remote it for now until it is fixed.

[tfs-changeset: 1623722]
CR: JKotas

SemaphoreSlim and ConcurrentUnifier variations called Lock.Acquire directly, but then used Monitor.IsEntered to check whether the lock is held.  Fix the code to use Lock.IsAcquired instead of  Monitor.IsEntered.  Also remove dead copies of ConcurrentUnifier* files.

[tfs-changeset: 1623728]
I'll leave the interop and constraint validator work
to their respective owners. It's low-pri work and
I don't want to keep guessing the correct behavior
there.
Wean Reflection.Core off the Extensibility types.
Remove CORERT ifdef around Math.Abs implementation and made the behavior match other .NET implementations

Fixes bug #247525

[tfs-changeset: 1623767]
Now we just have to make them work...
Finished Reflection surface area in N Corelib.
System\Threading\Tasks\DebugHelperRooter.cs was workaround for a bug that was fixed long time ago. Also fixed casing for future.cs while I was on it.

[tfs-changeset: 1623785]
CR: JKotas, SergeyK

*  Mark the SyncTable class with [EagerStaticClassConstruction] to avoid static constructor checks.  Construction ordering should be unimportant since we do not use Monitor.Enter during runtime initialization.
*  Remove the type check for the Lock type from Monitor.Enter code path.  The Lock type is internal and internal code must use Lock.Acquire instead.  Add a debug assert verifying the object is not of the Lock type.
*  Put the AggressiveInlining attribute on two performance-critical functions, which NUTC does not inline.  At least GetSyncEntryIndex is expected to be inlined; reported this issue to the NUTC team.
*  In ObjectHeader.GetSyncEntryIndex use a bit shift trick to save one of two branches.

With these changes uncontended lock performance in ProjectN becomes around 92% of CLR thick lock performance and 82% of CLR thin lock performance (assuming no cache misses for thick locks).

[tfs-changeset: 1623787]
…f available.

SGen will try to find types by simply looking for it in all of the loaded assemblies. This fails if we find the type twice (basically a bug in the FX, but those happen). This change modifies this code to try CCI as the last chance. We try to find a type forwarder for the affected type. If we do find it, we simply follow it, since that will pick the right assembly (and thus the right version of the type).

Also revert the hack to work around the issue which is now fixed.

[tfs-changeset: 1623908]
These apis on System.Type are now functional.

    GetConstructors()
    GetEvents()
    GetFields()
    GetMembers()
    GetMethods()
    GetNestedTypes()
    GetProperties()

    GetConstructors(BindingFlags bindingAttr);
    GetEvents(BindingFlags bindingAttr);
    GetFields(BindingFlags bindingAttr);
    GetMembers(BindingFlags bindingAttr);
    GetMethods(BindingFlags bindingAttr);
    GetNestedTypes(BindingFlags bindingAttr);
    GetProperties(BindingFlags bindingAttr);

    GetEvent(string name);
    GetField(string name);
    GetMember(string name);
    GetMethod(string name);
    GetNestedType(string name);
    GetProperty(string name);

    GetEvent(string name, BindingFlags bindingAttr);
    GetField(string name, BindingFlags bindingAttr);
    GetMember(string name, BindingFlags bindingAttr);
    GetMethod(string name, BindingFlags bindingAttr);
    GetNestedType(string name, BindingFlags bindingAttr);
    GetProperty(string name, BindingFlags bindingAttr);

This was brought up by embedding a cut down version
of System.Reflection.TypeExtensions inside Reflection.Core.

These aren't the final implementations as there's perf
work to do, but these apis are used everywhere
(and assemblies that switch to the new contracts will
be rediverted to them whether want to be or not)
so we need to get them up and running to keep things
flowing.
Initial bringup for Type.GetX() members.
Gee, I don't think we have enough apis to do this - should
we propose a few more?

Anyhow, this was done by moving the CustomAttributeExtensions
class from System.Reflection.Extensions.dll into Corelib.

We also needed to move CustomAttributeInstantiator
from S.P.R.Execution to Corelib (with a typeforwarder.)

Though CustomAttributeExtensions is supposed to be the
"bandaid" api, it actually has the nicest apis so now
it gets to be near the bottom of the stack (with
XInfo.CustomAttributes being the lowest-level primitive.)

Everything else is legacy api that we threw out in
.Net Core.
Bring up the apis to retrieve custom attributes.
@jkotas
jkotas merged commit f365b46 into master Aug 25, 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.

5 participants