有效的解释器中使用了哪些操作码分配策略? [英] What opcode dispatch strategies are used in efficient interpreters?

查看:94
本文介绍了有效的解释器中使用了哪些操作码分配策略?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪些技术可以促进有效的操作码分配,从而实现快速的解释器?是否存在一些仅在现代硬件上有效的技术,而另一些由于硬件的进步而不再有效的技术?在易于实现,速度和可移植性之间必须权衡哪些选择?

What techniques promote efficient opcode dispatch to make a fast interpreter? Are there some techniques that only work well on modern hardware and others that don't work well anymore due to hardware advances? What trade offs must be made between ease of implementation, speed, and portability?

我很高兴Python的C实现最终超越了简单的switch (opcode) {...}实现,将操作码分配作为间接线程作为编译时选项,但是我不高兴他们花了20年才到达那里.也许,如果我们在stackoverflow上记录这些策略,那么下一种语言将会变得更快.

I'm pleased that Python's C implementation is finally moving beyond a simple switch (opcode) {...} implementation for opcode dispatch to indirect threading as a compile time option, but I'm less pleased that it took them 20 years to get there. Maybe if we document these strategies on stackoverflow the next language will get fast faster.

推荐答案

关于不同类型调度的论文很多:

There are a number of papers on different kinds of dispatch:

M. Anton Ertl和David Gregg,在虚拟机解释器中优化间接分支预测准确性,在ACM SIGPLAN 2003编程语言设计和实现会议(PLDI 03)的会议记录中,第278-288页,加利福尼亚州圣地亚哥,2003年6月.

M. Anton Ertl and David Gregg, Optimizing Indirect Branch Prediction Accuracy in Virtual Machine Interpreters, in Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation (PLDI 03), pp. 278-288, San Diego, California, June 2003.

M. Anton Ertl和David Gregg,在现代计算机上有效的虚拟机解释器的行为架构,在《第七届欧洲并行计算会议论文集》(Europar 2001),第403-412页,LNCS 2150,曼彻斯特,2001年8月.

M. Anton Ertl and David Gregg, The behaviour of efficient virtual machine interpreters on modern architectures, in Proceedings of the 7th European Conference on Parallel Computing (Europar 2001), pp. 403-412, LNCS 2150, Manchester, August 2001.

此外,几年前,有人发现了一种新技术是有效的ANSI C.

Also, someone discovered a new technique a few years ago which is valid ANSI C.

这篇关于有效的解释器中使用了哪些操作码分配策略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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