On Stack Replacement and JIT
2013-12-17 10:29
381 查看
Both of them pretty much do the same thing. Identify that the method is hot and compile itinstead of interpreting. With OSR, you just move to the compiled version right after it getscompiled, unlike with JIT, where the compiled code gets called when the method is called for the second time. In general, Just-in-time compilation refers to compiling native code at runtime and executing it instead of (or in addition to) interpreting. Some VMs, such as Google V8, don't even have an interpreter; they JIT compile every function that gets executed (with varying degrees of optimization).On Stack Replacement (OSR) is a technique for switching between different implementations of the same function. For example, you could use OSR to switch from interpreted or unoptimized code to JITed code as soon as it finishes compiling.OSR is useful in situations where you identify a function as "hot" while it is running. This might not necessarily be because the function gets called frequently; it might be called only once, but it spends a lot of time in a big loop which could benefit from optimization. When OSR occurs, the VM is paused, and the stack frame for the target function is replaced by an equivalent frame which may have variables in different locations. OSR can also occur in the other direction: from optimized code to unoptimized code or interpreted code. Optimized code may make some assumptions about the runtime behavior of the program based on past behavior. For instance, you could convert a virtual or dynamic method call into a static call if you've only ever seen one type of receiver object. If it turns out later that these assumptions were wrong, OSR can be used to fall back to a more conservative implementation: the optimized stack frame gets converted into an unoptimized stack frame. If the VM supports inlining, you might even end up converting an optimized stack frame into several unoptimized stack frames.参考:http://stackoverflow.com/questions/9105505/differences-between-just-in-time-compilation-and-on-stack-replacementwzw01142013.12.17
相关文章推荐
- 数据库链接字符串查询网站
- DB2实例管理
- DB2实例管理
- mysql问答汇集
- 创建一个空的IBM DB2 ECO数据库的方法
- Access 2000 数据库 80 万记录通用快速分页类
- 开通一个数据库失败的原因的和解决办法
- 一个简单的asp数据库操作类
- EasyASP v1.5发布(包含数据库操作类,原clsDbCtrl.asp)第1/2页
- sql2008 还原数据库解决方案
- Oracle 数据库自动存储管理-安装配置
- Oracle 数据库 临时数据的处理方法
- 最近比较流行的数据库挂马
- 重装主控服务器后,数据库连接失败的解决办法:请正确还原数据库。
- 九种防MDB数据库被下载的方法小结
- asp向数据库插入数据的方法rs
- 浅析C# web访问mysql数据库-整理归纳总结
- SQL Server误区30日谈 第9天 数据库文件收缩不会影响性能
- CMD命令操作MSSQL2005数据库(命令整理)