for (int i = argList.length - 1; i >= 0; i--) {
int stackUsage = ins.stackConsumption();
InstructionList pList = il.createEmptyList();
boolean primitive = SignatureUtil.isPrimitive(paramTypes[i]);
Instruction pr_ins = null;
if (primitive) {
pr_ins = handlePrimitiveType(paramTypes[i], pList);
}
int insertIdx = pList.size();
// When stack usage is 1, we have reached an argument in stack
// while (stackUsage != 1) {
while ((stackUsage > 0 && ins.getOpcode() == Opcodes.INVOKESTATIC)||
(stackUsage > 1 && ins.getOpcode() == Opcodes.INVOKEVIRTUAL)) {
Instruction pIns = il.get(pIdx);
// System.out.println(">> pIdx: " + pIdx + ": " + pIns +
// ", stackusage: " + stackUsage);
stackUsage -= pIns.stackUsage();
// Insert pIns allways to same index. We are scanning
// Instructions backwards!
// System.out.println("Adding " + pIns + " to plist");
pList.insert(insertIdx, pIns);