Skip to content

Instantly share code, notes, and snippets.

@jponge
Created January 25, 2013 10:08
Show Gist options
  • Save jponge/4633250 to your computer and use it in GitHub Desktop.
Save jponge/4633250 to your computer and use it in GitHub Desktop.
class Const {
public void foo() {
final int x = 10;
int y = x;
}
public void bar() {
int x = 10;
int y = x;
}
}
Compiled from "Const.java"
class Const extends java.lang.Object
SourceFile: "Const.java"
minor version: 0
major version: 50
Constant pool:
const #1 = Method #3.#12; // java/lang/Object."<init>":()V
const #2 = class #13; // Const
const #3 = class #14; // java/lang/Object
const #4 = Asciz <init>;
const #5 = Asciz ()V;
const #6 = Asciz Code;
const #7 = Asciz LineNumberTable;
const #8 = Asciz foo;
const #9 = Asciz bar;
const #10 = Asciz SourceFile;
const #11 = Asciz Const.java;
const #12 = NameAndType #4:#5;// "<init>":()V
const #13 = Asciz Const;
const #14 = Asciz java/lang/Object;
{
Const();
Code:
Stack=1, Locals=1, Args_size=1
0: aload_0
1: invokespecial #1; //Method java/lang/Object."<init>":()V
4: return
LineNumberTable:
line 1: 0
public void foo();
Code:
Stack=1, Locals=3, Args_size=1
0: bipush 10
2: istore_2
3: return
LineNumberTable:
line 4: 0
line 5: 3
public void bar();
Code:
Stack=1, Locals=3, Args_size=1
0: bipush 10
2: istore_1
3: iload_1
4: istore_2
5: return
LineNumberTable:
line 7: 0
line 8: 3
line 9: 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment