了解Java字节码和JVM [英] Learning about Java bytecode and the JVM

查看:91
本文介绍了了解Java字节码和JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最近的一个问题中,我最简单的回答强调了我对Java,JVM以及代码编译和运行方式的许多误解。这使我产生了将我的理解提升到较低水平的愿望。我对组装这样的低层次理解没有任何问题,如何字节码和JVM让我感到困惑。面向对象的代码如何在低级别上分解对我来说是丢失的。我想知道是否有人对如何了解JVM,字节码和Java的低级功能有任何建议。是否有任何实用程序允许您直接编写和运行字节码,因为我相信亲身体验某些东西是理解它的最佳方式?此外,我们将不胜感激地阅读有关该主题的建议。

In a recent question asked recently my simple minded answer highlighted many of my misconceptions about Java, the JVM, and how the code gets compiled and run. This has created a desire in me to take my understanding to a lower level. I have no problems with the low level understanding like assembly how ever bytecode and the JVM confound me. How object oriented code gets broken down on a low level is lost to me. I was wondering if anyone had any suggestion on how to learn about the JVM, bytecode and the lower level functioning of Java. Are there any utilities out there that allow you to write and run bytecode directly as I believe hands on experience with something is the best way to grow in understanding of it? Additionally and reading suggestions on this topic would be appreciated.

编辑:次要问题。所以我有一个小问题,答案给了我一个有趣的想法来了解jvm,写一个非常简单的语言如brainf ** k或Ook的合理性只是用一种可读的语法(也许我甚至可以开发它)最终支持oo)编译成字节码?这会是一次很好的学习经历吗?

Secondary question. So I have a kinda sub question, the answers gave me an interesting idea to learn about the jvm, what would the plausibility of writing a really simple language like brainf**k or Ook only in a readable syntax (maybe I could even develop it to support oo eventually) that compiles into bytecode be? Would that be a good learning experience?

推荐答案

建议阅读: JVM规范

你可能还想玩 BCEL - 还有其他库可以操作字节码,但这可能是最着名的。

You might also want to play with BCEL - there are other libraries around for manipulating bytecode, but that's probably the best known one.

这篇关于了解Java字节码和JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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