I am wondering whether it is possible to combine multiple java method bytecode sequences into one method. Assume we have a method A, which invokes another two method B1, and B2.
A bytecode sequences:
.....
invokevirtual B1
iload ..
....
invokevirtual B2
....
At runtime, B1 and B2 may be close correlated and we want to combine B1 bytecodes and B2 bytecodes, together with bytecodes between "invokevirtul B1" and "invokevirtual B2", into one method.
I am not sure whether it is possible to implement, I would appreciate if some clue can be provided. THanks.