Java 类soot.jimple.ExitMonitorStmt 实例源码

项目:Sus    文件:BodyAnalysis.java   
private void checkSynchronizationStmt(Stmt sootStmt)
{
    if(sootStmt instanceof EnterMonitorStmt)
    {
        EnterMonitorStmt enterMonitorStmt = (EnterMonitorStmt)sootStmt;
        lockStack.add(0, enterMonitorStmt.getOp());
        expSecondExitMonitor = false;
    }
    else if(sootStmt instanceof ExitMonitorStmt)
    {
        if(!expSecondExitMonitor)
        {
            lockStack.remove(0);
            expSecondExitMonitor = true;
        } else
        {
            expSecondExitMonitor = false;
        }
    }
}
项目:JAADAS    文件:ConstraintCollector.java   
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    if (uses) {
        if (stmt.getOp() instanceof Local) {
            TypeVariable op = resolver.typeVariable((Local) stmt.getOp());

            op.addParent(resolver.typeVariable(RefType.v("java.lang.Object")));
        }
    }
}
项目:JAADAS    文件:TrapTransformer.java   
public Set<Unit> getUnitsWithMonitor(UnitGraph ug) {
    Set<Unit> unitsWithMonitor = new HashSet<Unit>();

    for (Unit head : ug.getHeads()) {
        List<Unit> workList = new ArrayList<Unit>();
        workList.add(head);
        Set<Unit> doneSet = new HashSet<Unit>();

        while (!workList.isEmpty()) {
            Unit curUnit = workList.remove(0);
            if (!doneSet.add(curUnit))
                continue;

            workList.addAll(ug.getSuccsOf(curUnit));

            // If this is an "entermonitor" construct,
            // we're in a monitor from now on
            if (curUnit instanceof EnterMonitorStmt)
                unitsWithMonitor.add(curUnit);
            // If we leave a monitor, we're out now
            else if (curUnit instanceof ExitMonitorStmt)
                continue;
            else {
                for (Unit pred : ug.getPredsOf(curUnit))
                    if (unitsWithMonitor.contains(pred))
                        unitsWithMonitor.add(curUnit);
            }
        }
    }

    // Get rid of the entermonitor statements themselves
    for (Iterator<Unit> it = unitsWithMonitor.iterator(); it.hasNext(); )
        if (it.next() instanceof EnterMonitorStmt)
            it.remove();

    return unitsWithMonitor;
}
项目:bixie    文件:SootStmtSwitch.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt arg0) {
    injectLabelStatements(arg0);        
    arg0.getOp().apply(this.valueswitch);
    this.valueswitch.getExpression();
    // TODO:

    this.inMonitor = false;
}
项目:jar2bpl    文件:SootStmtSwitch.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt arg0) {
    injectLabelStatements(arg0);        
    arg0.getOp().apply(this.valueswitch);
    this.valueswitch.getExpression();
    // TODO:

    this.inMonitor = false;
}
项目:gluon    文件:BehaviorAnalysis.java   
private void analyzeUnitExitMonitor(SootMethod method, UnitGraph cfg,
                                    ExitMonitorStmt unit)
{
    addUnitToEmptyProduction(unit,method);

    analyzeSuccessors(method,cfg,unit);
}
项目:gluon    文件:MonitorAnalysis.java   
private void analyzeUnit(SootMethod method, Unit unit, UnitGraph cfg,
                         StackNode<EnterMonitorStmt> stack)
{
    if (visited.contains(unit))
        return; /* Unit already taken care of */

    visited.add(unit);

    if (unit instanceof EnterMonitorStmt)
        stack=new StackNode<EnterMonitorStmt>(stack,(EnterMonitorStmt)unit);
    else if (unit instanceof ExitMonitorStmt
             && stack != null)
    {
        EnterMonitorStmt enter;

        enter=stack.element();

        if (!exitMon.containsKey(enter))
            exitMon.put(enter,new ArrayList<ExitMonitorStmt>(8));

        exitMon.get(enter).add((ExitMonitorStmt)unit);

        stack=stack.parent();
    }

    for (Unit succ: cfg.getSuccsOf(unit))
        analyzeUnit(method,succ,cfg,stack);
}
项目:FuzzDroid    文件:JimpleStmtVisitorImpl.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    throw new RuntimeException("todo");

}
项目:JAADAS    文件:StmtTemplatePrinter.java   
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    String varName = printValueAssignment(stmt.getOp(), "monitor");

    printStmt(stmt,varName);
}
项目:JAADAS    文件:UseChecker.java   
public void caseExitMonitorStmt(ExitMonitorStmt stmt)
{
    stmt.setOp(this.uv.visit(
        stmt.getOp(), RefType.v("java.lang.Object"), stmt));
}
项目:JAADAS    文件:ConstraintChecker.java   
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
}
项目:JAADAS    文件:ConstraintCollector.java   
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
}
项目:JAADAS    文件:StmtVisitor.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
       addInsn(buildMonitorInsn(stmt, Opcode.MONITOR_EXIT), stmt);
}
项目:JAADAS    文件:UnitThrowAnalysis.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt s) {
    result = result.add(mgr.ILLEGAL_MONITOR_STATE_EXCEPTION);
    result = result.add(mgr.NULL_POINTER_EXCEPTION);
    result = result.add(mightThrow(s.getOp()));
}
项目:jgs    文件:SecurityConstraintStmtSwitch.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    throwNotImplementedException(stmt.getClass(), stmt.toString());
}
项目:jgs    文件:AnnotationStmtSwitch.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    logger.fine("\n > > > Exit monitor statement identified < < <");
    valueSwitch.callingStmt = stmt;
    throw new NotSupportedStmtException("ExitMonitorStmt");
}
项目:jgs    文件:AnnotationStmtSwitch.java   
@Override
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    logger.fine("\n > > > Exit monitor statement identified < < <");
    throw new NotSupportedStmtException("ExitMonitorStmt");
}
项目:gluon    文件:MonitorAnalysis.java   
public MonitorAnalysis(Scene s)
{
    scene=s;
    visited=null;
    exitMon=new HashMap<EnterMonitorStmt,Collection<ExitMonitorStmt>>();
}
项目:gluon    文件:MonitorAnalysis.java   
public Collection<ExitMonitorStmt> getExitMonitor(EnterMonitorStmt enterMon)
{
    assert exitMon.containsKey(enterMon);

    return exitMon.get(enterMon);
}
项目:jgs    文件:SecurityLevelStmtSwitch.java   
/**
 * Method, which should process the given statement of type
 * {@link ExitMonitorStmt}, but is not implemented in the current version of
 * this method. If method will be called an exception is thrown.
 * 
 * @param stmt
 *            Statement that should be processed to check for security
 *            violations.
 * @see soot.jimple.StmtSwitch#caseExitMonitorStmt(soot.jimple.ExitMonitorStmt)
 * @throws UnimplementedSwitchException
 *             Method throws always this exception, because the method is
 *             not implemented.
 */
@Override
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    throw new SwitchException(getMsg("exception.analysis.switch.not_implemented",
                                     stmt.toString(),
                                     getSourceLine(),
                                     stmt.getClass().getSimpleName(),
                                     this.getClass().getSimpleName()));
}
项目:jgs    文件:AnnotationStmtSwitch.java   
/**
 * DOC
 * 
 * @see soot.jimple.StmtSwitch#caseExitMonitorStmt(soot.jimple.ExitMonitorStmt)
 */
@Override
public void caseExitMonitorStmt(ExitMonitorStmt stmt) {
    stmt.getOp().apply(valueSwitch);
}