Package org.candle.decompiler.intermediate.graph.edge

Examples of org.candle.decompiler.intermediate.graph.edge.IntermediateEdge


  }
 
  protected void updateEdges(WhileIntermediate wi) {
    List<AbstractIntermediate> predecessors = igc.getPredecessors(wi);
    for(AbstractIntermediate predecessor : predecessors) {
      IntermediateEdge ie = igc.getGraph().getEdge(predecessor, wi);
      igc.validateBackEdge(ie);
    }
    List<AbstractIntermediate> successors = igc.getSuccessors(wi);
    for(AbstractIntermediate successor : successors) {
      IntermediateEdge ie = igc.getGraph().getEdge(wi, successor);
      igc.validateBackEdge(ie);
    }
  }
View Full Code Here


  public AbstractIntermediate getTrueTarget(BooleanBranchIntermediate ci) {
    //find true edge...
    List<AbstractIntermediate> successors = getSuccessors(ci);
   
    for(AbstractIntermediate successor : successors) {
      IntermediateEdge ie  = graph.getEdge(ci, successor);
     
      if(ie instanceof ConditionEdge) {
        if(((ConditionEdge) ie).isCondition()) {
          return successor;
        }
View Full Code Here

  public AbstractIntermediate getFalseTarget(BooleanBranchIntermediate ci) {
    //find true edge...
        List<AbstractIntermediate> successors = getSuccessors(ci);
       
        for(AbstractIntermediate successor : successors) {
          IntermediateEdge ie  = graph.getEdge(ci, successor);
         
          if(ie instanceof ConditionEdge) {
            //false condition
            if(!((ConditionEdge) ie).isCondition()) {
              return successor;
View Full Code Here

      int t2 = ceg.getHandlerPC().getPosition();
     
      InstructionHandle source = ivc.get(t1);
      InstructionHandle target = ivc.get(t2);

      IntermediateEdge ie = new IntermediateEdge();
      addExceptionHandle(ie, ceg);
      ie.setType(EdgeType.EXCEPTION);
      igc.getGraph().addEdge(source, target, ie);
    }
  }
View Full Code Here

    if(preds.size() < 2) {
      return;
    }
   
    for(InstructionHandle pred : preds) {
      IntermediateEdge ie = igc.getGraph().getEdge(pred, ih);
     
      if(ie.getType() == EdgeType.BACK) {
        LOG.debug("Has back edge.");
        splitLoopHeader(ih);
        break;
      }
    }
View Full Code Here

    System.out.println(duplicate);
   
   
    List<InstructionHandle> preds = Graphs.predecessorListOf(igc.getGraph(), ih);
    for(InstructionHandle pred : preds) {
      IntermediateEdge ie = igc.getGraph().getEdge(pred, ih);
     
      IntermediateEdge in = igc.getGraph().addEdge(pred, duplicate);
      in.setType(ie.getType());
     
      //now remove the original edge.
      igc.getGraph().removeEdge(ie);
    }
View Full Code Here

      TreeSet<InstructionHandle> orderedSuccessors = new TreeSet<InstructionHandle>(new InstructionComparator());
      orderedSuccessors.addAll(successors);
     
      if(successors.size() == 2) {
        //lowest will be true condition....
        IntermediateEdge truePath = igc.getGraph().getEdge(ih, orderedSuccessors.first());
        ConditionEdge trueCondition = createConditionalEdge(truePath, true);
        igc.getGraph().removeEdge(truePath);
        igc.getGraph().addEdge(ih, orderedSuccessors.first(), trueCondition);
       
        //highest will be false condition....
        IntermediateEdge falsePath = igc.getGraph().getEdge(ih, orderedSuccessors.last());
        ConditionEdge falseCondition = createConditionalEdge(falsePath, false);
        igc.getGraph().removeEdge(falsePath);
        igc.getGraph().addEdge(ih, orderedSuccessors.last(), falseCondition);
      }
    }
View Full Code Here

  @Override
  public void process(InstructionHandle ih) {
    List<InstructionHandle> successors = Graphs.successorListOf(igc.getGraph(), ih);
   
    for(InstructionHandle successor : successors) {
      IntermediateEdge ie = igc.getGraph().getEdge(ih, successor);
     
      //color back...
      int t1 = ih.getPosition();
      int t2 = successor.getPosition();
     
      if(t2 < t1) {
        ie.setType(EdgeType.BACK);
      }
     
    }
  }
View Full Code Here

    if(preds.size() < 2) {
      return;
    }
   
    for(InstructionHandle pred : preds) {
      IntermediateEdge ie = igc.getGraph().getEdge(pred, ih);
     
      if(ie.getType() == EdgeType.BACK) {
        if(!igc.hasIntermediate(ih)) {
          //this is probably a while(true);
          ContinuousWhileIntermediate cwi = new ContinuousWhileIntermediate(ih);
          igc.addIntermediate(ih, cwi);
          break;
View Full Code Here

  public void redirectPredecessors(T source, T target) {
    List<T> predecessors = Graphs.predecessorListOf(this.graph, source);
   
    //remove edges between predecessor and source.
    for(T p : predecessors) {
      IntermediateEdge existing = graph.getEdge(p, source);
      redirectEnd(existing, target);
    }
  }
View Full Code Here

TOP

Related Classes of org.candle.decompiler.intermediate.graph.edge.IntermediateEdge

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.