Java 8是否有尾调用优化? [英] Does Java 8 have tail call optimization?

查看:107
本文介绍了Java 8是否有尾调用优化?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在网上挖掘以解答我的问题。我找到了一些与 Project DaVinci 相关的文档。这被标记为JSR 292,它与在JVM中包含闭包有关。这个项目是否实现了,它是Java 8的一部分吗?

I tried digging on the web to get my question answered. I found some documents related to Project DaVinci. This is tagged to the JSR 292 which is related to including closures in the JVM. Did this project get realized and is it a part of Java 8?

推荐答案

据我所知,Java 8没有尾部呼叫优化。 Afaik它与实际的编译器技巧无关,因为它很简单,但为了安全起见保留了一个callstack。但我想用字节码重写器是可能的。

As far as I know Java 8 does not have tail call optimization. Afaik it isn't related to the actual compiler trick, because that one is simple, but to preserve a callstack for security purposes. But I guess it would be possible with a bytecode rewriter.

这篇关于Java 8是否有尾调用优化?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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