源代码为:

package com.test19;
public class Test04 {
	void spin(){
		int i;
		for(i=0;i<100;i++){
			;
		}
		i = 0;
	}
}

  

生成的class如下:

public class com.test19.Test04
  SourceFile: "Test04.java"
  minor version: 0
  major version: 51
  flags: ACC_PUBLIC, ACC_SUPER
Constant pool:
   #1 = Methodref          #3.#17         //  java/lang/Object."<init>":()V
   #2 = Class              #18            //  com/test19/Test04
   #3 = Class              #19            //  java/lang/Object
   #4 = Utf8               <init>
   #5 = Utf8               ()V
   #6 = Utf8               Code
   #7 = Utf8               LineNumberTable
   #8 = Utf8               LocalVariableTable
   #9 = Utf8               this
  #10 = Utf8               Lcom/test19/Test04;
  #11 = Utf8               spin
  #12 = Utf8               i
  #13 = Utf8               I
  #14 = Utf8               StackMapTable
  #15 = Utf8               SourceFile
  #16 = Utf8               Test04.java
  #17 = NameAndType        #4:#5          //  "<init>":()V
  #18 = Utf8               com/test19/Test04
  #19 = Utf8               java/lang/Object
{
  public com.test19.Test04();
    flags: ACC_PUBLIC
    Code:
      stack=1, locals=1, args_size=1
         0: aload_0
         1: invokespecial #1                  // Method java/lang/Object."<init>":()V
         4: return
      LineNumberTable:
        line 2: 0
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
               0       5     0  this   Lcom/test19/Test04;

  void spin();
    flags:
    Code:
      stack=2, locals=2, args_size=1
         0: iconst_0
         1: istore_1
         2: iload_1
         3: bipush        100
         5: if_icmpge     14
         8: iinc          1, 1
        11: goto          2
        14: iconst_0
        15: istore_1
        16: return
      LineNumberTable:
        line 5: 0
        line 9: 14
        line 10: 16
      LocalVariableTable:
        Start  Length  Slot  Name   Signature
               0      17     0  this   Lcom/test19/Test04;
               2      15     1     i   I
      StackMapTable: number_of_entries = 2
           frame_type = 252 /* append */
             offset_delta = 2
        locals = [ int ]
           frame_type = 11 /* same */

}

  

Code编码为: 

03 3C 1B 10 64 A2 00 09 84 01 01 A7 FF F7 03 3C B1

opcode [03] - 0000: iconst_0
opcode [3C] - 0001: istore_1
opcode [1B] - 0002: iload_1
opcode [10] - 0003: bipush 100
opcode [A2] - 0005: if_icmpge 9
opcode [84] - 0008: iinc 1 1 ; index const
opcode [A7] - 0011: goto -9
opcode [03] - 0014: iconst_0
opcode [3C] - 0015: istore_1
opcode [B1] - 0016: return

3   60  27  16   100

-94 0   9   -124 1

1  -89 -1   -9   -79

最新文章

  1. iOS GCD 编程小结
  2. JAVA数据转换常用方法
  3. ios面试(2015.10.30)
  4. MyBatis知多少(8)关系型数据库
  5. Python基础:序列
  6. 《黄聪:手机移动站SEO优化教程》1、为什么要做手机移动端网站
  7. 诡异的XmlSerializer属性字段Specified
  8. microsoft office visio基本使用方法
  9. Python学习入门基础教程(learning Python)--3.3.2 Python的关系运算
  10. IE8上传文件时javascript读取文件的本地路径的问题(&quot;C:\fakepath\&quot;)的解决方案
  11. 前端面试题(4)iframe有哪些优点?iframe缺点是什么?
  12. python的os.system函数的应用
  13. AI illustrator 如何裁剪图片(扣取局部区域)
  14. day23_雷神_git
  15. Linux中对逻辑卷进行扩容与缩小
  16. mybatis下载地址(所有版本)
  17. 12C -- ORA-01017
  18. Codeforces 785E. Anton and Permutation
  19. js 数组api
  20. Vue + Element UI 实现权限管理系统 (管理应用状态)

热门文章

  1. 笔记:CSS常用中文字体英文名称对照表
  2. ksplatform学习笔记
  3. function [eigf,eigv,dof]=laplaceeig(node,elem,problem)
  4. SpringMVC绑定到实体数组、list、set、和map时要注意
  5. 笔记本U盘安装CentOS 7
  6. jvm linux 时区设置
  7. jenkins调用本地搭建sendmail邮件服务器发送邮件
  8. JS——图片预览功能
  9. json--pyton中obj与json的互转,js中obj与json的互转
  10. WPF点滴(2) 创建单实例应用程序