我目前正在编写一个针对 Java 字节码翻译的玩具编译器.
I'm currently writing a toy compiler targeting Java bytecode in the translation.
我想知道在编写 .class 文件之前是否可以在发出的字节码中进行各种简单的窥视孔优化的某种目录(可能是摘要).我实际上知道一些具有此功能的库,但我想自己实现它.
I would like to know if there is some kind of catalog, maybe a summary, of various simple peephole optimizations that can be made in the emitted bytecode before writing the .class file. I actually am aware of some libraries that have this functionality, but I'd like to implement that myself.
你知道Proguard吗?http://proguard.sourceforge.net/
You are aware of Proguard? http://proguard.sourceforge.net/
这是一个很棒的字节码优化器,它实现了很多优化.有关列表,请参阅常见问题解答:http://proguard.sourceforge.net/FAQ.html
This is a great bytecode optimizer which implements a lot of optimizations. See the FAQ for a list: http://proguard.sourceforge.net/FAQ.html
我相信您可以进一步查看源代码以了解它们是如何实现的.
I'm sure you can further look into the source code to understand how they are implemented.
这篇关于编译器优化:Java 字节码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!