Welcome to mirror list, hosted at ThFree Co, Russian Federation.

CppUnboxingStubNode.cs « DependencyAnalysis « Compiler « src « ILCompiler.CppCodeGen « src - github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a47dca6db67641046ee4a72f4ef9c64a315b36f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Diagnostics;

using ILCompiler.DependencyAnalysisFramework;

using Internal.Text;
using Internal.TypeSystem;

namespace ILCompiler.DependencyAnalysis
{
    internal class CppUnboxingStubNode : DependencyNodeCore<NodeFactory>, IMethodNode
    {
        public CppUnboxingStubNode(MethodDesc method)
        {
            Debug.Assert(method.OwningType.IsValueType && !method.Signature.IsStatic);
            Method = method;
        }

        public MethodDesc Method { get; }

        public int ClassCode => 17864523;

        public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb)
        {
            sb.Append("unbox_").Append(nameMangler.GetMangledMethodName(Method));
        }

        public int CompareToImpl(ISortableNode other, CompilerComparer comparer)
        {
            return comparer.Compare(this.Method, ((CppUnboxingStubNode)other).Method);
        }

        public override IEnumerable<DependencyListEntry> GetStaticDependencies(NodeFactory factory)
        {
            return new DependencyListEntry[] {
                new DependencyListEntry(factory.MethodEntrypoint(Method), "Target of unboxing") };
        }

        protected override string GetName(NodeFactory factory) => this.GetMangledName(factory.NameMangler);

        public static string GetMangledName(NameMangler nameMangler, MethodDesc method)
        {
            return "unbox_" + nameMangler.GetMangledMethodName(method);
        }

        public override bool StaticDependenciesAreComputed => true;
        public override bool HasDynamicDependencies => false;
        public override bool InterestingForDynamicDependencyAnalysis => false;
        public override bool HasConditionalStaticDependencies => false;

        public int Offset => throw new System.NotImplementedException();

        public bool RepresentsIndirectionCell => throw new System.NotImplementedException();

        public override IEnumerable<CombinedDependencyListEntry> GetConditionalStaticDependencies(NodeFactory context)
        {
            return null;
        }
        public override IEnumerable<CombinedDependencyListEntry> SearchDynamicDependencies(List<DependencyNodeCore<NodeFactory>> markedNodes, int firstNode, NodeFactory context)
        {
            return null;
        }
    }
}