@Override
  public Node leave(Node old, Node n, NodeVisitor v) {
    if (CEExt_c.ext(n).isConditionSet()) {
      // it's a set condition!
      Call c = (Call) n;
      if (c.target() instanceof Local) {
        // ignore local conditions, we're only interested in fields
      } else if (c.target() instanceof Field) {
        Field f = (Field) c.target();
        this.setConds.addAll(autil.abstractLocations(f));
      } else {
        throw new InternalCompilerError("Can't handle " + n);
      }
    }

    if (n instanceof Call) {
      process((Call) n);
    } else if (n instanceof New) {
      process((New) n);
    } else if (n instanceof ConstructorCall) {
      process((ConstructorCall) n);
    }

    return n;
  }
Exemplo n.º 2
0
 private boolean expectsBoxed(Call call, Node arg) {
   // implicit this argument also is present
   if (call.target() == arg)
     return isBoxedType(call.target().type()); // targets of primitive types are unboxed
   int i = call.arguments().indexOf(arg);
   if (i < 0) throw new InternalCompilerError("BoxingPropagator: cannot find argument in call");
   Type type = call.methodInstance().def().formalTypes().get(i).get();
   return isBoxedType(type);
 }