Package soot

Examples of soot.SootMethod.makeRef()


            body.getLocals().add(tokenLocal);
            units.insertBefore(Jimple.v().newAssignStmt(tokenLocal,
                    Jimple.v().newNewExpr(RefType.v(tokenClass))), insertPoint);
            units.insertBefore(Jimple.v().newInvokeStmt(
                    Jimple.v().newSpecialInvokeExpr(tokenLocal,
                            tokenConstructor.makeRef())), insertPoint);
            return tokenLocal;
        } else if (token instanceof IntToken) {
            Local tokenLocal = _buildConstantTokenLocal(body, insertPoint,
                    localName, intTokenClass, intTokenConstructor, IntConstant
                            .v(((IntToken) token).intValue()));
View Full Code Here


            units.insertBefore(Jimple.v().newAssignStmt(complexLocal,
                    Jimple.v().newNewExpr(RefType.v(complexClass))),
                    insertPoint);
            units.insertBefore(Jimple.v().newInvokeStmt(
                    Jimple.v().newSpecialInvokeExpr(complexLocal,
                            complexConstructor.makeRef(),
                            DoubleConstant.v(complex.real),
                            DoubleConstant.v(complex.imag))), insertPoint);

            Local tokenLocal = _buildConstantTokenLocal(body, insertPoint,
                    localName, complexTokenClass, complexTokenConstructor,
View Full Code Here

            body.getLocals().add(tokenLocal);
            units.insertBefore(Jimple.v().newAssignStmt(tokenLocal,
                    Jimple.v().newNewExpr(RefType.v(tokenClass))), insertPoint);
            units.insertBefore(Jimple.v().newInvokeStmt(
                    Jimple.v().newSpecialInvokeExpr(tokenLocal,
                            tokenConstructor.makeRef(),
                            StringConstant.v(token.toString()))), insertPoint);
            return tokenLocal;
        }
    }
View Full Code Here

                SootMethod typeConstructor = SootUtilities
                        .searchForMethodByName(baseTypeClass, "forName");
                units.insertBefore(Jimple.v().newAssignStmt(
                        typeLocal,
                        Jimple.v().newStaticInvokeExpr(
                                typeConstructor.makeRef(),
                                StringConstant.v(type.toString()))),
                        insertPoint);
            }

            return typeLocal;
View Full Code Here

            units.insertBefore(Jimple.v().newAssignStmt(typeLocal,
                    Jimple.v().newNewExpr(RefType.v(arrayTypeClass))),
                    insertPoint);
            units.insertBefore(Jimple.v().newInvokeStmt(
                    Jimple.v().newSpecialInvokeExpr(typeLocal,
                            typeConstructor.makeRef(), elementTypeLocal)),
                    insertPoint);
            return typeLocal;
        } else if (type instanceof ptolemy.data.type.RecordType) {
            ptolemy.data.type.RecordType recordType = (ptolemy.data.type.RecordType) type;
View Full Code Here

            SootMethod typeConstructor = SootUtilities.searchForMethodByName(
                    recordTypeClass, "<init>");
            System.out.println("typeConstructor = " + typeConstructor);
            units.insertBefore(Jimple.v().newInvokeStmt(
                    Jimple.v().newSpecialInvokeExpr(typeLocal,
                            typeConstructor.makeRef(), labelArrayLocal,
                            typeArrayLocal)), insertPoint);
            return typeLocal;
        } else if (type instanceof ptolemy.data.type.FixType) {
            Local typeLocal = Jimple.v().newLocal("type_fix",
                    RefType.v(fixTypeClass));
View Full Code Here

            SootMethod typeConstructor = SootUtilities.searchForMethodByName(
                    functionTypeClass, "<init>");
            System.out.println("typeConstructor = " + typeConstructor);
            units.insertBefore(Jimple.v().newInvokeStmt(
                    Jimple.v().newSpecialInvokeExpr(typeLocal,
                            typeConstructor.makeRef(), typeArrayLocal,
                            returnTypeLocal)), insertPoint);
            return typeLocal;
        }

        throw new RuntimeException("Unidentified type class = "
View Full Code Here

                    + " for class " + objectClass + "( " + container + ", \""
                    + name + "\")");
        }

        units.add(Jimple.v().newInvokeStmt(
                Jimple.v().newSpecialInvokeExpr(local, constructor.makeRef(),
                        args)));
        return local;
    }

    /** Create a constructor in theClass that has the same signature
View Full Code Here

                        Jimple.v().newNewExpr(exceptionType)), unit);
        body.getUnits().insertBefore(
                Jimple.v()
                        .newInvokeStmt(
                                Jimple.v().newSpecialInvokeExpr(local,
                                        initMethod.makeRef(),
                                        StringConstant.v(string))), unit);
        return local;
    }

    /** Create a new static class that will behave identically to the
View Full Code Here

                    // Create a new two-argument constructor.
                    InstanceInvokeExpr expr = (InstanceInvokeExpr) r;
                    stmt.getInvokeExprBox().setValue(
                            Jimple.v().newSpecialInvokeExpr(
                                    (Local) expr.getBase(),
                                    constructorWithoutToken.makeRef(),
                                    r.getArg(0), r.getArg(1)));
                }
            }
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.