关于java如何执行字节码有很好的参考吗?
时间:2020-03-06 14:24:35 来源:igfitidea点击:
我对java如何组织内存和执行代码(例如放入堆栈或者堆中的东西)感兴趣,从main的开始到分配变量,调用函数,传递参数,返回值,实例化对象等。任何人都可以在上面找到一篇很好的,适合初学者使用的文章/参考资料吗?当然,最好是在线,但是任何建议或者答案将不胜感激。谢谢。
解决方案
规范参考是JVM规范。但是,不同的JVM可以以不同的方式实现规范。我们还可以签出开源Java平台实现OpenJDK。
我不确切知道它们如何执行其字节码,但我发现此链接描述了Java的字节码。我不确定它是否有帮助,但至少是可以开始的。
引用:
This article gives you an understanding of Java bytecode that will enable you to be a better programmer. Like a C or C++ compiler translates source code into assembler code, Java compilers translate Java source code into bytecode. Java programmers should take the time to understand what the bytecode is, how it works, and most importantly, what bytecode is being generated by the Java compiler. In some cases, the bytecode generated is not what you expect.
Sun在Web上有一篇很好的关于Java内存管理的文章,以PDF格式提供:
memorymanagement_whitepaper