I am using ASM to insert a method after a special method. For example, a method as follows:
a.doSomeThing(p1, p2, p3, p4, p5, p6)
I want to insert a method follow it, just like this:
a.doSomeThing(p1, p2, p3, p4, p5, p6)
MyClass.myMethod(a, p1, p2, p3, p4, p5, p6) //insert a static method
The insert method has the same parameters as the previous one.
I know that when invoking virtual doSomeThing
, the values are at the top of the stack. How can I duplicate them, and use them for myMethod
?