Package org.objectweb.asm.commons

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


        if(ASMUtil.isDotKey(name)){
          LitString ls = (LitString)name;
        if(ls.getString().equalsIgnoreCase("THIS")){
          if(startIndex!=null)startIndex.setValue(1);
          adapter.loadArg(0);
          adapter.checkCast(Types.PAGE_CONTEXT_IMPL);
          if(defaultValue!=null) {
            defaultValue.writeOut(bc, MODE_REF);
            adapter.invokeVirtual(Types.PAGE_CONTEXT_IMPL,(countFM+countDM)==1?THIS_GET_EL:THIS_TOUCH_EL);
          }
          else adapter.invokeVirtual(Types.PAGE_CONTEXT_IMPL,(countFM+countDM)==1?THIS_GET:THIS_TOUCH);
View Full Code Here


      }
      // local
      Type rtn;
      if(scope==Scope.SCOPE_LOCAL && defaultValue!=null) {
        adapter.loadArg(0);
        adapter.checkCast(Types.PAGE_CONTEXT_IMPL);
      LitBoolean.FALSE.writeOut(bc, MODE_VALUE);
        defaultValue.writeOut(bc, MODE_VALUE);
        adapter.invokeVirtual(Types.PAGE_CONTEXT_IMPL, TypeScope.METHOD_LOCAL_EL);
        rtn= Types.OBJECT;
      }
View Full Code Here

   
   
    Attribute attr;
    // Interface Page
    adapter.visitVarInsn(Opcodes.ALOAD, 0);
    adapter.checkCast(Types.INTERFACE_PAGE);

    // extened
    attr = interf.removeAttribute("extends");
    if(attr!=null) ExpressionUtil.writeOutSilent(attr.getValue(),bc, Expression.MODE_REF);
    else adapter.push("");
View Full Code Here

   
  // tag=pc.use(str);
    adapter.loadArg(0);
    adapter.push(tlt.getTagClassName());
    adapter.invokeVirtual(Types.PAGE_CONTEXT, USE);
    adapter.checkCast(currType);
    adapter.storeLocal(currLocal);
 
  TryFinallyVisitor outerTcfv=new TryFinallyVisitor(new OnFinally() {
    public void writeOut(BytecodeContext bc) {
View Full Code Here

        adapter.visitLabel(start);
       
        // load Object
        if(!isStatic) {
          adapter.visitVarInsn(Opcodes.ALOAD, 1);
          adapter.checkCast(type);
    }
         
        // load params
        Class<?>[] params = method.getParameterTypes();
View Full Code Here

          adapter.visitVarInsn(Opcodes.ALOAD, 2);
          adapter.push(i);
          //adapter.visitInsn(Opcodes.ICONST_0);
          adapter.visitInsn(Opcodes.AALOAD);
         
          adapter.checkCast(toReferenceType(params[i],paramTypes[i]));
         
          // cast
          if(params[i]==boolean.class) adapter.invokeVirtual(Types.BOOLEAN, BOOL_VALUE);
          else if(params[i]==short.class) adapter.invokeVirtual(Types.SHORT, SHORT_VALUE);
          else if(params[i]==int.class) adapter.invokeVirtual(Types.INTEGER, INT_VALUE);
View Full Code Here

            }
        }
        Type t=getType(type);
       
        expr.writeOut(bc,MODE_REF);
        adapter.checkCast(t);
        return t;
    }

    /*
    private int writeExprx(BytecodeContext bc) throws TemplateException {
View Full Code Here

    private void synthetic(org.objectweb.asm.commons.Method stronglyTypedMethod, Type callbackType) {
        GeneratorAdapter adapter = method(ACC_PUBLIC + ACC_BRIDGE + ACC_SYNTHETIC,
                asmMethod("void onMessage (" + Object.class.getName() + ")"));
        adapter.loadThis();
        adapter.loadArg(0);
        adapter.checkCast(callbackType);
        adapter.invokeVirtual(outputType(), stronglyTypedMethod);
        adapter.returnValue();
        adapter.endMethod();
    }
View Full Code Here

        break;
      default:
      case Type.OBJECT:
        // in this case check the cast and cast the object to the return
        // type
        methodAdapter.checkCast(returnType);
        methodAdapter.cast(OBJECT_TYPE, returnType);
        break;
    }
    // return the (appropriately cast) result of the invocation from the
    // stack
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.