/** {@inheritDoc} */ public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ @Override public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ @Override public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ @Override public String toHuman() { switch (basicType) { case BT_VOID: return "void"; case BT_BOOLEAN: return "boolean"; case BT_BYTE: return "byte"; case BT_CHAR: return "char"; case BT_DOUBLE: return "double"; case BT_FLOAT: return "float"; case BT_INT: return "int"; case BT_LONG: return "long"; case BT_SHORT: return "short"; case BT_OBJECT: break; default: return descriptor; } if (isArray()) { return getComponentType().toHuman() + "[]"; } // Remove the "L...;" around the type and convert "/" to ".". return getClassName().replace("/", "."); }
/** {@inheritDoc} */ public void visitNewarray(int offset, int length, CstType cst, ArrayList<Constant> intVals) { String commentOrSpace = (length == 1) ? " // " : " "; String typeName = cst.getClassType().getComponentType().toHuman(); observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + typeName); }
/** {@inheritDoc} */ public void visitNewarray(int offset, int length, CstType cst, ArrayList<Constant> intVals) { String commentOrSpace = (length == 1) ? " // " : " "; String typeName = cst.getClassType().getComponentType().toHuman(); observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + typeName); }
/** {@inheritDoc} */ @Override public void visitNewarray(int offset, int length, CstType cst, ArrayList<Constant> intVals) { String commentOrSpace = (length == 1) ? " // " : " "; String typeName = cst.getClassType().getComponentType().toHuman(); observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + typeName); }
/** {@inheritDoc} */ @Override public void visitNewarray(int offset, int length, CstType cst, ArrayList<Constant> intVals) { String commentOrSpace = (length == 1) ? " // " : " "; String typeName = cst.getClassType().getComponentType().toHuman(); observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + typeName); }
/** {@inheritDoc} */ public void visitNewarray(int offset, int length, CstType cst, ArrayList<Constant> intVals) { String commentOrSpace = (length == 1) ? " // " : " "; String typeName = cst.getClassType().getComponentType().toHuman(); observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + typeName); }
/** {@inheritDoc} */ public void visitNewarray(int offset, int length, CstType cst, ArrayList<Constant> intVals) { String commentOrSpace = (length == 1) ? " // " : " "; String typeName = cst.getClassType().getComponentType().toHuman(); observer.parsed(bytes, offset, length, header(offset) + commentOrSpace + typeName); }
/** * Returns the appropriate {@code filled-new-array} rop for the given * type. The result may be a shared instance. * * @param arrayType {@code non-null;} type of array being created * @param count {@code count >= 0;} number of elements that the array should have * @return {@code non-null;} an appropriate instance */ public static Rop opFilledNewArray(TypeBearer arrayType, int count) { Type type = arrayType.getType(); Type elementType = type.getComponentType(); if (elementType.isCategory2()) { return throwBadType(arrayType); } if (count < 0) { throw new IllegalArgumentException("count < 0"); } StdTypeList sourceTypes = new StdTypeList(count); for (int i = 0; i < count; i++) { sourceTypes.set(i, elementType); } // Note: The resulting rop is considered call-like. return new Rop(RegOps.FILLED_NEW_ARRAY, sourceTypes, Exceptions.LIST_Error); }
/** * Replaces the instructions that define an array with equivalent registers. * For each entry in the array, a register is created, initialized to zero. * A mapping between this register and the corresponding array index is * added. * * @param def {@code non-null;} move result instruction for array * @param prev {@code non-null;} instruction for instantiating new array * @param length size of the new array * @param newRegs {@code non-null;} mapping of array indices to new * registers to be populated */ private void replaceDef(SsaInsn def, SsaInsn prev, int length, ArrayList<RegisterSpec> newRegs) { Type resultType = def.getResult().getType(); // Create new zeroed out registers for each element in the array for (int i = 0; i < length; i++) { Constant newZero = Zeroes.zeroFor(resultType.getComponentType()); TypedConstant typedZero = (TypedConstant) newZero; RegisterSpec newReg = RegisterSpec.make(ssaMeth.makeNewSsaReg(), typedZero); newRegs.add(newReg); insertPlainInsnBefore(def, RegisterSpecList.EMPTY, newReg, RegOps.CONST, newZero); } }
/** * Returns the appropriate {@code filled-new-array} rop for the given * type. The result may be a shared instance. * * @param arrayType {@code non-null;} type of array being created * @param count {@code >= 0;} number of elements that the array should have * @return {@code non-null;} an appropriate instance */ public static Rop opFilledNewArray(TypeBearer arrayType, int count) { Type type = arrayType.getType(); Type elementType = type.getComponentType(); if (elementType.isCategory2()) { return throwBadType(arrayType); } if (count < 0) { throw new IllegalArgumentException("count < 0"); } StdTypeList sourceTypes = new StdTypeList(count); for (int i = 0; i < count; i++) { sourceTypes.set(i, elementType); } // Note: The resulting rop is considered call-like. return new Rop(RegOps.FILLED_NEW_ARRAY, sourceTypes, Exceptions.LIST_Error); }
/** * Replaces the instructions that define an array with equivalent registers. * For each entry in the array, a register is created, initialized to zero. * A mapping between this register and the corresponding array index is * added. * * @param def {@code non-null;} move result instruction for array * @param prev {@code non-null;} instruction for instantiating new array * @param length size of the new array * @param newRegs {@code non-null;} mapping of array indices to new * registers to be populated */ private void replaceDef(SsaInsn def, SsaInsn prev, int length, ArrayList<RegisterSpec> newRegs) { Type resultType = def.getResult().getType(); // Create new zeroed out registers for each element in the array for (int i = 0; i < length; i++) { Constant newZero = Zeroes.zeroFor(resultType.getComponentType()); TypedConstant typedZero = (TypedConstant) newZero; RegisterSpec newReg = RegisterSpec.make(ssaMeth.makeNewSsaReg(), typedZero); newRegs.add(newReg); insertPlainInsnBefore(def, RegisterSpecList.EMPTY, newReg, RegOps.CONST, newZero); } }
/** * Returns the appropriate {@code filled-new-array} rop for the given * type. The result may be a shared instance. * * @param arrayType {@code non-null;} type of array being created * @param count {@code >= 0;} number of elements that the array should have * @return {@code non-null;} an appropriate instance */ public static Rop opFilledNewArray(TypeBearer arrayType, int count) { Type type = arrayType.getType(); Type elementType = type.getComponentType(); if (elementType.isCategory2()) { return throwBadType(arrayType); } if (count < 0) { throw new IllegalArgumentException("count < 0"); } StdTypeList sourceTypes = new StdTypeList(count); for (int i = 0; i < count; i++) { sourceTypes.set(i, elementType); } // Note: The resulting rop is considered call-like. return new Rop(RegOps.FILLED_NEW_ARRAY, sourceTypes, Exceptions.LIST_Error); }
/** * Replaces the instructions that define an array with equivalent registers. * For each entry in the array, a register is created, initialized to zero. * A mapping between this register and the corresponding array index is * added. * * @param def {@code non-null;} move result instruction for array * @param prev {@code non-null;} instruction for instantiating new array * @param length size of the new array * @param newRegs {@code non-null;} mapping of array indices to new * registers to be populated */ private void replaceDef(SsaInsn def, SsaInsn prev, int length, ArrayList<RegisterSpec> newRegs) { Type resultType = def.getResult().getType(); // Create new zeroed out registers for each element in the array for (int i = 0; i < length; i++) { Constant newZero = Zeroes.zeroFor(resultType.getComponentType()); TypedConstant typedZero = (TypedConstant) newZero; RegisterSpec newReg = RegisterSpec.make(ssaMeth.makeNewSsaReg(), typedZero); newRegs.add(newReg); insertPlainInsnBefore(def, RegisterSpecList.EMPTY, newReg, RegOps.CONST, newZero); } }