如何删除java eclipse中的编译器优化?
正如标题所说,
我要取消优化,因为我想创建一个字节码类文件,它将作为其他程序的输入。该类文件将用于测试程序,并假定未优化。
谢谢,
as titles says ,
i'd to take optimizations off because i want to create a bytecode ,class file, that will be an input to other program. This class file will be used for testing the program , and is assumed to be unoptimized.
thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,只有一种(潜在的)编译器优化需要关闭。这是一种内联旧编译器使用的 JSR 的优化,以减少
finally
子句的代码大小。这只是一个需要关闭的潜在优化...因为对于后来的 JVM,优化是强制性的。有关详细信息,请参阅此链接 。
除此之外,您无法关闭任何字节码优化。但别担心……大多数重要的优化都是由 JIT 编译器执行的。
As far as I can tell, there is only one (potential) compiler optimizations to turn off. That is the optimization that inlines the JSRs used by older compilers to reduce code size for
finally
clauses. And this is only a potential optimization to turn off ... because for later JVMs the optimization is mandatory.See this link for details.
Apart from that, there are no bytecode optimizations that you can turn off. But don't worry ... most of the serious optimizations are performed by the JIT compiler.
优化方面似乎没有太多需要担心的地方。 此页面 列出了 eclipse java 编译器选项。
There does not seem to be much in the way of optimization to worry about. This page lists the eclipse java compiler options.