Where can I find information about the bytecode generation


I’m developing a product which does some bytecode analysis.

I’ve got a ticket from a client which uses Kotlin and while trying to debug it, I see some unexpected behavior such as functions which are not visible while using “java -p”.

I’ll appreciate if you could give me some information about the bytecode generation process.


Which information do you need specifically? There is not much information outside of the compiler source code, but we’d be happy to answer specific questions.

Thanks for the quick response - I’ll have a look at the source code.
The issue is that I have a *.class file which as far I was able to understand includes a method which calls a closure. In this case, it seems like you omit the line number information for the closure?

Did I miss understand or is that intentional/bug?

Do you have the source code from which the .class was compiled? Note that Kotlin supports inline functions, and when a method calls an inline function, the code of the inline function and the code of the lambda passed to it will be compiled into the calling method. In that case, the lines from the inline function will have line numbers outside of the range of lines in the original source file, and the SMAP table will contain full information on the line number mapping between all source files involved.

There should be no cases when we simply omit the line number information.

I don’t have it, but I can check with the customer if he can share that with me.
As for the actual *.class files - will it help if I’ll share it with you?

Yes, I think I can take a look.

Hi Dmitry,

Sorry for my late reply - I’ve waited for an approval from my customer.
Unfortunately, they don’t want us to share this specific file due to IP issues, so I’ll have to close this ticket.

I really appreciate your responsiveness!

Best regards,