Package edu.cmu.cs.fusion.alias

Examples of edu.cmu.cs.fusion.alias.AliasDelta


      relDeltas.add(deltas.fst());
      aliasDeltas.add(deltas.snd());
    }
   
    RelationshipDelta relDelta;
    AliasDelta aliasDelta;
   
    //try to avoid calling joins
    if (relDeltas.isEmpty()) {
      relDelta = new RelationshipDelta();
      aliasDelta = new AliasDelta();
    }
    else if (relDeltas.size() == 1) {
      relDelta = relDeltas.get(0);
      aliasDelta = aliasDeltas.get(0);
    }
View Full Code Here


  protected Pair<RelationshipDelta, AliasDelta> runSingleConstraint(FusionEnvironment<?> env,
      Constraint cons, TACInstruction instr) {
    ConsList<Binding> boundVars = cons.getOp().matches(types, method, instr);
   
    if (boundVars == null)
      return new Pair<RelationshipDelta, AliasDelta>(new RelationshipDelta(), new AliasDelta());
   
    List<RelationshipDelta> relDeltas = new LinkedList<RelationshipDelta>();
    List<Substitution> changeSubs = new LinkedList<Substitution>();
    List<Substitution> subs = env.findLabels(boundVars, cons.getUniversalFreeVars());
   
    for (Substitution sub : subs) {
      Pair<RelationshipDelta, Substitution> deltas = runFullyBound(env, sub, cons);
      relDeltas.add(deltas.fst());
      changeSubs.add(deltas.snd());
    }
   
    RelationshipDelta relDelta;
    AliasDelta aliasDelta;
     
    if (relDeltas.isEmpty()) {
      relDelta = RelationshipDelta.getTrueBottom();
      aliasDelta = new AliasDelta();
    }
    else if (relDeltas.size() == 1) {
      relDelta = relDeltas.get(0);
      aliasDelta = new AliasDelta(boundVars, changeSubs);
    }
    else {
      relDelta = RelationshipDelta.join(relDeltas);
      aliasDelta = new AliasDelta(boundVars, changeSubs);
    }
     
    return new Pair<RelationshipDelta, AliasDelta>(relDelta, aliasDelta);
  }
View Full Code Here

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, AliasDelta> deltas = runSingleConstraint(env, cons, instr);
    FusionErrorReport error = checkSingleConstraint(env, cons, instr);
   
    assertEquals(0, deltas.fst().numberOfChanges())
    assertEquals(new AliasDelta(), deltas.snd());
    assertNull(error);
  }
View Full Code Here

   
    TestAliasContext aliases = new TestAliasContext();
    aliases.addAlias(instr.getTarget(), labels[3]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[5]);
   
    AliasDelta expected = new AliasDelta();
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[5])
   
    Operation op = new ConstructorOp("Foo", new SpecVar[] {utils.getVar(0)}, new String[] {"Bar"});
    List<Effect> effects = new LinkedList<Effect>();
    effects.add(RelEffect.createRemoveEffect(utils.getRelation(1), new SpecVar[] {utils.getVar(0), utils.getVar(0)}));
    effects.add(RelEffect.createAddEffect(utils.getRelation(0), new SpecVar[] {Constraint.RESULT, utils.getVar(0)}));
View Full Code Here

    TestAliasContext aliases = new TestAliasContext();
    aliases.addAlias(instr.getReceiverOperand(), labels[0]);
    aliases.addAlias(instr.getTarget(), labels[3]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[5]);
   
    AliasDelta expected = new AliasDelta();
    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[5])


    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, AliasDelta> deltas = runSingleConstraint(env, cons, instr);
    FusionErrorReport error = checkSingleConstraint(env, cons, instr);
View Full Code Here

    TestAliasContext aliases = new TestAliasContext();
    aliases.addAlias(instr.getReceiverOperand(), labels[0]);
    aliases.addAlias(instr.getTarget(), labels[3]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[2]);
   
    AliasDelta expected = new AliasDelta();
    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[2])

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, AliasDelta> deltas = runSingleConstraint(env, cons, instr);
    FusionErrorReport error = checkSingleConstraint(env, cons, instr);
    Relationship eff1 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[0], labels[2]});
View Full Code Here

    aliases.addAlias(instr.getReceiverOperand(), labels[0]);
    aliases.addAlias(instr.getTarget(), labels[3]);
    aliases.addAlias(instr.getTarget(), labels[4]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[5]);
   
    AliasDelta expected = new AliasDelta();
    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getTarget(), labels[4]);
    expected.addChange(instr.getArgOperands().get(0), labels[5])

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, AliasDelta> deltas = runSingleConstraint(env, cons, instr);
    FusionErrorReport error = checkSingleConstraint(env, cons, instr);
    Relationship eff1 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[0], labels[5]});
View Full Code Here

    aliases.addAlias(instr.getReceiverOperand(), labels[0]);
    aliases.addAlias(instr.getTarget(), labels[3]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[1]);
    aliases.addAlias(instr.getArgOperands().get(0), labels[2]);

    AliasDelta expected = new AliasDelta();
    expected.addChange(instr.getReceiverOperand(), labels[0]);
    expected.addChange(instr.getTarget(), labels[3]);
    expected.addChange(instr.getArgOperands().get(0), labels[1])
    expected.addChange(instr.getArgOperands().get(0), labels[2])

    FusionEnvironment<?> env = new FusionEnvironment<TestAliasContext>(aliases, rels, null, types, new InferenceEnvironment(null), variant);   
    Pair<RelationshipDelta, AliasDelta> deltas = runSingleConstraint(env, cons, instr);
    FusionErrorReport error = checkSingleConstraint(env, cons, instr);
    Relationship eff1 = new Relationship(utils.getRelation(0), new ObjectLabel[]{labels[0], labels[1]});
View Full Code Here

TOP

Related Classes of edu.cmu.cs.fusion.alias.AliasDelta

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.