Issue #ClassFileModuleName
Remi Forax
forax at univ-mlv.fr
Sat Aug 27 22:30:40 UTC 2016
Hi everybody,
I've just updated ASM 6 to the new version of the class file format, which fix issue #ClassFileAccPublic [1] and part of #StandardModuleAttributes [2].
The API is not too bad, see an example at the end of this mail.
Can we move and fix the last two issues related to the class file format ?
#ClassFileModuleName: i've proposed to fix by introducing an index (u2) at the start of the Module that point to the module name encoded in the constant pool as an UTF8.
#ClassFileAccModule: just choose between 0x0040 and 0x0080 and call it a day.
regards,
Rémi
[1] http://openjdk.java.net/projects/jigsaw/spec/issues/#ClassFileAccPublic
[2] http://openjdk.java.net/projects/jigsaw/spec/issues/#StandardModuleAttributes
[3] http://openjdk.java.net/projects/jigsaw/spec/issues/#ClassFileModuleName
[4] http://openjdk.java.net/projects/jigsaw/spec/issues/#ClassFileAccModule
How to create a module-info.class with ASM6:
ClassWriter writer = new ClassWriter(0);
writer.visit(Opcodes.V1_9, Opcodes.ACC_MODULE, "genmodule/module-info", null, null, null);
ModuleVisitor module = writer.visitModule();
module.visitVersion("1.0.0");
module.visitMainClass("org/objectweb/asm/FunMain");
module.visitTargetPlatform("MyOS", null, "3.4");
module.visitConcealedPackage("org/objectweb/asm/concealed");
module.visitConcealedPackage("org/objectweb/asm/concealed2");
module.visitRequire("asm.fun", Opcodes.ACC_TRANSITIVE);
module.visitRequire("asm.static", Opcodes.ACC_STATIC_PHASE);
module.visitRequire("asm.foo", 0);
module.visitExport("org/objectweb/asm", 0, (String[])null);
module.visitExport("org/objectweb/asm/util", Opcodes.ACC_DYNAMIC_PHASE, "java.base", "java.sql");
module.visitUse("org/objectweb/asm/FunInterface");
module.visitProvide("org/objectweb/asm/FunInterface", "org/objectweb/asm/FunImpl");
module.visitEnd();
writer.visitEnd();
More information about the jpms-spec-experts
mailing list