Package soot

Examples of soot.Unit


    arg0.getOp().apply(m_valueSwitch);
    m_output.append(", "+m_oldValueFromMonitorStack.top()+");\n");
  }

  public void caseGotoStmt(GotoStmt arg0) {
    Unit target = arg0.getTarget();
    int label_num = m_parent.labelNum(target);
    m_output.append("goto label" + Integer.toString(label_num) + ";\n");
  }
View Full Code Here


  public void caseIfStmt(IfStmt arg0) {
    m_output.append("if (");
    arg0.getCondition().apply(m_valueSwitch);
    m_output.append(" ) goto label");
    Unit target = arg0.getTarget();
    int label_num = m_parent.labelNum(target);
    m_output.append(Integer.toString(label_num)+";\n");
  }
View Full Code Here

    m_output.append("switch(");
    arg0.getKey().apply(m_valueSwitch);
    m_output.append("){\n");
    List<IntConstant> values = arg0.getLookupValues();
    List<Unit> units = arg0.getTargets();
    Unit default_target = arg0.getDefaultTarget();
   
    int label_num;
   
    for(int i = 0; i < values.size(); ++i){
      m_output.append("case ");
View Full Code Here

    for(int i = arg0.getLowIndex(); i < arg0.getHighIndex(); ++i){
      values.add(IntConstant.v(i))
    }
   
    List<Unit> units = arg0.getTargets();
    Unit default_target = arg0.getDefaultTarget();
   
    int label_num;
   
    for(int i = 0; i < values.size(); ++i){
      m_output.append("case ");
View Full Code Here

    m_TrapNum = trap_num;
    m_TryUnits = new ArrayList<Unit>();
    boolean found_start = false;
    boolean found_end = false;
    while(iter.hasNext()){
      Unit next = iter.next();
      if(t.getBeginUnit().equals(next)){
        found_start = true;
      }
      if(t.getEndUnit().equals(next)){
        found_end = true;
View Full Code Here

  }

  public void addGoto(String target_label){
    UnitBox target = m_jimple.newStmtBox(null);
    addLabelToUnitBox(target_label, target);
    Unit u = m_jimple.newGotoStmt(target);
    add(u);
  }
View Full Code Here

    for(int i = 0; i < m_labels.size(); ++i){
      List<String> labelset = m_labels.get(i);
      if(labelset.size() == 0)
        continue;

      Unit target = m_inputUnits.get(i);
      for(String label : labelset){
        List<UnitBox> boxes = m_labelToUnitBoxMap.get(label);
        if(boxes == null){
          System.out.println("Cannot find boxes for label.  This could be caused by classes other than the BytecodeLanguage using the assembler and is not a fatal error.");
          continue;
View Full Code Here

  public Set<SootMethod> findForBody(Body body) {
    Set<SootMethod> methods = new LinkedHashSet<SootMethod>();   
    PatchingChain<Unit> chain = body.getUnits();
    Iterator<Unit> iter = chain.iterator();
    while(iter.hasNext()){
      Unit unit = iter.next();
      List<ValueBox> vboxes = unit.getUseAndDefBoxes();
      for(ValueBox vbox : vboxes){
        Value value = vbox.getValue();
        if(value instanceof InvokeExpr == false)
          continue;
        InvokeExpr expr = (InvokeExpr) value;
View Full Code Here

  }

  private void inspectBody(Body body) {
    Iterator<Unit> iter = body.getUnits().iterator();
    while(iter.hasNext()){
      Unit curr = iter.next();
      if(curr instanceof AssignStmt == false)
        continue;
     
      AssignStmt assign = (AssignStmt) curr;
      Value lhs = assign.getLeftOp();
View Full Code Here

    return null;
  }

  void copyTargets(){
    for(int i = 0; i < m_inputUnits.size(); ++i){
      Unit input = m_inputUnits.get(i);
      Unit output = m_outputUnits.get(i);
      List<UnitBox> input_boxes = input.getUnitBoxes();
      List<UnitBox> output_boxes = output.getUnitBoxes();
      for(int j = 0; j < input_boxes.size(); ++j){
        UnitBox input_box = input_boxes.get(j);
        UnitBox output_box = output_boxes.get(j);

        Unit input_target = input_box.getUnit();
        //using the addIf method makes targets null
        if(input_target == null)
          continue;
       
        int target_i = findTarget(input_target);
View Full Code Here

TOP

Related Classes of soot.Unit

Copyright © 2018 www.massapicom. 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.