コード例 #1
0
        protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
        {
            var compare = _id.CompareTo(((ReadyToRunHelperNode)other)._id);

            if (compare != 0)
            {
                return(compare);
            }

            switch (_id)
            {
            case ReadyToRunHelperId.NewHelper:
            case ReadyToRunHelperId.NewArr1:
            case ReadyToRunHelperId.IsInstanceOf:
            case ReadyToRunHelperId.CastClass:
            case ReadyToRunHelperId.GetNonGCStaticBase:
            case ReadyToRunHelperId.GetGCStaticBase:
            case ReadyToRunHelperId.GetThreadStaticBase:
                return(comparer.Compare((TypeDesc)_target, (TypeDesc)((ReadyToRunHelperNode)other)._target));

            case ReadyToRunHelperId.VirtualCall:
            case ReadyToRunHelperId.ResolveVirtualFunction:
                return(comparer.Compare((MethodDesc)_target, (MethodDesc)((ReadyToRunHelperNode)other)._target));

            case ReadyToRunHelperId.DelegateCtor:
                return(((DelegateCreationInfo)_target).CompareTo((DelegateCreationInfo)((ReadyToRunHelperNode)other)._target, comparer));

            default:
                throw new NotImplementedException();
            }
        }
コード例 #2
0
        public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            var compare = _id.CompareTo(((ReadyToRunGenericHelperNode)other)._id);

            if (compare != 0)
            {
                return(compare);
            }

            if (_dictionaryOwner is MethodDesc)
            {
                if (((ReadyToRunGenericHelperNode)other)._dictionaryOwner is TypeDesc)
                {
                    return(-1);
                }

                compare = comparer.Compare((MethodDesc)_dictionaryOwner, (MethodDesc)((ReadyToRunGenericHelperNode)other)._dictionaryOwner);
            }
            else
            {
                if (((ReadyToRunGenericHelperNode)other)._dictionaryOwner is MethodDesc)
                {
                    return(1);
                }

                compare = comparer.Compare((TypeDesc)_dictionaryOwner, (TypeDesc)((ReadyToRunGenericHelperNode)other)._dictionaryOwner);
            }

            if (compare != 0)
            {
                return(compare);
            }

            switch (_id)
            {
            case ReadyToRunHelperId.TypeHandle:
            case ReadyToRunHelperId.GetGCStaticBase:
            case ReadyToRunHelperId.GetNonGCStaticBase:
            case ReadyToRunHelperId.GetThreadStaticBase:
            case ReadyToRunHelperId.DefaultConstructor:
            case ReadyToRunHelperId.ObjectAllocator:
                return(comparer.Compare((TypeDesc)_target, (TypeDesc)((ReadyToRunGenericHelperNode)other)._target));

            case ReadyToRunHelperId.MethodHandle:
            case ReadyToRunHelperId.MethodDictionary:
            case ReadyToRunHelperId.VirtualDispatchCell:
            case ReadyToRunHelperId.MethodEntry:
                return(comparer.Compare((MethodDesc)_target, (MethodDesc)((ReadyToRunGenericHelperNode)other)._target));

            case ReadyToRunHelperId.FieldHandle:
                return(comparer.Compare((FieldDesc)_target, (FieldDesc)((ReadyToRunGenericHelperNode)other)._target));

            case ReadyToRunHelperId.DelegateCtor:
                return(((DelegateCreationInfo)_target).CompareTo((DelegateCreationInfo)((ReadyToRunGenericHelperNode)other)._target, comparer));

            default:
                throw new NotImplementedException();
            }
        }
コード例 #3
0
        int ISortableNode.CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            var compare = comparer.Compare(Method, ((ShadowConcreteMethodNode)other).Method);

            if (compare != 0)
            {
                return(compare);
            }

            return(comparer.Compare(CanonicalMethodNode, ((ShadowConcreteMethodNode)other).CanonicalMethodNode));
        }
コード例 #4
0
        int ISortableSymbolNode.CompareToImpl(ISortableSymbolNode other, CompilerComparer comparer)
        {
            var compare = comparer.Compare(Method, ((ShadowConcreteUnboxingThunkNode)other).Method);

            if (compare != 0)
            {
                return(compare);
            }

            return(comparer.Compare(_canonicalThunk, ((ShadowConcreteUnboxingThunkNode)other)._canonicalThunk));
        }
