blob: b605c485b86c687fb35c3249758f1002f36e37fc (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
// 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;
using Internal.Text;
using Internal.TypeSystem;
using ILCompiler;
using ILCompiler.DependencyAnalysis;
using Debug = System.Diagnostics.Debug;
namespace Internal.Runtime.JitSupport
{
public class JitMethodCodeNode : ObjectNode, IMethodCodeNode
{
public JitMethodCodeNode(MethodDesc method)
{
_method = method;
}
private MethodDesc _method;
private ObjectData _methodCode;
private FrameInfo[] _frameInfos;
private byte[] _gcInfo;
private ObjectData _ehInfo;
private DebugLocInfo[] _debugLocInfos;
private DebugVarInfo[] _debugVarInfos;
private DebugEHClauseInfo[] _debugEHClauseInfos;
public void SetCode(ObjectData data)
{
Debug.Assert(_methodCode == null);
_methodCode = data;
}
public MethodDesc Method => _method;
public FrameInfo[] FrameInfos => _frameInfos;
public byte[] GCInfo => _gcInfo;
public ObjectData EHInfo => _ehInfo;
public void InitializeFrameInfos(FrameInfo[] frameInfos)
{
Debug.Assert(_frameInfos == null);
_frameInfos = frameInfos;
}
public void InitializeGCInfo(byte[] gcInfo)
{
Debug.Assert(_gcInfo == null);
_gcInfo = gcInfo;
}
public void InitializeEHInfo(ObjectData ehInfo)
{
Debug.Assert(_ehInfo == null);
_ehInfo = ehInfo;
}
public DebugLocInfo[] DebugLocInfos => _debugLocInfos;
public DebugVarInfo[] DebugVarInfos => _debugVarInfos;
public DebugEHClauseInfo[] DebugEHClauseInfos => _debugEHClauseInfos;
public void InitializeDebugLocInfos(DebugLocInfo[] debugLocInfos)
{
Debug.Assert(_debugLocInfos == null);
_debugLocInfos = debugLocInfos;
}
public void InitializeDebugVarInfos(DebugVarInfo[] debugVarInfos)
{
Debug.Assert(_debugVarInfos == null);
_debugVarInfos = debugVarInfos;
}
public void InitializeDebugEHClauseInfos(DebugEHClauseInfo[] debugEHClauseInfos)
{
Debug.Assert(_debugEHClauseInfos == null);
_debugEHClauseInfos = debugEHClauseInfos;
}
protected override string GetName(NodeFactory factory)
{
throw new PlatformNotSupportedException();
}
public override ObjectNodeSection Section
{
get
{
throw new PlatformNotSupportedException();
}
}
public override bool StaticDependenciesAreComputed => _methodCode != null;
public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb)
{
throw new PlatformNotSupportedException();
}
public int Offset => 0;
public override bool IsShareable => false;
public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
{
return _methodCode;
}
}
}
|