Also works for instructions whose stack effect depends on the
constant pool entry they reference.
return
Number of words consumed from stack by this instruction
String signature = getSignature(cpg);
Type[] args = Type.getArgumentTypes(signature);
int sum;
if(opcode == Constants.INVOKESTATIC)
sum = 0;
else
sum = 1; // this reference
int n = args.length;
for (int i = 0; i < n; i++)
sum += args[i].getSize();
return sum;