+ String name = mr.name();
+ if (v instanceof InstanceInvokeExpr && isGladiator(mr.declaringClass())) {
+ InstanceInvokeExpr iie = (InstanceInvokeExpr)v;
+ List li = new LinkedList();
+ li.addAll(iie.getArgs());
+ LinkedList pl = new LinkedList();
+ pl.addAll(mr.parameterTypes());
+ if (mr.name().equals("<init>") && isGladiator(mr.declaringClass())) {
+ name = "$init";
+ li.remove(0);
+ pl.remove(0);
+ //pl.addFirst(body.getThisLocal());
+ }
+ pl.add(IntType.v());
+ li.add(viaLocal(iie.getBase(),body,s));
+ SootClass sc = mr.declaringClass();
+ name = sc.getShortName().substring(sc.getShortName().lastIndexOf('$')+1) + "$$" + name;
+ mr = Scene.v().makeMethodRef(getParent(sc),
+ name,
+ pl,
+ isGladiatorType(mr.returnType()) ? IntType.v() : mr.returnType(),
+ false);
+ ie = Jimple.v().newVirtualInvokeExpr(viaLocal(thisLocal(getParent(sc),body),body,s), mr, li);
+ vb.setValue(v = ie);
+ } else {
+ List l0 = mr.parameterTypes();
+ List l2 = new LinkedList();
+ for(Iterator it2 = l0.iterator(); it2.hasNext();) {
+ Type t = (Type)it2.next();
+ l2.add(isGladiatorType(t) ? IntType.v() : t);
+ }
+ mr = Scene.v().makeMethodRef(mr.declaringClass(),
+ mr.name(),
+ l2,
+ isGladiatorType(mr.returnType()) ? IntType.v() : mr.returnType(),
+ mr.isStatic());
+ ie.setMethodRef(mr);
+ vb.setValue(v = ie);