【问题标题】:How to use System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod with CoreCLR and CoreFX?如何将 System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod 与 CoreCLR 和 CoreFX 一起使用?
【发布时间】:2018-05-05 08:01:10
【问题描述】:

我需要System.Runtime.CompilerServices.RuntimeHelpers.PrepareMethod 进行预抖动。

但我在 CoreFX 和 CoreCLR 中找不到它的参考 DLL。

我该如何构建它?什么包有这个类和方法??

【问题讨论】:

  • 使用来源,卢克。 The most recent version 包含了这个方法,但是它的实现在 CoreCLR 下是无操作的。您可以使用条件定义存根调用代码或获取最新的核心位(但调用仍然不会做任何事情)。

标签: c# .net .net-core coreclr


【解决方案1】:

RuntimeHelpers.PrepareMethod() 在 .Net Core 1.x 中不存在,因此您将无法在那里使用它。

.Net Core 2.0 中添加了该方法,但是it doesn't do anything there.

在即将发布的 .Net Core 2.1 中,it will actually compile the given method。 (还有only the given method。)

【讨论】:

  • 你知道在 .NET Core 上强制 JITting 方法的任何替代方法吗?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-04-02
  • 2015-05-10
  • 2017-09-14
  • 2013-05-10
  • 2019-11-03
  • 2021-01-09
  • 2013-10-02
相关资源
最近更新 更多