@Override public boolean match(IClass type, ClassHolder holder) { return type.isArray(); }
@Override public Label getContinueLabel() { return elements.getResultType().isArray() ? arrayContinueLbl : conditionLbl; }
@Override public final KernelArrayValue newarray(IClass arrayType, final Object arrayObject) { if(!arrayType.isArray()) { throw new IllegalArgumentException("Must be an array type, but actually a/an " + arrayType); } return OperatorFactory.newOperator(KernelArrayValue.class, new Class<?>[] { KernelProgramBlock.class, ArrayClass.class, Object.class }, getExecutor(), arrayType, arrayObject); }
@Override public final KernelArrayValue makeArray(IClass arrayType, final KernelParam... allocateDims) { if(!arrayType.isArray()) { throw new IllegalArgumentException("Must be an array type, but actually a/an " + arrayType); } return OperatorFactory.newOperator(KernelArrayValue.class, new Class<?>[] { KernelProgramBlock.class, ArrayClass.class, KernelParam[].class }, getExecutor(), arrayType, allocateDims); }
@Override protected void init() { IClass type = elements.getResultType(); if(!type.isArray() && !type.isChildOrEqual(getType(Iterable.class))){ throw new ASMSupportException("Can only iterate over an array or an instance of java.lang.Iterable."); } }
/** * <strong>4.10 Subtyping</strong> * <p>The subtype and supertype relations are binary relations on types.</p> * <p>get direct super type</p> * @param subType * @return */ public static IClass[] directSuperType(IClass subType) { if(subType.isPrimitive()) { IClass type = directSuperAmongPrimitiveType(subType); if(type == null) { return null; } else { return new IClass[]{type}; } } else if (subType.isArray()) { return directSuperAmongArrayType(subType); } else { return directSuperAmongClassAndInterfaceType(subType); } }
!arguments[ArrayUtils.getLength(arguments) - 1].getResultType().isArray()){
@Override public final void generate() { if(elements.getResultType().isArray()){ final LocalVariable i = var(getType(int.class), val(0)); final LocalVariable len = var(getType(int.class), arrayLength(elements));