Beispiel #1
0
 private Function createLdcClass() {
   Function fn = FunctionBuilder.ldcInternal(sootClass);
   Value info = getInfoStruct(fn);
   Value result = call(fn, BC_LDC_CLASS, fn.getParameterRef(0), info);
   fn.add(new Ret(result));
   return fn;
 }
 protected Value ldcClass(Function fn, String name, Value env) {
   if (isArray(name) && isPrimitiveBaseType(name)) {
     String primitiveDesc = name.substring(name.length() - 1);
     Variable result = fn.newVariable(OBJECT_PTR);
     fn.add(
         new Load(
             result,
             new ConstantBitcast(
                 new GlobalRef("array_" + primitiveDesc, CLASS_PTR),
                 new PointerType(OBJECT_PTR))));
     return result.ref();
   } else {
     FunctionRef ldcClassFn = null;
     if (name.equals(this.className)) {
       ldcClassFn = FunctionBuilder.ldcInternal(this.className).ref();
     } else {
       Trampoline trampoline = new LdcClass(this.className, name);
       trampolines.add(trampoline);
       ldcClassFn = trampoline.getFunctionRef();
     }
     return call(fn, ldcClassFn, env);
   }
 }