Пример #1
0
 /**
  * Checks whether <code>node</code> escapes at most in the caller. ie it doesn't escape in an
  * unanalyzed method, a thread or a static field.
  */
 public boolean escapesOnlyInCaller(PANode node) {
   if (hasEscapedIntoAMethod(node)) return false; // escapes into an unanalyzed method
   for (Iterator it = nodeHolesSet(node).iterator(); it.hasNext(); ) {
     PANode hole_node = (PANode) it.next();
     if (hole_node.type() != PANode.PARAM) return false; // escapes into a thread or a static
   }
   return true;
 }
Пример #2
0
  /* Specializes <code>this</code> according to <code>map</code>. */
  public PAEscapeFunc specialize(Map map) {
    PAEscapeFunc e2 = new PAEscapeFunc();

    for (Iterator itn = rel_n.keys().iterator(); itn.hasNext(); ) {
      PANode node = (PANode) itn.next();
      PANode node2 = PANode.translate(node, map);
      Iterator itnh = rel_n.getValues(node).iterator();
      while (itnh.hasNext()) e2.addNodeHole(node2, PANode.translate((PANode) itnh.next(), map));
    }

    ///// for(Iterator it = escaped_into_mh.iterator(); it.hasNext(); ){
    /////    PANode node = (PANode) it.next();
    /////    e2.escaped_into_mh.add(PANode.translate(node, map));
    ///// }
    for (Iterator it = getEscapedIntoMH().iterator(); it.hasNext(); ) {
      PANode node = (PANode) it.next();
      PANode node2 = PANode.translate(node, map);
      e2.addMethodHoles(node2, methodHolesSet(node));
    }
    /////

    return e2;
  }