public int getStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg (2 for longs, doubles) String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++, stack--) if (long.class.getName().equals(params[i]) || double.class.getName().equals(params[i])) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; if (long.class.getName().equals(ret) || double.class.getName().equals(ret)) stack++; return stack; }
public int getStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg (2 for longs, doubles) String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++, stack--) if (long.class.getName().equals(params[i]) || double.class.getName().equals(params[i])) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; if (long.class.getName().equals(ret) || double.class.getName().equals(ret)) stack++; return stack; }
public int getLogicalStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; return stack; }
public int getLogicalStackChange() { String ret = getMethodReturnName(); if (ret == null) return 0; // subtract a stack pos for the this ptr int stack = 0; if (getOpcode() != Constants.INVOKESTATIC) stack--; // and for each arg String[] params = getMethodParamNames(); for (int i = 0; i < params.length; i++) stack--; // add for the return value, if any if (!void.class.getName().equals(ret)) stack++; return stack; }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public Class getMethodReturnType() { String type = getMethodReturnName(); if (type == null) return null; return Strings.toClass(type, getClassLoader()); }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public Class getMethodReturnType() { String type = getMethodReturnName(); if (type == null) return null; return Strings.toClass(type, getClassLoader()); }
public void enterMethodInstruction(MethodInstruction obj) { _out.print(obj.getMethodIndex() + " <" + obj.getMethodReturnName() + " " + obj.getMethodDeclarerName() + "." + obj.getMethodName() + "("); String[] params = obj.getMethodParamNames(); int dotIndex; for (int i = 0; i < params.length; i++) { dotIndex = params[i].lastIndexOf('.'); if (dotIndex != -1) params[i] = params[i].substring(dotIndex + 1); _out.print(params[i]); if (i != (params.length - 1)) _out.print(", "); } _out.print(")>"); }
public void enterMethodInstruction(MethodInstruction obj) { _out.print(obj.getMethodIndex() + " <" + obj.getMethodReturnName() + " " + obj.getMethodDeclarerName() + "." + obj.getMethodName() + "("); String[] params = obj.getMethodParamNames(); int dotIndex; for (int i = 0; i < params.length; i++) { dotIndex = params[i].lastIndexOf('.'); if (dotIndex != -1) params[i] = params[i].substring(dotIndex + 1); _out.print(params[i]); if (i != (params.length - 1)) _out.print(", "); } _out.print(")>"); }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public BCClass getMethodReturnBC() { String type = getMethodReturnName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Set the declaring type of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodDeclarer(String type) { return setMethod(type, getMethodName(), getMethodReturnName(), getMethodParamNames()); }
/** * Set the declaring type of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodDeclarer(String type) { return setMethod(type, getMethodName(), getMethodReturnName(), getMethodParamNames()); }
/** * Return the return type of the method this instruction operates on, * or null if not set. */ public BCClass getMethodReturnBC() { String type = getMethodReturnName(); if (type == null) return null; return getProject().loadClass(type, getClassLoader()); }
/** * Set the param types of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodParams(String[] types) { return setMethod(getMethodDeclarerName(), getMethodName(), getMethodReturnName(), types); }
/** * Set the name of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodName(String name) { return setMethod(getMethodDeclarerName(), name, getMethodReturnName(), getMethodParamNames()); }
/** * Set the name of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodName(String name) { return setMethod(getMethodDeclarerName(), name, getMethodReturnName(), getMethodParamNames()); }
/** * Set the param types of the method this instruction operates on. * * @return this instruction, for method chaining */ public MethodInstruction setMethodParams(String[] types) { return setMethod(getMethodDeclarerName(), getMethodName(), getMethodReturnName(), types); }
return false; s1 = getMethodReturnName(); s2 = ins.getMethodReturnName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false;
return false; s1 = getMethodReturnName(); s2 = ins.getMethodReturnName(); if (!(s1 == null || s2 == null || s1.equals(s2))) return false;
void read(Instruction orig) { super.read(orig); MethodInstruction ins = (MethodInstruction) orig; setMethod(ins.getMethodDeclarerName(), ins.getMethodName(), ins.getMethodReturnName(), ins.getMethodParamNames()); }
void read(Instruction orig) { super.read(orig); MethodInstruction ins = (MethodInstruction) orig; setMethod(ins.getMethodDeclarerName(), ins.getMethodName(), ins.getMethodReturnName(), ins.getMethodParamNames()); }