Package org.objectweb.asm

Examples of org.objectweb.asm.Type


        for (int i = 0; i < parameters.size(); i++) {
            ParameterDesc parameterDesc = (ParameterDesc) parameters.get(i);
            parameterASMTypes[i] = Type.getType(parameterDesc.getJavaType());
        }

        Type returnASMType = (operationDesc.getReturnClass() != null) ? Type.getType(operationDesc.getReturnClass()) : Type.VOID_TYPE;

        String methodDesc = Type.getMethodDescriptor(returnASMType, parameterASMTypes);
        OperationInfo operationInfo = new OperationInfo(operationDesc, usesSOAPAction, soapActionURI, soapVersion, operationQName, methodName, methodDesc);
        return operationInfo;
    }
View Full Code Here


                    for ( Map.Entry<String, Object> entry : mojoFieldVisitor.getMojoAnnotationVisitor().getAnnotationValues().entrySet() )
                    {
                        String methodName = entry.getKey();
                        if ( StringUtils.equals( "role", methodName ) )
                        {
                            Type type = (Type) entry.getValue();
                            componentAnnotationContent.setRoleClassName( type.getClassName() );
                        }
                        else
                        {
                            reflector.invoke( componentAnnotationContent, entry.getKey(),
                                              new Object[]{ entry.getValue() } );
View Full Code Here

    {
        // allocate a slot for the invoke parameters array,
        // construct the array
        // stash it into the slot and return the slot idx

        Type objectType = Type.getType(Object.class);
        Type objectArrayType = Type.getType("[Ljava/lang/Object;");
        Type[] invokeParamTypes = getInvokedTypes();
        int savedValueCount = invokeParamTypes.length;

        // create the array and save it in a local var slot

        int arrayValueSlot = newLocal(objectArrayType);
        push(savedValueCount);
        newArray(objectType);
        storeLocal(arrayValueSlot);

        // pop the arguments off the stack into the invoke parameters array
        // n.b. the top one is the last parameter

        for (int i = savedValueCount - 1; i >= 0; i--) {
            Type type = invokeParamTypes[i];
            if (type != null) {
                // convert value to object if needed
                box(type);
                // load array and  swap under value
                loadLocal(arrayValueSlot);
                swap(objectArrayType, objectType);
                // load index and swap under value
                push(i);
                swap(Type.INT_TYPE, objectType);
            } else {
                // this is a static method and index is 0 so we install null in the array
                // load array index and then null
                loadLocal(arrayValueSlot);
                push(i);
                push((Type)null);
            }
            // store the value in the array as an object
            arrayStore(objectType);
        }

        // now restore the arguments from the array in increasing order

        for (int i = 0; i < savedValueCount; i++) {
            Type type = invokeParamTypes[i];
            if (type != null) {
                // load the array, retrieve the object and unbox if needed
                loadLocal(arrayValueSlot);
                push(i);
                arrayLoad(objectType);
View Full Code Here

        // create the array used to pass the bindings

        int arraySize = callArrayBindings.size();

        push(arraySize);
        Type objectType = Type.getType(Object.class);
        newArray(objectType);

        // check if any of the bindings gets updated. if so we need to stash a copy of the bindings array
        // below the key and owner so we can pull out the updated values and update local var/param slots
        // once the call ahs completed
View Full Code Here

    private void doArgUpdate()
    {
        // at entry the top of the stack contains the object array
        // for an AT EXIT rule the entry below this is the return value

        Type objectType = Type.getType(Object.class);
        int arraySize = callArrayBindings.size();
        int lastUpdated = -1;
        int returnIdx = -1;

View Full Code Here

    }

    @Override
    public void visitMaxs(int maxStack, int maxLocals)
    {
        Type returnType =  Type.getReturnType(descriptor);

        // check whether there are outstanding monitor opens at the start of the trigger
        // block and, if so, insert a handler which unlocks the monitor and then rethrows
        // the exception.
View Full Code Here

    {
        // we need to set this here to avoid recursive re-entry into inject routine

        rule.setTypeInfo(getTriggerClass(), access, name, descriptor, exceptions);
        String key = rule.getKey();
        Type ruleType = Type.getType(TypeHelper.externalizeType("org.jboss.byteman.rule.Rule"));
        Method method = Method.getMethod("void execute(String, Object, Object[])");
        // we are at the relevant line in the method -- so add a trigger call here
        if (Transformer.isVerbose()) {
            System.out.println("RuleTriggerMethodAdapter.injectTriggerPoint : inserting trigger into " + getTriggerClass() + "." + getMethodName() + " for rule " + rule.getName());
        }
View Full Code Here

        }
        // Invocation
        mv.visitMethodInsn(INVOKEINTERFACE, itfName, methodName, desc);

        // Return the result
        Type returnType = Type.getReturnType(desc);
        if (returnType.getSort() != Type.VOID) {
            mv.visitInsn(returnType.getOpcode(IRETURN));
        } else {
            mv.visitInsn(RETURN);
        }

        // End of the method.
View Full Code Here

  }

  @Override
  public org.objectweb.asm.Type emit_const(MethodVisitor fa) {

    Type type = EDOUBLE_TYPE;

    fa.visitTypeInsn(Opcodes.NEW, type.getInternalName());
    fa.visitInsn(Opcodes.DUP);
    fa.visitLdcInsn(new Double(value));
    fa.visitMethodInsn(Opcodes.INVOKESPECIAL, type.getInternalName(),
        "<init>", "(D)V");

    return type;
  }
View Full Code Here

          mv.visitVarInsn(ALOAD, 0);
        }

        for (int i = 0; i < in.length - off; i++) {
          Arg arg = in[i + off];
          Type pt = parameterTypes[i];
          push(arg, pt);
        }
      }
View Full Code Here

TOP

Related Classes of org.objectweb.asm.Type

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.