Exemple #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();
            }
        }
        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();
            }
        }
Exemple #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));
        }
Exemple #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));
        }
        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));
        }
        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));
        }
Exemple #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));
        }
        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));
        }
Exemple #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");
            }
        }
Exemple #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));
        }
Exemple #11
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_targetMethod, ((WebAssemblyVTableSlotNode)other)._targetMethod));
 }
 int ISortableNode.CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_allocationMethod, ((StringAllocatorMethodNode)other)._allocationMethod));
 }
Exemple #13
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_type, ((InterfaceDispatchMapNode)other)._type));
 }
Exemple #14
0
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_type, ((UtcThreadStaticsNode)other)._type));
 }
Exemple #15
0
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_owningMethod, ((MethodExceptionHandlingInfoNode)other)._owningMethod));
 }
Exemple #16
0
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_methodNode, ((MethodAssociatedDataNode)other)._methodNode));
 }
Exemple #17
0
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(Method, ((UnboxingStubNode)other).Method));
 }
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(WrappedMethodIndirectionCellNode, ((RuntimeDecodableJumpStubNode)other).WrappedMethodIndirectionCellNode));
 }
 public override int CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_type, ((SealedVTableNode)other)._type));
 }
 int ISortableNode.CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_method, ((WebAssemblyMethodBodyNode)other)._method));
 }
 int ISortableNode.CompareToImpl(ISortableNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(_method, ((WebAssemblyUnboxingThunkNode)other)._method));
 }
 protected internal override int CompareToImpl(SortableDependencyNode other, CompilerComparer comparer)
 {
     return(comparer.Compare(WrappedMethodIndirectionCellNode, ((RuntimeDecodableJumpStubNode)other).WrappedMethodIndirectionCellNode));
 }