コード例 #5
0
        protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
        {
            NonExternMethodSymbolNode otherMethod = (NonExternMethodSymbolNode)other;
            var result = _isUnboxing.CompareTo(otherMethod._isUnboxing);

            return(result != 0 ? result : comparer.Compare(_method, otherMethod._method));
        }
コード例 #6
0
        public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            var compare = _isUnboxingStub.CompareTo(((FatFunctionPointerNode)other)._isUnboxingStub);

            if (compare != 0)
            {
                return(compare);
            }

            return(comparer.Compare(Method, ((FatFunctionPointerNode)other).Method));
        }
コード例 #7
0
        protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
        {
            var compare = _isUnboxingStub.CompareTo(((FatFunctionPointerNode)other)._isUnboxingStub);

            if (compare != 0)
            {
                return(compare);
            }

            return(comparer.Compare(Method, ((FatFunctionPointerNode)other).Method));
        }
コード例 #8
0
ファイル: FrozenObjectNode.cs プロジェクト: mikem8361/runtime
        public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            var otherFrozenObjectNode = (FrozenObjectNode)other;
            int result = comparer.Compare(otherFrozenObjectNode._owningType, _owningType);

            if (result != 0)
            {
                return(result);
            }

            return(_allocationSiteId.CompareTo(otherFrozenObjectNode._allocationSiteId));
        }
コード例 #9
0
        public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            NativeLayoutSignatureNode otherSignature = (NativeLayoutSignatureNode)other;

            if (_identity is MethodDesc)
            {
                if (otherSignature._identity is TypeDesc || otherSignature._identity is FieldDesc)
                {
                    return(-1);
                }
                return(comparer.Compare((MethodDesc)_identity, (MethodDesc)((NativeLayoutSignatureNode)other)._identity));
            }
            else if (_identity is TypeDesc)
            {
                if (otherSignature._identity is MethodDesc)
                {
                    return(1);
                }

                if (otherSignature._identity is FieldDesc)
                {
                    return(-1);
                }

                return(comparer.Compare((TypeDesc)_identity, (TypeDesc)((NativeLayoutSignatureNode)other)._identity));
            }
            else if (_identity is FieldDesc)
            {
                if (otherSignature._identity is MethodDesc || otherSignature._identity is TypeDesc)
                {
                    return(1);
                }
                return(comparer.Compare((FieldDesc)_identity, (FieldDesc)((NativeLayoutSignatureNode)other)._identity));
            }
            else
            {
                throw new NotSupportedException("New type system entity needs a comparison");
            }
        }
コード例 #10
0
        public int CompareTo(PInvokeModuleData other, CompilerComparer comparer)
        {
            int result = StringComparer.Ordinal.Compare(ModuleName, other.ModuleName);

            if (result != 0)
            {
                return(result);
            }

            result = comparer.Compare(DeclaringModule.GetGlobalModuleType(),
                                      other.DeclaringModule.GetGlobalModuleType());
            if (result != 0)
            {
                return(result);
            }

            return(Nullable.Compare(DllImportSearchPath, other.DllImportSearchPath));
        }
コード例 #11
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_targetMethod, ((WebAssemblyVTableSlotNode)other)._targetMethod));
 }
コード例 #12
0
 int ISortableNode.CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_allocationMethod, ((StringAllocatorMethodNode)other)._allocationMethod));
 }
コード例 #13
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_type, ((InterfaceDispatchMapNode)other)._type));
 }
コード例 #14
0
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_type, ((UtcThreadStaticsNode)other)._type));
 }
コード例 #15
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_owningMethod, ((MethodExceptionHandlingInfoNode)other)._owningMethod));
 }
コード例 #16
0
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_methodNode, ((MethodAssociatedDataNode)other)._methodNode));
 }
コード例 #17
0
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(Method, ((UnboxingStubNode)other).Method));
 }
コード例 #18
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(WrappedMethodIndirectionCellNode, ((RuntimeDecodableJumpStubNode)other).WrappedMethodIndirectionCellNode));
 }
コード例 #19
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_type, ((SealedVTableNode)other)._type));
 }
コード例 #20
0
 int ISortableNode.CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_method, ((WebAssemblyMethodBodyNode)other)._method));
 }
コード例 #21
0
 int ISortableNode.CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_method, ((WebAssemblyUnboxingThunkNode)other)._method));
 }
コード例 #22
0
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(WrappedMethodIndirectionCellNode, ((RuntimeDecodableJumpStubNode)other).WrappedMethodIndirectionCellNode));
 }