Integration of ASM 7 into the MVT
forax at univ-mlv.fr
Thu Jun 29 19:05:44 UTC 2017
(moving this discussion to valhalla-dev because it's not spec related)
So after discussing with Maurizio in private,
the plan is to do something perhaps less ambitious than what i was proposing :)
The version that the jdk uses is ASM 5.1 with a specific modification in order to recognize the constant pool constants related to the module descriptor.
Moving to ASM 7 is stricly not required to support the new v-opcodes, it can be done as a special branch compatible with ASM 5 with two caveats,
in ASM 5.2 we have modified some pseudo opcodes that ASM uses internally and because those are opcodes, this work need to be integrated before introducing the new v-opcodes, then in order to avoid to have two heads, the patch that introduces the constant pool constants related to the module support can be removed and replaced by the code from ASM 6 that also allows the support of module.
So i hope to soon propose a patch of the valhalla code that refactor the code of the JDK (apart from the ASM classes, i think the change should only modify the class jdk.internal.module.ClassFileAttributes, the package jdk.internal.module is nicely compartmentalized thanks to Alan Bateman) to align it with ASM without needing to migrate the JDK to ASM 6.
Once this groundwork is done, introducing the v-opcodes can be done using the same code in the JDK and in ASM 7, so early adopters can use ASM 7 in their project knowing that the JDK will share the same code and that modifications will be synchronous between the two projects.
----- Mail original -----
> De: "Remi Forax" <forax at univ-mlv.fr>
> À: valhalla-spec-experts at openjdk.java.net
> Envoyé: Samedi 24 Juin 2017 15:27:19
> Objet: Integration of ASM 7 into the MVT
> Hi all,
> re-reading the spec,
> i've remarked that it seems that the spec is a forked from the JVMS 8 and not
> JVMS 9.
> I'm planning to create an alpha release of ASM 7 by forking ASM 6 that does
> already implement the JVMS 9 (from the Java Platform Module Spec),
> i hope this is not an issue.
> Thinking a little more about that, there is an issue with integrating ASM 7 into
> the valhalla repository, currently the code inside the JDK relies on ASM 5.1
> and not ASM 6.
> The difference between ASM 6 and ASM 5 is that in ASM 5, the attribute "Module"
> is seen as an unknown attribute so ASM ask the user code to provide a
> description of the attribute, in ASM 6, ASM recognizes the attribute "Module"
> and redirect all the info to a specific ModuleVisitor, so before to be able to
> use ASM 7 with the new v-opcodes inside the JDK, i think that the JDK sources
> has to be updated to use ASM 6 first.
More information about the valhalla-dev