/** * Gets the {@link Dop} with the given family/format combination, if * any. * * @param family {@code DalvOps.MIN_VALUE..DalvOps.MAX_VALUE;} the opcode family * @param format {@code non-null;} the opcode's instruction format * @return {@code null-ok;} the corresponding opcode, or {@code null} if * there is none */ public static Dop getOrNull(int family, InsnFormat format) { if (format == null) { throw new NullPointerException("format == null"); } int len = DOPS.length; // TODO: Linear search is bad. for (int i = 0; i < len; i++) { Dop dop = DOPS[i]; if ((dop != null) && (dop.getFamily() == family) && (dop.getFormat() == format)) { return dop; } } return null; }
if (opcode.getFamily() == Opcodes.GOTO) {
dop= Dops.getOrNull(dop.getFamily(), format); insns.set(i, insn.withOpcode(dop));
if (opcode.getFamily() == Opcodes.GOTO) {
if (opcode.getFamily() == Opcodes.GOTO) {
if (opcode.getFamily() == Opcodes.GOTO) {
if (opcode.getFamily() == Opcodes.GOTO) {
if (opcode.getFamily() == Opcodes.GOTO) {
if (opcode.getFamily() == Opcodes.GOTO) {
dop= Dops.getOrNull(dop.getFamily(), currentFormat); insn= insn.withOpcode(dop);
CstBaseMethodRef methodRef = (CstBaseMethodRef) cst; boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC); count = methodRef.getParameterWordCount(isStatic); if (insn.getOpcode().getFamily() != Opcodes.INVOKE_POLYMORPHIC) { throw new RuntimeException("Expecting invoke-polymorphic");
/** * Gets the size of the outgoing arguments area required by this * method. This is equal to the largest argument word count of any * method referred to by this instance. * * @return {@code >= 0;} the required outgoing arguments size */ public int getOutsSize() { int sz = size(); int result = 0; for (int i = 0; i < sz; i++) { DalvInsn insn = (DalvInsn) get0(i); if (!(insn instanceof CstInsn)) { continue; } Constant cst = ((CstInsn) insn).getConstant(); if (!(cst instanceof CstBaseMethodRef)) { continue; } boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC); int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic); if (count > result) { result = count; } } return result; }
/** * Gets the size of the outgoing arguments area required by this * method. This is equal to the largest argument word count of any * method referred to by this instance. * * @return {@code >= 0;} the required outgoing arguments size */ public int getOutsSize() { int sz = size(); int result = 0; for (int i = 0; i < sz; i++) { DalvInsn insn = (DalvInsn) get0(i); if (!(insn instanceof CstInsn)) { continue; } Constant cst = ((CstInsn) insn).getConstant(); if (!(cst instanceof CstBaseMethodRef)) { continue; } boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC); int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic); if (count > result) { result = count; } } return result; }
/** * Gets the size of the outgoing arguments area required by this * method. This is equal to the largest argument word count of any * method referred to by this instance. * * @return {@code >= 0;} the required outgoing arguments size */ public int getOutsSize() { int sz = size(); int result = 0; for (int i = 0; i < sz; i++) { DalvInsn insn = (DalvInsn) get0(i); if (!(insn instanceof CstInsn)) { continue; } Constant cst = ((CstInsn) insn).getConstant(); if (!(cst instanceof CstBaseMethodRef)) { continue; } boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC); int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic); if (count > result) { result = count; } } return result; }
/** * Gets the size of the outgoing arguments area required by this * method. This is equal to the largest argument word count of any * method referred to by this instance. * * @return {@code >= 0;} the required outgoing arguments size */ public int getOutsSize() { int sz = size(); int result = 0; for (int i = 0; i < sz; i++) { DalvInsn insn = (DalvInsn) get0(i); if (!(insn instanceof CstInsn)) { continue; } Constant cst = ((CstInsn) insn).getConstant(); if (!(cst instanceof CstBaseMethodRef)) { continue; } boolean isStatic = (insn.getOpcode().getFamily() == DalvOps.INVOKE_STATIC); int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic); if (count > result) { result = count; } } return result; }
/** * Gets the size of the outgoing arguments area required by this * method. This is equal to the largest argument word count of any * method referred to by this instance. * * @return {@code >= 0;} the required outgoing arguments size */ public int getOutsSize() { int sz = size(); int result = 0; for (int i = 0; i < sz; i++) { DalvInsn insn = (DalvInsn) get0(i); if (!(insn instanceof CstInsn)) { continue; } Constant cst = ((CstInsn) insn).getConstant(); if (!(cst instanceof CstBaseMethodRef)) { continue; } boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC); int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic); if (count > result) { result = count; } } return result; }
/** * Gets the size of the outgoing arguments area required by this * method. This is equal to the largest argument word count of any * method referred to by this instance. * * @return {@code >= 0;} the required outgoing arguments size */ public int getOutsSize() { int sz = size(); int result = 0; for (int i = 0; i < sz; i++) { DalvInsn insn = (DalvInsn) get0(i); if (!(insn instanceof CstInsn)) { continue; } Constant cst = ((CstInsn) insn).getConstant(); if (!(cst instanceof CstBaseMethodRef)) { continue; } boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC); int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic); if (count > result) { result = count; } } return result; }
int family= dop.getFamily();
CstBaseMethodRef methodRef = (CstBaseMethodRef) cst; boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC); count = methodRef.getParameterWordCount(isStatic); } else if (cst instanceof CstCallSiteRef) { if (insn.getOpcode().getFamily() != Opcodes.INVOKE_POLYMORPHIC) { throw new RuntimeException("Expecting invoke-polymorphic");