/** {@inheritDoc} */ @Override public OneLocalsArray copy() { OneLocalsArray result = new OneLocalsArray(locals.length); System.arraycopy(locals, 0, result.locals, 0, locals.length); return result; }
/** {@inheritDoc} */ @Override public TypeBearer get(int idx) { return primary.get(idx); }
/** {@inheritDoc} */ @Override public TypeBearer getCategory1(int idx) { return primary.getCategory1(idx); }
int sz = locals1.getMaxLocals(); OneLocalsArray result = null; if (locals2.getMaxLocals() != sz) { throw new SimException("mismatched maxLocals values"); TypeBearer tb1 = locals1.getOrNull(i); TypeBearer tb2 = locals2.getOrNull(i); TypeBearer resultType = mergeType(tb1, tb2); if (resultType != tb1) { result = locals1.copy(); result.invalidate(i); } else { result.set(i, resultType); result.setImmutable(); return result;
/** {@inheritDoc} */ @Override public TypeBearer getCategory2(int idx) { TypeBearer result = get(idx); if (result.getType().isCategory1()) { return throwSimException(idx, "category-1"); } return result; }
boolean secondariesChanged = false; newPrimary = primary.merge(other.getPrimary()); newSecondaries = new ArrayList(secondaries.size());
/** {@inheritDoc} */ @Override public int getMaxLocals() { return primary.getMaxLocals(); }
/** {@inheritDoc} */ @Override public void annotate(ExceptionWithContext ex) { ex.addContext("(locals array set; primary)"); primary.annotate(ex); int sz = secondaries.size(); for (int label = 0; label < sz; label++) { LocalsArray la = secondaries.get(label); if (la != null) { ex.addContext("(locals array set: primary for caller " + Hex.u2(label) + ')'); la.getPrimary().annotate(ex); } } }
/** {@inheritDoc} */ @Override public void invalidate(int idx) { throwIfImmutable(); primary.invalidate(idx); for (LocalsArray la : secondaries) { if (la != null) { la.invalidate(idx); } } }
/** {@inheritDoc} */ @Override public TypeBearer getOrNull(int idx) { return primary.getOrNull(idx); }
/** {@inheritDoc} */ @Override public TypeBearer getCategory2(int idx) { return primary.getCategory2(idx); }
/** * Constructs an instance which is a copy of another. * * @param toCopy {@code non-null;} instance to copy. */ private LocalsArraySet(LocalsArraySet toCopy) { super(toCopy.getMaxLocals() > 0); primary = toCopy.primary.copy(); secondaries = new ArrayList(toCopy.secondaries.size()); int sz = toCopy.secondaries.size(); for (int i = 0; i < sz; i++) { LocalsArray la = toCopy.secondaries.get(i); if (la == null) { secondaries.add(null); } else { secondaries.add(la.copy()); } } }
int sz = locals1.getMaxLocals(); OneLocalsArray result = null; if (locals2.getMaxLocals() != sz) { throw new SimException("mismatched maxLocals values"); TypeBearer tb1 = locals1.getOrNull(i); TypeBearer tb2 = locals2.getOrNull(i); TypeBearer resultType = mergeType(tb1, tb2); if (resultType != tb1) { result = locals1.copy(); result.invalidate(i); } else { result.set(i, resultType); result.setImmutable(); return result;
/** @inheritDoc */ public TypeBearer getCategory2(int idx) { TypeBearer result = get(idx); if (result.getType().isCategory1()) { return throwSimException(idx, "category-1"); } return result; }
boolean secondariesChanged = false; newPrimary = primary.merge(other.getPrimary()); newSecondaries = new ArrayList(secondaries.size());
/** @inheritDoc */ @Override public int getMaxLocals() { return primary.getMaxLocals(); }
/** @inheritDoc */ @Override public void annotate(ExceptionWithContext ex) { ex.addContext("(locals array set; primary)"); primary.annotate(ex); int sz = secondaries.size(); for (int label = 0; label < sz; label++) { LocalsArray la = secondaries.get(label); if (la != null) { ex.addContext("(locals array set: primary for caller " + Hex.u2(label) + ')'); la.getPrimary().annotate(ex); } } }
/** @inheritDoc */ @Override public void invalidate(int idx) { throwIfImmutable(); primary.invalidate(idx); for (LocalsArray la : secondaries) { if (la != null) { la.invalidate(idx); } } }
/** {@inheritDoc} */ @Override public TypeBearer getOrNull(int idx) { return primary.getOrNull(idx); }
/** {@inheritDoc} */ @Override public TypeBearer getCategory2(int idx) { return primary.getCategory2(idx); }