Monday 15 February 2010

java - InvokeDynamic: Is it possible to pass call site bytecode to the bootstrap method and then execute it -


Assume I have a custom Java compiler or bytecode agent

Is it possible that I Would I like to pass the call site bytecode to my bootstrapping handler in such a way that I will not need to create a byte code inside the synthetic method to "host" an unknown class to create an anonymous class?

Once I have passed a bytecode, I want to execute it as much as possible in the upper part (assuming that I already have a stack for the bytecode for work and The local variable array has been found)

The way InquokeDynamic works is that the first instruction is executed That is, the proper bootstrap method is called. The callless object returned by the bootstrap method is executed on it and all subsequent calls to the instruction are implemented. The idea is that VM can handle it more efficiently than ad hoc methods from time to time.

However, it does not get around the requirement that all bytecocks should be killed inside a class. This is the way that JVM platform works. I'm not sure why you think there will be overhead to create a new class. It can be underlined as well as any other method. The issue of big concern is running out of space in memory allocated for code due to additional classes, but I believe that Java 7 also provides some library calls to help with it.

No comments:

Post a Comment