有时候为了能理解JVM对程序所做的优化等,需要查看程序的字节码,因此知道了解一些常见的指令集很重要!
| 指令码 |
助记符 |
说明 |
| 0x00 |
nop |
什么都不做 |
| 0x01 |
aconst_null |
将null推送至栈顶 |
| 0x02 |
iconst_m1 |
将int型-1推送至栈顶 |
| 0x03 |
iconst_0 |
将int型0推送至栈顶 |
| 0x04 |
iconst_1 |
将int型1推送至栈顶 |
| 0x05 |
iconst_2 |
将int型2推送至栈顶 |
| 0x06 |
iconst_3 |
将int型3推送至栈顶 |
| 0x07 |
iconst_4 |
将int型4推送至栈顶 |
| 0x08 |
iconst_5 |
将int型5推送至栈顶 |
| 0x09 |
lconst_0 |
将long型0推送至栈顶 |
| 0x0a |
lconst_1 |
将long型1推送至栈顶 |
| 0x0b |
fconst_0 |
将float型0推送至栈顶 |
| 0x0c |
fconst_1 |
将float型1推送至栈顶 |
| 0x0d |
fconst_2 |
将float型2推送至栈顶 |
| 0x0e |
dconst_0 |
将double型0推送至栈顶 |
| 0x0f |
dconst_1 |
将double型1推送至栈顶 |
| 0x10 |
bipush |
将单字节的常量值(-128~127)推送至栈顶 |
| 0x11 |
sipush |
将一个短整型常量值(-32768~32767)推送至栈顶 |
| 0x12 |
ldc |
将int, float或String型常量值从常量池中推送至栈顶 |
| 0x13 |
ldc_w |
将int, float或String型常量值从常量池中推送至栈顶(宽索引) |
| 0x14 |
ldc2_w |
将long或double型常量值从常量池中推送至栈顶(宽索引) |
| 0x15 |
iload |
将指定的int型本地变量推送至栈顶 |
| 0x16 |
lload |
将指定的long型本地变量推送至栈顶 |
| 0x17 |
fload |
将指定的float型本地变量推送至栈顶 |
| 0x18 |
dload |
将指定的double型本地变量推送至栈顶 |
| 0x19 |
aload |
将指定的引用类型本地变量推送至栈顶 |
| 0x1a |
iload_0 |
将第一个int型本地变量推送至栈顶 |
| 0x1b |
iload_1 |
将第二个int型本地变量推送至栈顶 |
| 0x1c |
iload_2 |
将第三个int型本地变量推送至栈顶 |
| 0x1d |
iload_3 |
将第四个int型本地变量推送至栈顶 |
| 0x1e |
lload_0 |
将第一个long型本地变量推送至栈顶 |
| 0x1f |
lload_1 |
将第二个long型本地变量推送至栈顶 |
| 0x20 |
lload_2 |
将第三个long型本地变量推送至栈顶 |
| 0x21 |
lload_3 |
将第四个long型本地变量推送至栈顶 |
| 0x22 |
fload_0 |
将第一个float型本地变量推送至栈顶 |
| 0x23 |
fload_1 |
将第二个float型本地变量推送至栈顶 |
| 0x24 |
fload_2 |
将第三个float型本地变量推送至栈顶 |
| 0x25 |
fload_3 |
将第四个float型本地变量推送至栈顶 |
| 0x26 |
dload_0 |
将第一个double型本地变量推送至栈顶 |
| 0x27 |
dload_1 |
本文探讨了理解JVM指令集的重要性,特别是在分析和优化程序执行时。通过了解常见的字节码指令,可以更好地洞察Java程序的运行机制。
最低0.47元/天 解锁文章
941

被折叠的 条评论
为什么被折叠?



