- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
来自 http://code.google.com/p/unladen-swallow/wiki/ProjectPlan我引用:
“使用 JIT 还可以让我们将 Python 从基于堆栈的机器转移到寄存器机器,这已被证明可以提高其他类似语言的性能(Ierusalimschy 等人,2005 年;Shi 等人,2005 年)。 "
在大学里,我为一种带有递归过程的语言构建了一个简单的编译器——它为每个调用的过程维护堆栈帧——这样它们就可以被递归调用,这样参数和返回值就可以工作......
两件事:
1) 考虑到上述引文中使用的术语,我认为我所实现的将被视为“基于堆栈的机器”是否正确?
2) 如果我在第 (1) 点的假设是正确的,那么“注册机”是如何工作的?即它与基于堆栈的机器有什么不同?
谢谢!
最佳答案
注册机是一种硬件或软件单元,当处理数据时,它会从内存中获取数据,将其放在可以快速处理的位置,然后返回结果。
例如,常规 CPU 是一台寄存器机。由于 ALU(CPU 中处理数字的单元)只能处理寄存器中的数字。
基于堆栈的机器将数据添加到堆栈中,然后将数据弹出或压入堆栈。
例如,两个数字相加是
Push 2 // Push 2 onto the stack
Push 3 // Push 3 onto the stack
Add // Add the top two things on the stack.
在注册机中会是这样的。
Load x, r0 // Load x onto register 0
Load y, r1 // Load y onto register 1
Add r0, r1, r2 // Add 1 and 2 and store the result in register 2
关于python - "register machine"到底是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1622530/
这对你们来说可能很简单,但由于我是java新手,所以我想知道实际上什么是 接下来的部分会发生什么? if (args.length > 0) { file = args[0]; } publi
在我的 View Controller 中,我将 UITapGestureRecognizer 添加到 self.view。我在 self.view 之上添加了一个小 View 。当我点击小 View
我今天尝试从 Obj-C 开始并转到 Swift,我正在阅读文档。我试图在 Swift 中创建一个简单的 IBOutlet,但它不断给我这些错误。 View Controller 没有初始化器 req
我正在尝试使用 VIM 完成(字典和当前缓冲区),但我遇到了问题?和 !在方法名称的末尾。我能以某种方式向 vim 解释方法名称(基本上是单词)最后只能有它,而且只有一个,即 method_name
我是一名优秀的程序员,十分优秀!