/** * Sets the item at the given index. * * <p><b>Note:</b> At least one of {@code descriptor} or * {@code signature} must be passed as non-null.</p> * * @param n {@code >= 0, < size();} which element * @param startPc {@code >= 0;} the start pc of this variable's scope * @param length {@code >= 0;} the length (in bytecodes) of this variable's * scope * @param name {@code non-null;} the variable's name * @param descriptor {@code null-ok;} the variable's type descriptor * @param signature {@code null-ok;} the variable's type signature * @param index {@code >= 0;} the variable's local index */ public void set(int n, int startPc, int length, CstUtf8 name, CstUtf8 descriptor, CstUtf8 signature, int index) { set0(n, new Item(startPc, length, name, descriptor, signature, index)); }
RegisterSpec result = (local == null) ? RegisterSpec.make(at, one) : RegisterSpec.makeLocalOptional(at, one, local.getLocalItem());
localType = local.getType(); if (localType.getBasicFrameType() != type.getBasicFrameType()) { = (local == null) ? null : local.getLocalItem(); machine.popArgs(frame, type); machine.auxType(type); = (local == null) ? null : local.getLocalItem(); machine.localArg(frame, idx); machine.localTarget(idx, localType, item);
RegisterSpec result = (local == null) ? RegisterSpec.make(at, one) : RegisterSpec.makeLocalOptional(at, one, local.getLocalItem());
RegisterSpec result = (local == null) ? RegisterSpec.make(at, one) : RegisterSpec.makeLocalOptional(at, one, local.getLocalItem());
RegisterSpec result = (local == null) ? RegisterSpec.make(at, one) : RegisterSpec.makeLocalOptional(at, one, local.getLocalItem());
RegisterSpec result = (local == null) ? RegisterSpec.make(at, one) : RegisterSpec.makeLocalOptional(at, one, local.getLocalItem());
localType = local.getType(); if (localType.getBasicFrameType() != type.getBasicFrameType()) { = (local == null) ? null : local.getLocalItem(); machine.popArgs(frame, type); machine.auxType(type); = (local == null) ? null : local.getLocalItem(); machine.localArg(frame, idx); machine.localTarget(idx, localType, item);
localType = local.getType(); if (localType.getBasicFrameType() != type.getBasicFrameType()) { = (local == null) ? null : local.getLocalItem(); machine.popArgs(frame, type); machine.auxType(type); = (local == null) ? null : local.getLocalItem(); machine.localArg(frame, idx); machine.localTarget(idx, localType, item);
RegisterSpec result = (local == null) ? RegisterSpec.make(at, one) : RegisterSpec.makeLocalOptional(at, one, local.getLocalItem());
localType = local.getType(); if (localType.getBasicFrameType() != type.getBasicFrameType()) { = (local == null) ? null : local.getLocalItem(); machine.popArgs(frame, type); machine.auxType(type); = (local == null) ? null : local.getLocalItem(); machine.localArg(frame, idx); machine.localTarget(idx, localType, item);
localType = local.getType(); if (localType.getBasicFrameType() != type.getBasicFrameType()) { = (local == null) ? null : local.getLocalItem(); machine.popArgs(frame, type); machine.auxType(type); = (local == null) ? null : local.getLocalItem(); machine.localArg(frame, idx); machine.localTarget(idx, localType, item);
localType = local.getType(); if (localType.getBasicFrameType() != type.getBasicFrameType()) { = (local == null) ? null : local.getLocalItem(); machine.popArgs(frame, type); machine.auxType(type); = (local == null) ? null : local.getLocalItem(); machine.localArg(frame, idx); machine.localTarget(idx, localType, item);
/** * Returns an instance which is the result of merging the two * given instances, where one instance should have only type * descriptors and the other only type signatures. The merged * result is identical to the one with descriptors, except that * any element whose {name, index, start, length} matches an * element in the signature list gets augmented with the * corresponding signature. The result is immutable. * * @param descriptorList {@code non-null;} list with descriptors * @param signatureList {@code non-null;} list with signatures * @return {@code non-null;} the merged result */ public static LocalVariableList mergeDescriptorsAndSignatures( LocalVariableList descriptorList, LocalVariableList signatureList) { int descriptorSize = descriptorList.size(); LocalVariableList result = new LocalVariableList(descriptorSize); for (int i = 0; i < descriptorSize; i++) { Item item = descriptorList.get(i); Item signatureItem = signatureList.itemToLocal(item); if (signatureItem != null) { CstUtf8 signature = signatureItem.getSignature(); item = item.withSignature(signature); } result.set(i, item); } result.setImmutable(); return result; }
/** * Returns an instance which is the result of merging the two * given instances, where one instance should have only type * descriptors and the other only type signatures. The merged * result is identical to the one with descriptors, except that * any element whose {name, index, start, length} matches an * element in the signature list gets augmented with the * corresponding signature. The result is immutable. * * @param descriptorList {@code non-null;} list with descriptors * @param signatureList {@code non-null;} list with signatures * @return {@code non-null;} the merged result */ public static LocalVariableList mergeDescriptorsAndSignatures( LocalVariableList descriptorList, LocalVariableList signatureList) { int descriptorSize = descriptorList.size(); LocalVariableList result = new LocalVariableList(descriptorSize); for (int i = 0; i < descriptorSize; i++) { Item item = descriptorList.get(i); Item signatureItem = signatureList.itemToLocal(item); if (signatureItem != null) { CstString signature = signatureItem.getSignature(); item = item.withSignature(signature); } result.set(i, item); } result.setImmutable(); return result; }
/** * Returns an instance which is the result of merging the two * given instances, where one instance should have only type * descriptors and the other only type signatures. The merged * result is identical to the one with descriptors, except that * any element whose {name, index, start, length} matches an * element in the signature list gets augmented with the * corresponding signature. The result is immutable. * * @param descriptorList {@code non-null;} list with descriptors * @param signatureList {@code non-null;} list with signatures * @return {@code non-null;} the merged result */ public static LocalVariableList mergeDescriptorsAndSignatures( LocalVariableList descriptorList, LocalVariableList signatureList) { int descriptorSize = descriptorList.size(); LocalVariableList result = new LocalVariableList(descriptorSize); for (int i = 0; i < descriptorSize; i++) { Item item = descriptorList.get(i); Item signatureItem = signatureList.itemToLocal(item); if (signatureItem != null) { CstString signature = signatureItem.getSignature(); item = item.withSignature(signature); } result.set(i, item); } result.setImmutable(); return result; }
/** * Returns an instance which is the result of merging the two * given instances, where one instance should have only type * descriptors and the other only type signatures. The merged * result is identical to the one with descriptors, except that * any element whose {name, index, start, length} matches an * element in the signature list gets augmented with the * corresponding signature. The result is immutable. * * @param descriptorList {@code non-null;} list with descriptors * @param signatureList {@code non-null;} list with signatures * @return {@code non-null;} the merged result */ public static LocalVariableList mergeDescriptorsAndSignatures( LocalVariableList descriptorList, LocalVariableList signatureList) { int descriptorSize = descriptorList.size(); LocalVariableList result = new LocalVariableList(descriptorSize); for (int i = 0; i < descriptorSize; i++) { Item item = descriptorList.get(i); Item signatureItem = signatureList.itemToLocal(item); if (signatureItem != null) { CstString signature = signatureItem.getSignature(); item = item.withSignature(signature); } result.set(i, item); } result.setImmutable(); return result; }
/** * Returns an instance which is the result of merging the two * given instances, where one instance should have only type * descriptors and the other only type signatures. The merged * result is identical to the one with descriptors, except that * any element whose {name, index, start, length} matches an * element in the signature list gets augmented with the * corresponding signature. The result is immutable. * * @param descriptorList {@code non-null;} list with descriptors * @param signatureList {@code non-null;} list with signatures * @return {@code non-null;} the merged result */ public static LocalVariableList mergeDescriptorsAndSignatures( LocalVariableList descriptorList, LocalVariableList signatureList) { int descriptorSize = descriptorList.size(); LocalVariableList result = new LocalVariableList(descriptorSize); for (int i = 0; i < descriptorSize; i++) { Item item = descriptorList.get(i); Item signatureItem = signatureList.itemToLocal(item); if (signatureItem != null) { CstString signature = signatureItem.getSignature(); item = item.withSignature(signature); } result.set(i, item); } result.setImmutable(); return result; }
/** * Returns an instance which is the result of merging the two * given instances, where one instance should have only type * descriptors and the other only type signatures. The merged * result is identical to the one with descriptors, except that * any element whose {name, index, start, length} matches an * element in the signature list gets augmented with the * corresponding signature. The result is immutable. * * @param descriptorList {@code non-null;} list with descriptors * @param signatureList {@code non-null;} list with signatures * @return {@code non-null;} the merged result */ public static LocalVariableList mergeDescriptorsAndSignatures( LocalVariableList descriptorList, LocalVariableList signatureList) { int descriptorSize = descriptorList.size(); LocalVariableList result = new LocalVariableList(descriptorSize); for (int i = 0; i < descriptorSize; i++) { Item item = descriptorList.get(i); Item signatureItem = signatureList.itemToLocal(item); if (signatureItem != null) { CstString signature = signatureItem.getSignature(); item = item.withSignature(signature); } result.set(i, item); } result.setImmutable(); return result; }
/** * Gets the local variable information associated with a given address * and local index, if any. <b>Note:</b> In standard classfiles, a * variable's start point is listed as the address of the instruction * <i>just past</i> the one that sets the variable. * * @param pc {@code >= 0;} the address to look up * @param index {@code >= 0;} the local variable index * @return {@code null-ok;} the associated local variable information, or * {@code null} if none is known */ public Item pcAndIndexToLocal(int pc, int index) { int sz = size(); for (int i = 0; i < sz; i++) { Item one = (Item) get0(i); if ((one != null) && one.matchesPcAndIndex(pc, index)) { return one; } } return null; }