Ejemplo n.º 1
0
 public InstanceKey getInstanceKeyForMultiNewArray(
     CGNode node, NewSiteReference allocation, int dim) {
   if (allocationPolicy()) {
     return siteBased.getInstanceKeyForMultiNewArray(node, allocation, dim);
   } else {
     return classBased.getInstanceKeyForMultiNewArray(node, allocation, dim);
   }
 }
Ejemplo n.º 2
0
  public InstanceKey getInstanceKeyForAllocation(CGNode node, NewSiteReference allocation) {
    if (allocation == null) {
      throw new IllegalArgumentException("allocation is null");
    }
    TypeReference t = allocation.getDeclaredType();
    IClass C = cha.lookupClass(t);

    if (C != null && isInteresting(C)) {
      if (smushMany()) {
        if (exceedsSmushLimit(C, node)) {
          return smushed.getInstanceKeyForAllocation(node, allocation);
        } else {
          return siteBased.getInstanceKeyForAllocation(node, allocation);
        }
      } else {
        return siteBased.getInstanceKeyForAllocation(node, allocation);
      }
    } else {
      return classBased.getInstanceKeyForAllocation(node, allocation);
    }
  }