The Assembler and CodeBuffer classes supply CodeComment / block_comment() functionality, which does not work with stubs. The comments are not printed with +PrintStubCode or +PrintInterpreter because the comments are lost when the code is turned into a Stub, while they are kept if the code is copied to a CodeBlob.
I propose to add this fix to the OpenJDK mainline. A webrev can be found here:
Basically the change passes the codeBuffer to the Stub constructor, and adapts the disassembler to print the comments.
In the debug build the InterpreterCodelet Stub has a new field holding the code comments.
I also added some ttyLocks and \\ns to beautify the output.
Thank you and best regards,