Community
Participate
Working Groups
We need to support the module attribute in Disassembler as well. I started work on this sometime ago, mainly to add testcases for code gen, but stopped midway. It might be a good idea to wait for JVM specification before we add this support anyway
(In reply to Sasikanth Bharadwaj from comment #0) > It might be a good idea to wait for JVM specification > before we add this support anyway http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html#jigsaw-2.2 looks pretty complete to me (version from 2016/10/28). Would you need anything else from the VM spec?
(In reply to Markus Keller from comment #1) > (In reply to Sasikanth Bharadwaj from comment #0) > > It might be a good idea to wait for JVM specification > > before we add this support anyway > > http://cr.openjdk.java.net/~mr/jigsaw/spec/lang-vm.html#jigsaw-2.2 looks > pretty complete to me (version from 2016/10/28). Would you need anything > else from the VM spec? Nope, we do have the details we need. But considering that there have been changes in this area as recently as last month, unless someone really wants this, we will keep it in the back burner.
Jay, I can take a look at this if you want. Let me know what the ETA is.
New Gerrit change created: https://git.eclipse.org/r/100333
JVMS 4.7.25 now contains what we need here. IMHO, having these tests is now a high priority: I just noted what looks like a bug in javap (vs. all of JVMS, javac, ecj): JVMS: module_name_index The value of the module_name_index item must be a valid index into the constant_pool table. The constant_pool entry at that index must be a CONSTANT_Module_info structure denoting the current module. ecj: int moduleNameIndex = this.constantPool.literalIndexForModule(binding.moduleName); With this, javap barfs: Error: invalid index #6 If I change the above in ecj to int moduleNameIndex = this.constantPool.literalIndex(binding.moduleName); then javap is happy. In fact javap even rejects the output of javac regarding any module-info. In order to test things like this on our side, disassembler support is key. Since javap cannot be relied upon, our own disassembler should stand in.
(In reply to Stephan Herrmann from comment #5) > With this, javap barfs: > Error: invalid index #6 > > In fact javap even rejects the output of javac regarding any module-info. http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-July/013034.html
(In reply to Stephan Herrmann from comment #6) > (In reply to Stephan Herrmann from comment #5) > > With this, javap barfs: > > Error: invalid index #6 > > > > In fact javap even rejects the output of javac regarding any module-info. > > http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-July/013034.html That was a red herring.
The current Gerrit implements the first few entries in the Module attribute. It has only been tested manually, by opening a module-info.class file without source attachment. I'm confident that the implemented structure and the new APIs are right. The remaining gaps are marked with TODO comments in ModuleAttribute, IModuleAttribute, ClassFileReader, and Disassembler.
(In reply to Markus Keller from comment #8) > The current Gerrit implements the first few entries in the Module attribute. > It has only been tested manually, by opening a module-info.class file > without source attachment. > > I'm confident that the implemented structure and the new APIs are right. The > remaining gaps are marked with TODO comments in ModuleAttribute, > IModuleAttribute, ClassFileReader, and Disassembler. @Markus: I will take a stab at this to take this work forward.
Thanks Manoj. Feel free to make yourself the author of the Gerrit, or at least add an Also-by: in the footer.
(In reply to Markus Keller from comment #10) > Thanks Manoj. Feel free to make yourself the author of the Gerrit, or at > least add an Also-by: in the footer. Initial Idea was to submit it two parts - - wasn't aware of Also-by - would use this to make life simpler for combining both the parts and submit - thanks Markus!
New Gerrit change created: https://git.eclipse.org/r/101206
(In reply to Eclipse Genie from comment #12) > New Gerrit change created: https://git.eclipse.org/r/101206 abandoned as this was duplicated. The patch updated via the link in comment 4
(In reply to Eclipse Genie from comment #4) > New Gerrit change created: https://git.eclipse.org/r/100333 (Eclipse genie didn't post the commit here probably due to some bugzilla server issue?) Commit via http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=BETA_JAVA9&id=c1481bac406d75d14e6deeee7721d87f2f9b7275 unit tests pending [see bug 519558]
How about additional attributes from bug 516377?
(In reply to Stephan Herrmann from comment #15) > How about additional attributes from bug 516377? Assuming you mean MODULE_MAIN_CLASS and MODULE_PACKAGES, these are already implemented ( Disassembler:1150 neighbourhood)
(In reply to Manoj Palat from comment #16) > (In reply to Stephan Herrmann from comment #15) > > How about additional attributes from bug 516377? > > Assuming you mean MODULE_MAIN_CLASS and MODULE_PACKAGES, these are already > implemented ( Disassembler:1150 neighbourhood) Yep, that's what I meant. Cool it's already supported :)
New Gerrit change created: https://git.eclipse.org/r/115079
Gerrit change https://git.eclipse.org/r/115079 was merged to [master]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=c77a3b83faab088d8a0c371fd83ea4943e2d7db4
New Gerrit change created: https://git.eclipse.org/r/115497
Gerrit change https://git.eclipse.org/r/115497 was merged to [R4_7_maintenance]. Commit: http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=6c73d1a0910c9a1dc57b95c515fe65f08e4f8f42
Verified for 4.8 M5 using I20180123-2000 build
Verified for 4.7.3 using M20180215-0545