Package org.objectweb.asm.commons

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


  private void buildUserFactoryMethod()
  {
    final GeneratorAdapter mv = newMethod( this.userFactoryMethod.getName(), Type
        .getMethodDescriptor( this.userFactoryMethod ) );
    mv.newInstance( ByteCodeEngineCompiler.GEN_ROOT_CLASS );
    mv.dup();
    mv.loadArg( 0 );
    mv.loadThis();
    mv.getField( classType(), ByteCodeEngineCompiler.ENV_MEMBER_NAME, ByteCodeEngineCompiler.ENV_CLASS );
    mv.visitMethodInsn( Opcodes.INVOKESPECIAL, ByteCodeEngineCompiler.GEN_ROOT_CLASS.getInternalName(), "<init>", "("
        + this.userInputType.getDescriptor() + ByteCodeEngineCompiler.ENV_DESC + ")V" );
View Full Code Here


        access, name, desc, null, null), access, name, desc);

    // Load the value of the static data field:
    gen.getStatic(type, GeneratorConstants.DATAFIELD_NAME,
        GeneratorConstants.DATAFIELD_TYPE);
    gen.dup();

    // Stack[1]: [[Z
    // Stack[0]: [[Z

    // Skip initialization when we already have a data array:
View Full Code Here

        access, name, desc, null, null), access, name, desc);

    // Load the value of the static data field:
    gen.getStatic(type, GeneratorConstants.DATAFIELD_NAME,
        GeneratorConstants.PROBEDATA_TYPE);
    gen.dup();

    // Stack[1]: [Z
    // Stack[0]: [Z

    // Skip initialization when we already have a data array:
View Full Code Here

     
      int l = ga.newLocal(Types.OBJECT);
      ExpressionUtil.visitLine(bc, left.getStart());
      left.writeOut(bc, MODE_REF);
      ExpressionUtil.visitLine(bc, left.getEnd());
      ga.dup();
      ga.storeLocal(l);
     
      ga.visitJumpInsn(Opcodes.IFNONNULL, notNull);
      ExpressionUtil.visitLine(bc, right.getStart());
      right.writeOut(bc, MODE_REF);
View Full Code Here

    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);
      ExpressionUtil.writeOutSilent(value,bc, Expression.MODE_REF);
      ga.invokeStatic(KEY_IMPL, KEY_INTERN);
      ga.visitInsn(Opcodes.AASTORE);
View Full Code Here

      //ExpressionUtil.visitLine(adapter, component.getStartLine());
     
    int comp=adapter.newLocal(Types.COMPONENT_IMPL);
    adapter.newInstance(Types.COMPONENT_IMPL);
    adapter.dup();
   
    Attribute attr;
    // ComponentPage
    adapter.visitVarInsn(Opcodes.ALOAD, 0);
    adapter.checkCast(Types.COMPONENT_PAGE);
View Full Code Here

    GeneratorAdapter adapter = bc.getAdapter();
   
  // Array cases=new ArrayImpl();
    int array=adapter.newLocal(Types.ARRAY);
    adapter.newInstance(ARRAY_IMPL);
    adapter.dup();
    adapter.invokeConstructor(ARRAY_IMPL, INIT);
   
    adapter.storeLocal(array);
   
  // cases.append(case.value);
View Full Code Here

     
    int comp=adapter.newLocal(Types.INTERFACE_IMPL);
   
   
    adapter.newInstance(Types.INTERFACE_IMPL);
    adapter.dup();
   
   
    Attribute attr;
    // Interface Page
    adapter.visitVarInsn(Opcodes.ALOAD, 0);
View Full Code Here

      return;
    }
   
    int sct=adapter.newLocal(STRUCT_IMPL);
    adapter.newInstance(STRUCT_IMPL);
    adapter.dup();
    adapter.invokeConstructor(STRUCT_IMPL, INIT_STRUCT_IMPL);
    adapter.storeLocal(sct);
    if(meta!=null) {
      _createMetaDataStruct(bc,adapter,sct,meta);
    }
View Full Code Here

  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

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.