code: private boolean isCandidate(String name, ArrayList<Node> refs) {
      if (!OptimizeCalls.mayBeOptimizableName(compiler, name)) {
        return false;
      }
  
      boolean seenCandidateDefiniton = false;
      boolean seenCandidateUse = false;
      for (Node n : refs) {
        // TODO(johnlenz): Determine what to do about ".constructor" references.
        // Currently classes that are super classes or have superclasses aren't optimized
        //
        // if (parent.isCall() && n != parent.getFirstChild() && isClassDefiningCall(parent)) {
        //   continue;
        // } else
  
        if (ReferenceMap.isCallOrNewTarget(n)) {
          // TODO(johnlenz): filter .apply when we support it
          seenCandidateUse = true;
        } else if (isCandidateDefinition(n)) {
          seenCandidateDefiniton = true;
        } else {
          // If this isn't an non-aliasing reference (typeof, instanceof, etc)
          // then there is nothing that can be done.
          if (!OptimizeCalls.isAllowedReference(n)) {
            // TODO(johnlenz): allow extends clauses.
            return false;
          }
        }
      }
  
      return seenCandidateDefiniton && seenCandidateUse;
    }
docs: This reference set is a candidate for parameter-moving if:
  - if all call sites are known (no aliasing)
  - if all definition sites are known (the possible values are known functions)
  - there is at least one definition