if (source.getType().ropType.isReference()) { addInstruction(new ThrowingCstInsn(Rops.CHECK_CAST, sourcePosition, RegisterSpecList.make(source.spec()), catches, target.type.constant));
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
/** * Gets the name of the class this type corresponds to, in internal * form. This method is only valid if this instance is for a * normal reference type (that is, a reference type and * additionally not a return address). * * @return {@code non-null;} the internal-form class name */ public String getClassName() { if (className == null) { if (!isReference()) { throw new IllegalArgumentException("not an object type: " + descriptor); } if (descriptor.charAt(0) == '[') { className = descriptor; } else { className = descriptor.substring(1, descriptor.length() - 1); } } return className; }
if (!isReference()) { throw new IllegalArgumentException("not a reference type: " + descriptor);
if (!isReference()) { throw new IllegalArgumentException("not a reference type: " + descriptor);
if (!isReference()) { throw new IllegalArgumentException("not a reference type: " + descriptor);
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }
/** * Makes a move instruction, appropriate and ideal for the given arguments. * * @param position {@code non-null;} source position information * @param dest {@code non-null;} destination register * @param src {@code non-null;} source register * @return {@code non-null;} an appropriately-constructed instance */ public static SimpleInsn makeMove(SourcePosition position, RegisterSpec dest, RegisterSpec src) { boolean category1 = dest.getCategory() == 1; boolean reference = dest.getType().isReference(); int destReg = dest.getReg(); int srcReg = src.getReg(); Dop opcode; if ((srcReg | destReg) < 16) { opcode = reference ? Dops.MOVE_OBJECT : (category1 ? Dops.MOVE : Dops.MOVE_WIDE); } else if (destReg < 256) { opcode = reference ? Dops.MOVE_OBJECT_FROM16 : (category1 ? Dops.MOVE_FROM16 : Dops.MOVE_WIDE_FROM16); } else { opcode = reference ? Dops.MOVE_OBJECT_16 : (category1 ? Dops.MOVE_16 : Dops.MOVE_WIDE_16); } return new SimpleInsn(opcode, position, RegisterSpecList.make(dest, src)); }