package hello; public class App { public static void main(String[] args) { System.out.println("Hello world!"); } }
0000000 ca fe ba be 00 00 00 34 00 1d 0a 00 06 00 0f 09 0000010 00 10 00 11 08 00 12 0a 00 13 00 14 07 00 15 07 0000020 00 16 01 00 06 3c 69 6e 69 74 3e 01 00 03 28 29 0000030 56 01 00 04 43 6f 64 65 01 00 0f 4c 69 6e 65 4e 0000040 75 6d 62 65 72 54 61 62 6c 65 01 00 04 6d 61 69 0000050 6e 01 00 16 28 5b 4c 6a 61 76 61 2f 6c 61 6e 67 0000060 2f 53 74 72 69 6e 67 3b 29 56 01 00 0a 53 6f 75 0000070 72 63 65 46 69 6c 65 01 00 08 41 70 70 2e 6a 61 0000080 76 61 0c 00 07 00 08 07 00 17 0c 00 18 00 19 01 0000090 00 0c 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 07 00 00000a0 1a 0c 00 1b 00 1c 01 00 09 68 65 6c 6c 6f 2f 41 00000b0 70 70 01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 4f 00000c0 62 6a 65 63 74 01 00 10 6a 61 76 61 2f 6c 61 6e 00000d0 67 2f 53 79 73 74 65 6d 01 00 03 6f 75 74 01 00 00000e0 15 4c 6a 61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 00000f0 74 72 65 61 6d 3b 01 00 13 6a 61 76 61 2f 69 6f 0000100 2f 50 72 69 6e 74 53 74 72 65 61 6d 01 00 07 70 0000110 72 69 6e 74 6c 6e 01 00 15 28 4c 6a 61 76 61 2f 0000120 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 29 56 00 21 0000130 00 05 00 06 00 00 00 00 00 02 00 01 00 07 00 08 0000140 00 01 00 09 00 00 00 1d 00 01 00 01 00 00 00 05 0000150 2a b7 00 01 b1 00 00 00 01 00 0a 00 00 00 06 00 0000160 01 00 00 00 03 00 09 00 0b 00 0c 00 01 00 09 00 0000170 00 00 25 00 02 00 01 00 00 00 09 b2 00 02 12 03 0000180 b6 00 04 b1 00 00 00 01 00 0a 00 00 00 0a 00 02 0000190 00 00 00 06 00 08 00 07 00 01 00 0d 00 00 00 02 00001a0 00 0e 00001a2
ca fe ba be
00 00
00 34
00 1d
0a
00 06
00 0f
09
00 10
00 11
08
CONSTANT_String_info { u1 tag; u2 string_index; }
00 12
0a
00 13
00 14
07
00 15
07
00 16
01
00 06
3c 69 6e 69 74 3e
01
00 03 28 29 56
01
00 04 43 6f 64 65
01 00 0f 4c 69 6e 65 4e 75 6d 62 65 72 54 61 62 6c 65
01 00 04 6d 61 69 6e
01 00 16 28 5b 4c 6a 61 76 61 2f 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 29 56
01 00 0a 53 6f 75 72 63 65 46 69 6c 65
01 00 08 41 70 70 2e 6a 61 76 61
0c
00 07
00 08
07
00 17
0c 00 18 00 19
01 00 0c 48 65 6c 6c 6f 20 77 6f 72 6c 64 21
07 00 1a
0c 00 1b 00 1c
01 00 09 68 65 6c 6c 6f 2f 41 70 70
01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 4f 62 6a 65 63 74
01 00 10 6a 61 76 61 2f 6c 61 6e 67 2f 53 79 73 74 65 6d
01 00 03 6f 75 74
01 00 15 4c 6a 61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 74 72 65 61 6d 3b
01 00 13 6a 61 76 61 2f 69 6f 2f 50 72 69 6e 74 53 74 72 65 61 6d
01 00 07 70 72 69 6e 74 6c 6e
01 00 15 28 4c 6a 61 76 61 2f 6c 61 6e 67 2f 53 74 72 69 6e 67 3b 29 56
00 21
00 05
00 06
00 00 // interfaces_count 00 00 // fields_count
00 02
00 01 - access_flags 00 07 - name_index 00 08 - descriptor_index 00 01 - attributes_count
00 09 // name_index (Code) 00 00 00 1d // attribute_length 00 01 // max_stack 00 01 // max_locals 00 00 00 05 // code_length
2a // aload_0 b7 00 01 // invokespecial ( constant_pool) b1 // return
00 00 // exception_table_length 00 01 // attributes_count 00 0a // attribute_name_index (LineNumberTable - 10 ) 00 00 00 06 // attribute_length 00 01 // line_number_table_length 00 00 // start_pc 00 03 // line_number
00 09 // access_flags 00 0b // name_index 00 0c // descriptor_index 00 01 // atributes_count
00 09 // name_index (Code) 00 00 00 25 // attribute_length 00 02 // max_stack 00 01 // max_locals 00 00 00 09 // code_length
b2 00 02 // getstatic 2, java.lang.System 12 03 // ldc 3 b6 00 04 // invokevirtual 4 b1 // return
00 00 // exception_table_length 00 01 // attributes_count 00 0a // attribute_name_index (LineNumberTable - 10 ) 00 00 00 0a // attribute_length 00 02 // line_nuber_table_length 00 00 // start_pc 00 06 // line_number 00 08 // start_pc 00 07 // line_number
00 01 // attributes_count 00 0d // name_index (SourceFile) 00 00 00 02 // attributes_length 00 0e // sourcefile_index(App.java)
Classfile /.../classes/hello/App.class Last modified Aug 14, 2015; size 418 bytes MD5 checksum e9d96126a9f5bbd95f154f1a40d46b53 Compiled from "App.java" public class hello.App minor version: 0 major version: 52 flags: ACC_PUBLIC, ACC_SUPER Constant pool: #1 = Methodref #6.#15 // java/lang/Object."<init>":()V #2 = Fieldref #16.#17 // java/lang/System.out:Ljava/io/PrintStream; #3 = String #18 // Hello world! #4 = Methodref #19.#20 // java/io/PrintStream.println:(Ljava/lang/String;)V #5 = Class #21 // hello/App #6 = Class #22 // java/lang/Object #7 = Utf8 <init> #8 = Utf8 ()V #9 = Utf8 Code #10 = Utf8 LineNumberTable #11 = Utf8 main #12 = Utf8 ([Ljava/lang/String;)V #13 = Utf8 SourceFile #14 = Utf8 App.java #15 = NameAndType #7:#8 // "<init>":()V #16 = Class #23 // java/lang/System #17 = NameAndType #24:#25 // out:Ljava/io/PrintStream; #18 = Utf8 Hello world! #19 = Class #26 // java/io/PrintStream #20 = NameAndType #27:#28 // println:(Ljava/lang/String;)V #21 = Utf8 hello/App #22 = Utf8 java/lang/Object #23 = Utf8 java/lang/System #24 = Utf8 out #25 = Utf8 Ljava/io/PrintStream; #26 = Utf8 java/io/PrintStream #27 = Utf8 println #28 = Utf8 (Ljava/lang/String;)V { public hello.App(); descriptor: ()V 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 3: 0 public static void main(java.lang.String[]); descriptor: ([Ljava/lang/String;)V flags: ACC_PUBLIC, ACC_STATIC Code: stack=2, locals=1, args_size=1 0: getstatic #2 // Field java/lang/System.out:Ljava/io/PrintStream; 3: ldc #3 // String Hello world! 5: invokevirtual #4 // Method java/io/PrintStream.println:(Ljava/lang/String;)V 8: return LineNumberTable: line 6: 0 line 7: 8 } SourceFile: "App.java"
ClassFile(InputStream in, Attribute.Factory attributeFactory) throws IOException, ConstantPoolException { ClassReader cr = new ClassReader(this, in, attributeFactory); magic = cr.readInt(); minor_version = cr.readUnsignedShort(); major_version = cr.readUnsignedShort(); constant_pool = new ConstantPool(cr); access_flags = new AccessFlags(cr); this_class = cr.readUnsignedShort(); super_class = cr.readUnsignedShort(); int interfaces_count = cr.readUnsignedShort(); interfaces = new int[interfaces_count]; for (int i = 0; i < interfaces_count; i++) interfaces[i] = cr.readUnsignedShort(); int fields_count = cr.readUnsignedShort(); fields = new Field[fields_count]; for (int i = 0; i < fields_count; i++) fields[i] = new Field(cr); int methods_count = cr.readUnsignedShort(); methods = new Method[methods_count]; for (int i = 0; i < methods_count; i++) methods[i] = new Method(cr); attributes = new Attributes(cr); }
Source: https://habr.com/ru/post/264919/
All Articles