未验证 提交 1fb1c8f4 编写于 作者: A Andrew Au 提交者: GitHub

Make sure EnsureInitialize() loads the GcInfo if it is there (#53896)

上级 878dc203
......@@ -14,7 +14,6 @@
<OutputPath>$(RuntimeBinDir)</OutputPath>
<Platforms>AnyCPU;x64</Platforms>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>7.3</LangVersion>
</PropertyGroup>
<ItemGroup>
......
......@@ -305,7 +305,7 @@ private void EnsureRuntimeFunctions()
if (this._runtimeFunctions == null)
{
this._runtimeFunctions = new List<RuntimeFunction>();
this.ParseRuntimeFunctions();
this.ParseRuntimeFunctions(false);
}
}
......@@ -474,17 +474,21 @@ public IReadOnlyList<FixupCell> Fixups
private void EnsureInitialized()
{
if (_gcInfo == null && GcInfoRva != 0)
if (_gcInfo == null)
{
int gcInfoOffset = _readyToRunReader.CompositeReader.GetOffset(GcInfoRva);
if (_readyToRunReader.Machine == Machine.I386)
{
_gcInfo = new x86.GcInfo(_readyToRunReader.Image, gcInfoOffset, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion);
}
else
ParseRuntimeFunctions(true);
if (GcInfoRva != 0)
{
// Arm and Arm64 use the same GcInfo format as Amd64
_gcInfo = new Amd64.GcInfo(_readyToRunReader.Image, gcInfoOffset, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion);
int gcInfoOffset = _readyToRunReader.CompositeReader.GetOffset(GcInfoRva);
if (_readyToRunReader.Machine == Machine.I386)
{
_gcInfo = new x86.GcInfo(_readyToRunReader.Image, gcInfoOffset, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion);
}
else
{
// Arm and Arm64 use the same GcInfo format as Amd64
_gcInfo = new Amd64.GcInfo(_readyToRunReader.Image, gcInfoOffset, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion);
}
}
}
if (_pgoInfo == null)
......@@ -547,7 +551,7 @@ private void EnsureFixupCells()
/// Get the RVAs of the runtime functions for each method
/// based on <a href="https://github.com/dotnet/coreclr/blob/master/src/zap/zapcode.cpp">ZapUnwindInfo::Save</a>
/// </summary>
private void ParseRuntimeFunctions()
private void ParseRuntimeFunctions(bool partial)
{
int runtimeFunctionId = EntryPointRuntimeFunctionId;
int runtimeFunctionSize = _readyToRunReader.CalculateRuntimeFunctionSize();
......@@ -602,6 +606,11 @@ private void ParseRuntimeFunctions()
}
}
if (partial)
{
return;
}
RuntimeFunction rtf = new RuntimeFunction(
_readyToRunReader,
runtimeFunctionId,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册