Package org.objectweb.asm.commons

Examples of org.objectweb.asm.commons.GeneratorAdapter.newArray()


        if (clinit != null) {
          Type[] formals = m.getArgumentTypes();
          clinit.push(Type.getType(itf));
          clinit.push(m.getName());
          clinit.push(formals.length);
          clinit.newArray(CLASS);
          for (int j = 0; j < formals.length; ++j) {
            clinit.dup();
            clinit.push(j);
            clinit.push(formals[j]);
            clinit.arrayStore(CLASS);
View Full Code Here


      // push the method name string arg onto the stack
      staticAdapter.push(m.method.getName());

      // create an array of the method parm class[] arg
      staticAdapter.push(targetMethodParameters.length);
      staticAdapter.newArray(CLASS_TYPE);
      int index = 0;
      for (Type t : targetMethodParameters) {
        staticAdapter.dup();
        staticAdapter.push(index);
        staticAdapter.push(t);
View Full Code Here

                methodAdapter.visitInsn(Opcodes.ICONST_0);
                index++;
              }
              // If we're just a single array, then call the newArray method, otherwise use the MultiANewArray instruction.
              if (index == 1) {
                methodAdapter.newArray(type.getElementType());
              } else {
                methodAdapter.visitMultiANewArrayInsn(type.getDescriptor(), index);
              }
              break;
            case Type.BOOLEAN:
View Full Code Here

      // push the method name string arg onto the stack
      staticAdapter.push(m.method.getName());

      // create an array of the method parm class[] arg
      staticAdapter.push(targetMethodParameters.length);
      staticAdapter.newArray(CLASS_TYPE);
      int index = 0;
      for (Type t : targetMethodParameters) {
        staticAdapter.dup();
        staticAdapter.push(index);
        staticAdapter.push(t);
View Full Code Here

    mv.mark( isNull );

    // ~ ~ this.field = new DetailPrototype[ 0 ];
    mv.loadThis();
    mv.push( 0 );
    mv.newArray( sub.classType() );
    mv.putField( section().classType(), sub.getterName(), sub.arrayType() );

    // ~ }
    // }
    mv.mark( alreadySet );
View Full Code Here

    mv.ifNonNull( skipInit );

    // ... new double[ n ]
    mv.loadThis();
    mv.push( n );
    mv.newArray( eltType );

    // ... { c1, c2, ... }
    int i = 0;
    for (ExpressionNode elt : this.arrayNode.arguments()) {
      if (elt instanceof ExpressionNodeForConstantValue) {
View Full Code Here

    int index=0;
    LitString value;
    Iterator<LitString> it = keys.iterator();
    ga.visitVarInsn(Opcodes.ALOAD, 0);
    ga.push(keys.size());
    ga.newArray(Types.COLLECTION_KEY);
    while(it.hasNext()) {
      value=it.next();
      ga.dup();
      ga.push(index++);
      //value.setExternalize(false);
View Full Code Here

    GeneratorAdapter cga = constr.getAdapter();
   
    cga.visitVarInsn(Opcodes.ALOAD, 0);
    cga.push(functions.size());
    //cga.visitTypeInsn(Opcodes.ANEWARRAY, Types.UDF_PROPERTIES.toString());
    cga.newArray(Types.UDF_PROPERTIES);
    cga.visitFieldInsn(Opcodes.PUTFIELD, bc.getClassName(), "udfs", className);
   
   
    Iterator<IFunction> it = functions.iterator();
    while(it.hasNext()){
View Full Code Here

  private static Map<String,String> last=new HashMap<String,String>();

  public static void writeOutExpressionArray(BytecodeContext bc, Type arrayType, Expression[] array) throws BytecodeException {
      GeneratorAdapter adapter = bc.getAdapter();
        adapter.push(array.length);
        adapter.newArray(arrayType);
        for (int i = 0; i < array.length; i++) {
            adapter.dup();
            adapter.push(i);
            array[i].writeOut(bc, Expression.MODE_REF);
            adapter.visitInsn(Opcodes.AASTORE);
View Full Code Here

    int carr=-1;
    if(attr!=null) {
      carr=adapter.newLocal(Types.CHAR_ARRAY);
      attr.getValue().writeOut(bc, Expression.MODE_VALUE);
      adapter.cast(Types.DOUBLE_VALUE, Types.INT_VALUE);
      adapter.newArray(Types.CHAR);
      adapter.storeLocal(carr);
    }
   
    // BufferedReader reader = IOUtil.getBufferedReader(resource,charset);
    final int br=adapter.newLocal(Types.BUFFERED_READER);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.