Erlang编译:混合了“HiPE目标代码”和“操作码” [英] Erlang compilation: mixed of "HiPE object code" and "opcode"?

查看:151
本文介绍了Erlang编译:混合了“HiPE目标代码”和“操作码”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能同时执行HiPE代码和通常的基于opcode的对象的VM实例?

Is it possible to have a VM instance that executes both HiPE code and the usual "opcode" based objects at the same time?

此问题与以下内容有关: Erlang OTP发行版与HiPE编译

This question is related to : Erlang OTP release compiles with HiPE?

推荐答案

是的,这是本地编译器的集成方式。只有使用+ native选项编译的那些模块才在本地机器代码中执行,而其余的则如往常由BEAM仿真器解释。当以不同方式编译的模块之间进行通话时,会发生模式切换。这样,您可以无缝地混合本机模拟模块。尽管如此,您应该尝试选择本机编译的模块,以避免严格的性能关键环路中的模式切换,因为每次都有少量开销。

Yes, that is how the native compiler is integrated. Only those modules that are compiled with the +native option are executing in native machine code, and the rest are interpreted by the BEAM emulator as usual. When you make calls between modules compiled in different ways, a "mode switch" happens. This way, you can mix native and emulated modules seamlessly. Still, you should try to select which modules you native compile so that you avoid mode switches in tight, performance critical loops, because there is a small overhead each time.

这篇关于Erlang编译:混合了“HiPE目标代码”和“操作码”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