The document discusses minimizing the size of a Java "Hello World" class file. It begins by creating a simple "Hello World" Java class that prints the message, which compiles to a 408 byte class file. The document then explores using Jasmin assembler to reduce the size to 303 bytes by removing the constructor. It analyzes the class file format and constant pool, identifying the constant pool as the dominant size component in small programs. The document proposes ways to further minimize the class file size by reducing the constant pool, such as removing the SourceFile attribute.
7. .class ファイルのiみ圭
Java Virtual Machine Speci?cation,
4. The class File Format
ClassFile {
u4 magic;
u2 minor_version;
u2 major_version;
u2 constant_pool_count;
cp_info constant_pool[constant_pool_count-1];
u2 access_flags;
u2 this_class;
u2 super_class;
u2 interfaces_count;
u2 interfaces[interfaces_count];
u2 fields_count;
field_info fields[fields_count];
u2 methods_count;
method_info methods[methods_count];
u2 attributes_count;
attribute_info attributes[attributes_count];
}
枠^に4bytes マジック
肝の2bytesが?
マイナ`バ`ジョン
參和揖に