Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)

if (factory.OptimizationFlags.StripILBodies
&& factory.OptimizationFlags.CompiledMethodDefs.Contains(_method)
&& !MayNeedILAtRuntime(_method))
&& !MayNeedILAtRuntime(factory, _method))
{
return new ObjectData(s_minimalILBody, Array.Empty<Relocation>(), 4, new ISymbolDefinitionNode[] { this });
}
Expand All @@ -72,18 +72,27 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
return new ObjectData(bodyBytes, Array.Empty<Relocation>(), 4, new ISymbolDefinitionNode[] { this });
}

private static bool MayNeedILAtRuntime(MethodDesc method)
private static bool MayNeedILAtRuntime(NodeFactory factory, MethodDesc method)
{
if (method.HasInstantiation || method.OwningType.HasInstantiation)
{
// IL may be needed for new instantiations
return true;
}

if (method.GetTypicalMethodDefinition().Signature.ReturnsTaskOrValueTask() && !method.IsAsync)
if (method.GetTypicalMethodDefinition().Signature.ReturnsTaskOrValueTask())
{
// IL may be needed for async version of non-async Task-returning method
return true;
if (!method.IsAsync)
{
// IL may be needed for async version of non-async Task-returning method
return true;
}

MethodDesc asyncVariant = method.GetAsyncVariant().GetTypicalMethodDefinition();
if (!factory.OptimizationFlags.CompiledMethodDefs.Contains(asyncVariant))
{
return true;
}
Comment thread
kotlarmilos marked this conversation as resolved.
}

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PublishReadyToRunStripILBodies>false</PublishReadyToRunStripILBodies>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TestRuntime>true</TestRuntime>
<IncludeRemoteExecutor>true</IncludeRemoteExecutor>
<PublishReadyToRunStripILBodies>false</PublishReadyToRunStripILBodies>
<TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-unix;$(NetCoreAppCurrent)-browser</TargetFrameworks>
Comment thread
kotlarmilos marked this conversation as resolved.

<!-- some tests require full ICU data, force it -->
Expand Down
1 change: 1 addition & 0 deletions src/tests/JIT/Regression/Regression_o_2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<Optimize>True</Optimize>
<HasMergedInTests>True</HasMergedInTests>
<PublishReadyToRunStripILBodies>false</PublishReadyToRunStripILBodies>
Comment thread
kotlarmilos marked this conversation as resolved.
</PropertyGroup>
Comment thread
kotlarmilos marked this conversation as resolved.
<ItemGroup>
<Compile Include="JitBlue\Runtime_105467\Runtime_105467.cs" />
Expand Down