/** * Annotates (adds context to) the given exception with information * about this frame. * * @param ex {@code non-null;} the exception to annotate */ public void annotate(ExceptionWithContext ex) { locals.annotate(ex); stack.annotate(ex); } }
/** * 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()); } } }
/** {@inheritDoc} */ @Override public final void localArg(Frame frame, int idx) { clearArgs(); args[0] = frame.getLocals().get(idx); argCount = 1; localIndex = idx; }
/** {@inheritDoc} */ @Override public LocalsArray merge(LocalsArray other) { if (other instanceof OneLocalsArray) { return merge((OneLocalsArray)other); } else { //LocalsArraySet // LocalsArraySet knows how to merge me. return other.merge(this); } }
/** * Replaces all the occurrences of the given uninitialized type in * this frame with its initialized equivalent. * * @param type {@code non-null;} type to replace */ public void makeInitialized(Type type) { locals.makeInitialized(type); stack.makeInitialized(type); }
/** {@inheritDoc*/ public String toHuman() { StringBuilder sb = new StringBuilder(); sb.append("(locals array set; primary)\n"); sb.append(getPrimary().toHuman()); sb.append('\n'); int sz = secondaries.size(); for (int label = 0; label < sz; label++) { LocalsArray la = secondaries.get(label); if (la != null) { sb.append("(locals array set: primary for caller " + Hex.u2(label) + ")\n"); sb.append(la.getPrimary().toHuman()); sb.append('\n'); } } return sb.toString(); }
/** {@inheritDoc} */ @Override public void set(int idx, TypeBearer type) { throwIfImmutable(); primary.set(idx, type); for (LocalsArray la : secondaries) { if (la != null) { la.set(idx, type); } } }
/** {@inheritDoc} */ @Override public void setImmutable() { primary.setImmutable(); for (LocalsArray la : secondaries) { if (la != null) { la.setImmutable(); } } super.setImmutable(); }
/** @inheritDoc */ @Override public void invalidate(int idx) { throwIfImmutable(); primary.invalidate(idx); for (LocalsArray la : secondaries) { if (la != null) { la.invalidate(idx); } } }
ExecutionStack resultStack; resultLocals = getLocals().mergeWithSubroutineCaller( other.getLocals(), predLabel); resultStack = getStack().merge(other.getStack());
/** {@inheritDoc} */ @Override public LocalsArray merge(LocalsArray other) { if (other instanceof OneLocalsArray) { return merge((OneLocalsArray)other); } else { //LocalsArraySet // LocalsArraySet knows how to merge me. return other.merge(this); } }
/** * Replaces all the occurrences of the given uninitialized type in * this frame with its initialized equivalent. * * @param type {@code non-null;} type to replace */ public void makeInitialized(Type type) { locals.makeInitialized(type); stack.makeInitialized(type); }
/** {@inheritDoc} */ @Override public String toHuman() { StringBuilder sb = new StringBuilder(); sb.append("(locals array set; primary)\n"); sb.append(getPrimary().toHuman()); sb.append('\n'); int sz = secondaries.size(); for (int label = 0; label < sz; label++) { LocalsArray la = secondaries.get(label); if (la != null) { sb.append("(locals array set: primary for caller " + Hex.u2(label) + ")\n"); sb.append(la.getPrimary().toHuman()); sb.append('\n'); } } return sb.toString(); }
/** {@inheritDoc} */ @Override public void set(int idx, TypeBearer type) { throwIfImmutable(); primary.set(idx, type); for (LocalsArray la : secondaries) { if (la != null) { la.set(idx, type); } } }
/** {@inheritDoc} */ @Override public void setImmutable() { primary.setImmutable(); for (LocalsArray la : secondaries) { if (la != null) { la.setImmutable(); } } super.setImmutable(); }
/** {@inheritDoc} */ @Override public void invalidate(int idx) { throwIfImmutable(); primary.invalidate(idx); for (LocalsArray la : secondaries) { if (la != null) { la.invalidate(idx); } } }
ExecutionStack resultStack; resultLocals = getLocals().mergeWithSubroutineCaller( other.getLocals(), predLabel); resultStack = getStack().merge(other.getStack());
/** @inheritDoc */ @Override public LocalsArray merge(LocalsArray other) { if (other instanceof OneLocalsArray) { return merge((OneLocalsArray)other); } else { //LocalsArraySet // LocalsArraySet knows how to merge me. return other.merge(this); } }
/** * Replaces all the occurrences of the given uninitialized type in * this frame with its initialized equivalent. * * @param type {@code non-null;} type to replace */ public void makeInitialized(Type type) { locals.makeInitialized(type); stack.makeInitialized(type); }
/** * Annotates (adds context to) the given exception with information * about this frame. * * @param ex {@code non-null;} the exception to annotate */ public void annotate(ExceptionWithContext ex) { locals.annotate(ex); stack.annotate(ex); } }