Package com.google.gwt.dev.asm

Examples of com.google.gwt.dev.asm.MethodVisitor


        final String name,
        final String desc,
        final String signature,
        final String[] exceptions)
    {
        MethodVisitor mv;
        if ("<clinit>".equals(name)) {
            int a = Opcodes.ACC_PRIVATE + Opcodes.ACC_STATIC;
            String n = prefix + counter++;
            mv = cv.visitMethod(a, n, desc, signature, exceptions);
View Full Code Here


        String desc,
        String signature,
        String[] exceptions)
    {
        String newDesc = remapper.mapMethodDesc(desc);
        MethodVisitor mv = super.visitMethod(access,
                remapper.mapMethodName(className, name, desc),
                newDesc,
                remapper.mapSignature(signature, false),
                exceptions == null ? null : remapper.mapTypes(exceptions));
        return mv == null ? null : createRemappingMethodAdapter(access, newDesc, mv);
View Full Code Here

      String signature, String[] exceptions) {

    boolean isNative = (access & Opcodes.ACC_NATIVE) != 0;
    access &= ~Opcodes.ACC_NATIVE;

    MethodVisitor mv = super.visitMethod(access, name, desc, signature,
        exceptions);

    if (isNative) {
      mv = new MyMethodAdapter(mv, access, name, desc);
    }
View Full Code Here

       */
      Type implementingType = Type.getType("L"
          + implementingMethod.getArgumentTypes()[0].getInternalName() + "$;");

      // Maybe create the method. This is marked final as a sanity check
      MethodVisitor mv = visitMethodNoRewrite(Opcodes.ACC_PUBLIC
          | Opcodes.ACC_FINAL | Opcodes.ACC_SYNTHETIC, localMethod.getName(),
          localMethod.getDescriptor(), null, null);

      if (mv != null) {
        mv.visitCode();

        /*
         * It just so happens that the stack and local variable sizes are the
         * same, but they're kept distinct to aid in clarity should the dispatch
         * logic change.
         */
        int var = 0;
        int size = 0;

        for (Type t : implementingMethod.getArgumentTypes()) {
          size += t.getSize();
          mv.visitVarInsn(t.getOpcode(Opcodes.ILOAD), var);
          var += t.getSize();
        }

        // Make sure there's enough room for the return value
        size = Math.max(size, implementingMethod.getReturnType().getSize());

        mv.visitMethodInsn(Opcodes.INVOKESTATIC,
            implementingType.getInternalName(), implementingMethod.getName(),
            implementingMethod.getDescriptor());
        mv.visitInsn(localMethod.getReturnType().getOpcode(Opcodes.IRETURN));
        mv.visitMaxs(size, var);
        mv.visitEnd();
      }
    }
View Full Code Here

    if (inSingleJsoImplInterfaceType && !"<clinit>".equals(name)) {
      name = currentTypeName.replace('/', '_') + "_" + name;
      implementedMethods.add(name);
    }

    MethodVisitor mv = super.visitMethod(access, name, desc, signature,
        exceptions);
    if (mv == null) {
      return null;
    }
View Full Code Here

    String descriptor = "("
        + method.getDescriptor().substring(
            1 + method.getArgumentTypes()[0].getDescriptor().length());

    // Create the stub method entry in the interface
    MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC
        | Opcodes.ACC_ABSTRACT, mangledMethodName, descriptor, null, null);
    mv.visitEnd();
  }
View Full Code Here

        String localName = method.getName().substring(0,
            method.getName().length() - 1);
        Method toCall = new Method(localName, descriptor);

        // Must not be final
        MethodVisitor mv = super.visitMethod(Opcodes.ACC_PUBLIC
            | Opcodes.ACC_SYNTHETIC, mangledName, descriptor, null, null);
        if (mv != null) {
          mv.visitCode();

          /*
           * It just so happens that the stack and local variable sizes are the
           * same, but they're kept distinct to aid in clarity should the
           * dispatch logic change.
           *
           * These start at 1 because we need to load "this" onto the stack
           */
          int var = 1;
          int size = 1;

          // load this
          mv.visitVarInsn(Opcodes.ALOAD, 0);

          // then the rest of the arguments
          for (Type t : toCall.getArgumentTypes()) {
            size += t.getSize();
            mv.visitVarInsn(t.getOpcode(Opcodes.ILOAD), var);
            var += t.getSize();
          }

          // Make sure there's enough room for the return value
          size = Math.max(size, toCall.getReturnType().getSize());

          mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, currentTypeName,
              toCall.getName(), toCall.getDescriptor());
          mv.visitInsn(toCall.getReturnType().getOpcode(Opcodes.IRETURN));
          mv.visitMaxs(size, var);
          mv.visitEnd();
        }
      }
    }
  }
View Full Code Here

      String signature, String[] exceptions) {

    boolean isNative = (access & Opcodes.ACC_NATIVE) != 0;
    access &= ~Opcodes.ACC_NATIVE;

    MethodVisitor mv = super.visitMethod(access, name, desc, signature,
        exceptions);

    if (isNative) {
      mv = new MyMethodAdapter(mv, access, name, desc);
    }
View Full Code Here

  @Override
  public MethodVisitor visitMethod(int access, String name, String desc,
      String signature, String[] exceptions) {
    // Wrap the returned method visitor in my own.
    MethodVisitor mv = super.visitMethod(access, name, desc, signature,
        exceptions);
    return new MyMethodAdapter(mv);
  }
View Full Code Here

      String signature, String[] exceptions) {

    boolean isNative = (access & Opcodes.ACC_NATIVE) != 0;
    access &= ~Opcodes.ACC_NATIVE;

    MethodVisitor mv = super.visitMethod(access, name, desc, signature,
        exceptions);

    if (isNative) {
      mv = new MyMethodAdapter(mv, access, name, desc);
    }
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.asm.MethodVisitor

Copyright © 2018 www.massapicom. 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.