コード例 #1
0
ファイル: Types.java プロジェクト: wynney/robovm
 @SuppressWarnings("unchecked")
 public static FunctionType getFunctionType(SootMethodRef methodRef) {
   Type returnType = getType(methodRef.returnType());
   Type[] paramTypes =
       new Type[(methodRef.isStatic() ? 1 : 2) + methodRef.parameterTypes().size()];
   int i = 0;
   paramTypes[i++] = ENV_PTR;
   if (!methodRef.isStatic()) {
     paramTypes[i++] = OBJECT_PTR;
   }
   for (soot.Type t : (List<soot.Type>) methodRef.parameterTypes()) {
     paramTypes[i++] = getType(t);
   }
   return new FunctionType(returnType, paramTypes);
 }
コード例 #2
0
 private SootMethodRef remapRef(SootMethodRef ref) {
   Type return_type = fixType(ref.returnType());
   List params = fixParameterList(ref.parameterTypes());
   int modifiers = Modifier.PUBLIC;
   if (ref.isStatic()) {
     modifiers += Modifier.STATIC;
   }
   SootMethod method = new SootMethod(ref.name(), params, return_type, modifiers);
   SootClass decl_class = ref.declaringClass();
   if (shouldMap(decl_class)) {
     decl_class = getMapping(decl_class);
   }
   method.setDeclaringClass(decl_class);
   return method.makeRef();
 }
コード例 #3
0
ファイル: Walker.java プロジェクト: safdariqbal/soot
  public void outAStaticInvokeExpr(AStaticInvokeExpr node) {
    List args;

    if (node.getArgList() != null) args = (List) mProductions.removeLast();
    else args = new ArrayList();

    SootMethodRef method = (SootMethodRef) mProductions.removeLast();
    method =
        Scene.v()
            .makeMethodRef(
                method.declaringClass(),
                method.name(),
                method.parameterTypes(),
                method.returnType(),
                true);

    mProductions.addLast(Jimple.v().newStaticInvokeExpr(method, args));
  }
コード例 #4
0
ファイル: Types.java プロジェクト: wynney/robovm
 @SuppressWarnings("unchecked")
 public static String getDescriptor(SootMethodRef methodRef) {
   return getDescriptor(methodRef.parameterTypes(), methodRef.returnType());
 }