Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 5.6k
Remove static variable holding unboxing stubs#38838
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -110,15 +110,14 @@ private void CreateNodeCaches() | ||
| useInstantiatingStub: false, | ||
| _codegenNodeFactory.MethodSignature(ReadyToRunFixupKind.VirtualEntry, | ||
| cellKey.Method, | ||
| cellKey.IsUnboxingStub, isInstantiatingStub: false), | ||
| isInstantiatingStub: false), | ||
| cellKey.CallingMethod); | ||
| }); | ||
| _delegateCtors = new NodeCache<TypeAndMethod, ISymbolNode>(ctorKey => | ||
| { | ||
| IMethodNode targetMethodNode = _codegenNodeFactory.MethodEntrypoint( | ||
| ctorKey.Method, | ||
| isUnboxingStub: false, | ||
| isInstantiatingStub: ctorKey.Method.Method.HasInstantiation, | ||
| isPrecodeImportRequired: false); | ||
| @@ -159,7 +158,6 @@ private void CreateNodeCaches() | ||
| _codegenNodeFactory.MethodSignature( | ||
| key.IsIndirect ? ReadyToRunFixupKind.IndirectPInvokeTarget : ReadyToRunFixupKind.PInvokeTarget, | ||
| key.MethodWithToken, | ||
| isUnboxingStub: false, | ||
| isInstantiatingStub: false)); | ||
| }); | ||
| } | ||
| @@ -345,20 +343,13 @@ private ISymbolNode CreateTypeHandleHelper(TypeDesc type) | ||
| private ISymbolNode CreateMethodHandleHelper(MethodWithToken method) | ||
| { | ||
| bool useUnboxingStub = method.Method.IsUnboxingThunk(); | ||
Member 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. After this is gone, does this file still need MemberAuthor 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. Yes | ||
| if (useUnboxingStub) | ||
| { | ||
| method = new MethodWithToken(method.Method.GetUnboxedMethod(), method.Token, method.ConstrainedType); | ||
| } | ||
| bool useInstantiatingStub = method.Method.GetCanonMethodTarget(CanonicalFormKind.Specific) != method.Method; | ||
| return new PrecodeHelperImport( | ||
| _codegenNodeFactory, | ||
| _codegenNodeFactory.MethodSignature( | ||
| ReadyToRunFixupKind.MethodHandle, | ||
| method, | ||
| isUnboxingStub: useUnboxingStub, | ||
| isInstantiatingStub: useInstantiatingStub)); | ||
| } | ||
| @@ -392,8 +383,7 @@ private ISymbolNode CreateMethodDictionary(MethodWithToken method) | ||
| _codegenNodeFactory, | ||
| _codegenNodeFactory.MethodSignature( | ||
| ReadyToRunFixupKind.MethodDictionary, | ||
| method, | ||
| isUnboxingStub: false, | ||
| method, | ||
| isInstantiatingStub: true)); | ||
| } | ||
| @@ -427,9 +417,9 @@ public ISymbolNode FieldBaseOffset(TypeDesc typeDesc) | ||
| private NodeCache<MethodAndCallSite, ISymbolNode> _interfaceDispatchCells = new NodeCache<MethodAndCallSite, ISymbolNode>(); | ||
| public ISymbolNode InterfaceDispatchCell(MethodWithToken method, bool isUnboxingStub, MethodDesc callingMethod) | ||
| public ISymbolNode InterfaceDispatchCell(MethodWithToken method, MethodDesc callingMethod) | ||
| { | ||
| MethodAndCallSite cellKey = new MethodAndCallSite(method, isUnboxingStub, callingMethod); | ||
| MethodAndCallSite cellKey = new MethodAndCallSite(method, callingMethod); | ||
| return _interfaceDispatchCells.GetOrAdd(cellKey); | ||
| } | ||
| @@ -440,7 +430,6 @@ public ISymbolNode DelegateCtor(TypeDesc delegateType, MethodWithToken method) | ||
| TypeAndMethod ctorKey = new TypeAndMethod( | ||
| delegateType, | ||
| method, | ||
| isUnboxingStub: false, | ||
| isInstantiatingStub: false, | ||
| isPrecodeImportRequired: false); | ||
| return _delegateCtors.GetOrAdd(ctorKey); | ||
| @@ -456,19 +445,17 @@ public ISymbolNode CheckTypeLayout(TypeDesc type) | ||
| struct MethodAndCallSite : IEquatable<MethodAndCallSite> | ||
| { | ||
| public readonly MethodWithToken Method; | ||
| public readonly bool IsUnboxingStub; | ||
| public readonly MethodDesc CallingMethod; | ||
| public MethodAndCallSite(MethodWithToken method, bool isUnboxingStub, MethodDesc callingMethod) | ||
| public MethodAndCallSite(MethodWithToken method, MethodDesc callingMethod) | ||
| { | ||
| IsUnboxingStub = isUnboxingStub; | ||
| Method = method; | ||
| CallingMethod = callingMethod; | ||
| } | ||
| public bool Equals(MethodAndCallSite other) | ||
| { | ||
| return Method.Equals(other.Method) && IsUnboxingStub == other.IsUnboxingStub && CallingMethod == other.CallingMethod; | ||
| return Method.Equals(other.Method) && CallingMethod == other.CallingMethod; | ||
| } | ||
| public override bool Equals(object obj) | ||
| @@ -479,8 +466,7 @@ public override bool Equals(object obj) | ||
| public override int GetHashCode() | ||
| { | ||
| return (CallingMethod != null ? unchecked(199 * CallingMethod.GetHashCode()) : 0) | ||
| ^ unchecked(31 * Method.GetHashCode()) | ||
| ^ (IsUnboxingStub ? -0x80000000 : 0); | ||
| ^ unchecked(31 * Method.GetHashCode()); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
The first two terms in the assert condition can be simplified to just single
!owningMethod.HasInstantiation