Java bytecode
来源:互联网 发布:97网络含义是什么 编辑:程序博客网 时间:2024/06/05 12:00
copy from : https://www.ibm.com/developerworks/library/it-haggar_bytecode/
The information about bytecode, as well as the bytecode presented here, is based on the Java 2 SDK Standard Edition v1.2.1 javac compiler. The bytecode generated by other compilers may vary slightly.
Why understand bytecode?
Bytecode is the intermediate representation of Java programs just as assembler is the intermediate representation of C or C++ programs. The most knowlegable C and C++ programmers know the assembler instruction set of the processor for which they are compiling. This knowledge is crucial when debugging and doing performance and memory usage tuning. Knowing the assembler instructions that are generated by the compiler for the source code you write, helps you know how you might code differently to achieve memory or performance goals. In addition, when tracking down a problem, it is often useful to use a debugger to disassemble the source code and step through the assembler code that is executing.
An often overlooked aspect of Java is the bytecode that is generated by the javac compiler. Understanding bytecode and what bytecode is likely to be generated by a Java compiler helps the Java programmer in the same way that knowledge of assembler helps the C or C++ programmer.
The bytecode is your program. Regardless of a JIT or Hotspot runtime, the bytecode is an important part of the size and execution speed of your code. Consider that the more bytecode you have, the bigger the .class file is and the more code that has to be compiled by a JIT or Hotspot runtime. The remainder of this article gives you an in depth look at Java bytecode.
Generating bytecode
1
2
javac Employee.java
javap -c Employee > Employee.bc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Compiled from Employee.java
class Employee extends java.lang.Object {
public Employee(java.lang.String,int);
public java.lang.String employeeName();
public int employeeNumber();
}
Method Employee(java.lang.String,int)
0 aload_0
1 invokespecial #3
- Java bytecode
- Java bytecode
- Java ByteCode
- java bytecode
- java bytecode
- Java bytecode
- java bytecode
- Java bytecode
- Java bytecode assembler : jasmin
- java bytecode security
- Java bytecode library
- Java ByteCode Part 1
- Java ByteCode Part 2
- Java bytecode instruction listings
- Java字节码(Java bytecode)
- Java bytecode edit tool set
- Instrumenting Java Bytecode with ASM
- Java bytecode: Understanding bytecode makes you a better programmer
- httpclient 4.5.2 学习随笔(1)
- Druid多数据源配置
- 如何切换多个GitHub账号,idea github 账号修改不生效
- Git误删本地master怎么办?
- Storm入门教程(一)
- Java bytecode
- kali下beef使用
- java序列化
- LAD gensim 主题分析
- 最近有感,试试微信公众号与博客互相推广
- windows7 下vmware workstation 12安装Ubuntu16.04虚拟机及安装和共享文件夹
- redis-cli 将内容写入文件中
- 记录一
- altium desing新建自定义PCB大小后,周围的白色部分怎么去掉?白色边框